diff --git a/ibm_vpc/vpc_v1.py b/ibm_vpc/vpc_v1.py index 5fba682..928a66a 100644 --- a/ibm_vpc/vpc_v1.py +++ b/ibm_vpc/vpc_v1.py @@ -1,6 +1,6 @@ # coding: utf-8 -# (C) Copyright IBM Corp. 2021, 2022. +# (C) Copyright IBM Corp. 2020, 2021, 2022. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -21,7 +21,7 @@ and manage virtual server instances, along with subnets, volumes, load balancers, and more. -API Version: 2022-02-08 +API Version: 2022-03-29 """ from datetime import datetime @@ -50,7 +50,7 @@ class VpcV1(BaseService): @classmethod def new_instance(cls, - version: str = '2022-02-08', + version: str = '2022-03-29', service_name: str = DEFAULT_SERVICE_NAME, generation: int = 2, ) -> 'VpcV1': @@ -58,9 +58,9 @@ def new_instance(cls, Return a new client for the vpc service using the specified parameters and external configuration. - :param str version: Requests the API version as of a date, in format - `YYYY-MM-DD`. Any date between `2019-01-01` and the current date may be - specified. Specify the current date to request the latest version. + :param str version: The API version, in format `YYYY-MM-DD`. For the API + behavior documented here, specify any date between `2022-03-29` and today's + date (UTC). """ if version is None: raise ValueError('version must be provided') @@ -75,16 +75,16 @@ def new_instance(cls, return service def __init__(self, - version: str = '2022-02-08', + version: str = '2022-03-29', authenticator: Authenticator = None, generation: int = 2, ) -> None: """ Construct a new client for the vpc service. - :param str version: Requests the API version as of a date, in format - `YYYY-MM-DD`. Any date between `2019-01-01` and the current date may be - specified. Specify the current date to request the latest version. + :param str version: The API version, in format `YYYY-MM-DD`. For the API + behavior documented here, specify any date between `2022-03-29` and today's + date (UTC). :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 @@ -178,13 +178,12 @@ def create_vpc(self, necessary to create the new VPC. :param str address_prefix_management: (optional) Indicates whether a - default address prefix should be automatically created for each zone in - this VPC. If `manual`, this VPC will be created with no default address + default address prefix will be automatically created for each zone in this + VPC. If `manual`, this VPC will be created with no default address prefixes. - This property's value is used only when creating the VPC. 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 should be + 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 @@ -1228,10 +1227,10 @@ def create_vpc_routing_table(self, VPC must not already have a routing table with this property set to `true`. Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of `deliver` are treated as `drop` - unless the `next_hop` is an IP address within the VPC's address prefix - ranges. Therefore, if an incoming packet matches a route with a `next_hop` - of an internet-bound IP address or a VPN gateway connection, the packet - will be dropped. + unless the `next_hop` is an IP address bound to a network interface on a + subnet in the route's `zone`. Therefore, if an incoming packet matches a + route with a `next_hop` of an internet-bound IP address or a VPN gateway + connection, the packet will be dropped. :param bool route_transit_gateway_ingress: (optional) If set to `true`, this routing table will be used to route traffic that originates from [Transit Gateway](https://cloud.ibm.com/cloud/transit-gateway/) to this @@ -1239,10 +1238,10 @@ def create_vpc_routing_table(self, with this property set to `true`. Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of `deliver` are treated as `drop` - unless the `next_hop` is an IP address within the VPC's address prefix - ranges. Therefore, if an incoming packet matches a route with a `next_hop` - of an internet-bound IP address or a VPN gateway connection, the packet - will be dropped. + unless the `next_hop` is an IP address bound to a network interface on a + subnet in the route's `zone`. Therefore, if an incoming packet matches a + route with a `next_hop` of an internet-bound IP address or a VPN gateway + connection, the packet will be dropped. If [Classic Access](https://cloud.ibm.com/docs/vpc?topic=vpc-setting-up-access-to-classic-infrastructure) is enabled for this VPC, and this property is set to `true`, its incoming @@ -2436,8 +2435,8 @@ def list_subnet_reserved_ips(self, """ List all reserved IPs in a subnet. - This request lists reserved IPs in a subnet that are unbound or bound to an - endpoint gateway. + This request lists all reserved IPs in a subnet. A reserved IP resource will exist + for every address in the subnet which is not available for use. :param str subnet_id: The subnet identifier. :param str start: (optional) A server-provided token determining what @@ -2489,6 +2488,7 @@ def list_subnet_reserved_ips(self, def create_subnet_reserved_ip(self, subnet_id: str, *, + address: str = None, auto_delete: bool = None, name: str = None, target: 'ReservedIPTargetPrototype' = None, @@ -2497,9 +2497,14 @@ def create_subnet_reserved_ip(self, """ Reserve an IP in a subnet. - This request reserves a system-selected IP address in a subnet. + This request reserves an IP address in a subnet. If the provided prototype object + includes an `address`, the address must not already be reserved. :param str subnet_id: The 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 bool auto_delete: (optional) Indicates whether this reserved IP member will be automatically deleted when either `target` is deleted, or the reserved IP is unbound. Must be `false` if the @@ -2532,6 +2537,7 @@ def create_subnet_reserved_ip(self, } data = { + 'address': address, 'auto_delete': auto_delete, 'name': name, 'target': target @@ -4355,7 +4361,7 @@ def create_instance_network_interface(self, *, allow_ip_spoofing: bool = None, name: str = None, - primary_ipv4_address: str = None, + primary_ip: 'NetworkInterfaceIPPrototype' = None, security_groups: List['SecurityGroupIdentity'] = None, **kwargs ) -> DetailedResponse: @@ -4379,10 +4385,14 @@ def create_instance_network_interface(self, Names must be unique within the instance the network interface resides in. If unspecified, the name will be a hyphenated list of randomly-selected words. - :param str primary_ipv4_address: (optional) The primary IPv4 address. If - specified, it must be an available address on the network interface's - subnet. If unspecified, an available address on the subnet will be - automatically selected. + :param NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP + address to bind to the 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 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 network interface. If unspecified, the VPC's default security group is used. @@ -4396,6 +4406,8 @@ def create_instance_network_interface(self, if subnet is None: raise ValueError('subnet must be provided') subnet = convert_model(subnet) + if primary_ip is not None: + primary_ip = convert_model(primary_ip) if security_groups is not None: security_groups = [convert_model(x) for x in security_groups] headers = {} @@ -4413,7 +4425,7 @@ def create_instance_network_interface(self, 'subnet': subnet, 'allow_ip_spoofing': allow_ip_spoofing, 'name': name, - 'primary_ipv4_address': primary_ipv4_address, + 'primary_ip': primary_ip, 'security_groups': security_groups } data = {k: v for (k, v) in data.items() if v is not None} @@ -4815,6 +4827,117 @@ def add_instance_network_interface_floating_ip(self, return response + def list_instance_network_interface_ips(self, + instance_id: str, + network_interface_id: str, + *, + start: str = None, + limit: int = None, + **kwargs + ) -> DetailedResponse: + """ + List all reserved IPs bound to a network interface. + + This request lists all reserved IPs bound to a network interface. + + :param str instance_id: The instance identifier. + :param str network_interface_id: The network interface 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 `ReservedIPCollectionNetworkInterfaceContext` object + """ + + if instance_id is None: + raise ValueError('instance_id must be provided') + if network_interface_id is None: + raise ValueError('network_interface_id must be provided') + headers = {} + sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='list_instance_network_interface_ips') + headers.update(sdk_headers) + + params = { + 'version': self.version, + 'generation': self.generation, + 'start': start, + 'limit': limit + } + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + headers['Accept'] = 'application/json' + + path_param_keys = ['instance_id', 'network_interface_id'] + path_param_values = self.encode_path_vars(instance_id, network_interface_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/instances/{instance_id}/network_interfaces/{network_interface_id}/ips'.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_instance_network_interface_ip(self, + instance_id: str, + network_interface_id: str, + id: str, + **kwargs + ) -> DetailedResponse: + """ + Retrieve bound reserved IP. + + This request a retrieves the specified reserved IP address if it is bound to the + network interface and instance specified in the URL. + + :param str instance_id: The instance identifier. + :param str network_interface_id: The network interface 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 `ReservedIP` object + """ + + if instance_id is None: + raise ValueError('instance_id must be provided') + if network_interface_id is None: + raise ValueError('network_interface_id must be provided') + if id is None: + 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_network_interface_ip') + headers.update(sdk_headers) + + params = { + 'version': self.version, + 'generation': self.generation + } + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + headers['Accept'] = 'application/json' + + path_param_keys = ['instance_id', 'network_interface_id', 'id'] + path_param_values = self.encode_path_vars(instance_id, network_interface_id, id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/instances/{instance_id}/network_interfaces/{network_interface_id}/ips/{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 list_instance_volume_attachments(self, instance_id: str, **kwargs @@ -5166,8 +5289,11 @@ def create_instance_group(self, This request creates a new instance group. - :param InstanceTemplateIdentity instance_template: Identifies an instance - template by a unique property. + :param InstanceTemplateIdentity instance_template: Instance template to use + when creating new instances. + Instance groups are not compatible with instance templates that specify + `true` for + `default_trusted_profile.auto_link`. :param List[SubnetIdentity] subnets: The subnets to use when creating new instances. :param int application_port: (optional) Required if specifying a load @@ -8630,6 +8756,109 @@ def add_bare_metal_server_network_interface_floating_ip(self, return response + def list_bare_metal_server_network_interface_ips(self, + bare_metal_server_id: str, + network_interface_id: str, + **kwargs + ) -> DetailedResponse: + """ + List all reserved IPs bound to a network interface. + + This request lists all reserved IPs bound to a network interface. + + :param str bare_metal_server_id: The bare metal server identifier. + :param str network_interface_id: The 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 `ReservedIPCollectionNetworkInterfaceContext` object + """ + + if bare_metal_server_id is None: + raise ValueError('bare_metal_server_id must be provided') + if network_interface_id is None: + raise ValueError('network_interface_id must be provided') + headers = {} + sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='list_bare_metal_server_network_interface_ips') + headers.update(sdk_headers) + + params = { + 'version': self.version, + 'generation': self.generation + } + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + headers['Accept'] = 'application/json' + + path_param_keys = ['bare_metal_server_id', 'network_interface_id'] + path_param_values = self.encode_path_vars(bare_metal_server_id, network_interface_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/bare_metal_servers/{bare_metal_server_id}/network_interfaces/{network_interface_id}/ips'.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_bare_metal_server_network_interface_ip(self, + bare_metal_server_id: str, + network_interface_id: str, + id: str, + **kwargs + ) -> DetailedResponse: + """ + Retrieve bound reserved IP. + + This request a retrieves the specified reserved IP address if it is bound to the + network interface and bare metal server specified in the URL. + + :param str bare_metal_server_id: The bare metal server identifier. + :param str network_interface_id: The network interface 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 `ReservedIP` object + """ + + if bare_metal_server_id is None: + raise ValueError('bare_metal_server_id must be provided') + if network_interface_id is None: + raise ValueError('network_interface_id must be provided') + if id is None: + raise ValueError('id must be provided') + headers = {} + sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_bare_metal_server_network_interface_ip') + headers.update(sdk_headers) + + params = { + 'version': self.version, + 'generation': self.generation + } + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + headers['Accept'] = 'application/json' + + path_param_keys = ['bare_metal_server_id', 'network_interface_id', 'id'] + path_param_values = self.encode_path_vars(bare_metal_server_id, network_interface_id, id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/bare_metal_servers/{bare_metal_server_id}/network_interfaces/{network_interface_id}/ips/{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 delete_bare_metal_server(self, id: str, **kwargs @@ -9181,6 +9410,8 @@ def create_volume(self, def delete_volume(self, id: str, + *, + if_match: str = None, **kwargs ) -> DetailedResponse: """ @@ -9190,6 +9421,8 @@ def delete_volume(self, to succeed, the volume must not be attached to any instances. :param str id: The volume 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 @@ -9197,7 +9430,9 @@ def delete_volume(self, if id is None: 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_volume') @@ -9272,6 +9507,8 @@ def get_volume(self, def update_volume(self, id: str, volume_patch: 'VolumePatch', + *, + if_match: str = None, **kwargs ) -> DetailedResponse: """ @@ -9283,6 +9520,9 @@ def update_volume(self, :param str id: The volume identifier. :param VolumePatch volume_patch: The volume 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 `Volume` object @@ -9294,7 +9534,9 @@ def update_volume(self, raise ValueError('volume_patch must be provided') if isinstance(volume_patch, VolumePatch): volume_patch = convert_model(volume_patch) - headers = {} + headers = { + 'If-Match': if_match + } sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='update_volume') @@ -9458,10 +9700,7 @@ def list_snapshots(self, def create_snapshot(self, - source_volume: 'VolumeIdentity', - *, - name: str = None, - resource_group: 'ResourceGroupIdentity' = None, + snapshot_prototype: 'SnapshotPrototype', **kwargs ) -> DetailedResponse: """ @@ -9471,24 +9710,16 @@ def create_snapshot(self, prototype object is structured in the same way as a retrieved snapshot, and contains the information necessary to provision the new snapshot. - :param VolumeIdentity source_volume: The volume to snapshot. - :param str name: (optional) The unique user-defined name for this snapshot. - 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) is - used. + :param SnapshotPrototype snapshot_prototype: The snapshot 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 `Snapshot` object """ - if source_volume is None: - raise ValueError('source_volume must be provided') - source_volume = convert_model(source_volume) - if resource_group is not None: - resource_group = convert_model(resource_group) + if snapshot_prototype is None: + raise ValueError('snapshot_prototype must be provided') + if isinstance(snapshot_prototype, SnapshotPrototype): + snapshot_prototype = convert_model(snapshot_prototype) headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', @@ -9500,13 +9731,7 @@ def create_snapshot(self, 'generation': self.generation } - data = { - 'source_volume': source_volume, - 'name': name, - 'resource_group': resource_group - } - data = {k: v for (k, v) in data.items() if v is not None} - data = json.dumps(data) + data = json.dumps(snapshot_prototype) headers['content-type'] = 'application/json' if 'headers' in kwargs: @@ -9526,6 +9751,8 @@ def create_snapshot(self, def delete_snapshot(self, id: str, + *, + if_match: str = None, **kwargs ) -> DetailedResponse: """ @@ -9534,6 +9761,8 @@ def delete_snapshot(self, This request deletes a snapshot. This operation cannot be reversed. :param str id: The snapshot 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 @@ -9541,7 +9770,9 @@ def delete_snapshot(self, if id is None: 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_snapshot') @@ -9616,6 +9847,8 @@ def get_snapshot(self, def update_snapshot(self, id: str, snapshot_patch: 'SnapshotPatch', + *, + if_match: str = None, **kwargs ) -> DetailedResponse: """ @@ -9625,6 +9858,9 @@ def update_snapshot(self, :param str id: The snapshot identifier. :param SnapshotPatch snapshot_patch: The snapshot 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 `Snapshot` object @@ -9636,7 +9872,9 @@ def update_snapshot(self, raise ValueError('snapshot_patch must be provided') if isinstance(snapshot_patch, SnapshotPatch): snapshot_patch = convert_model(snapshot_patch) - headers = {} + headers = { + 'If-Match': if_match + } sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='update_snapshot') @@ -10153,6 +10391,7 @@ def list_floating_ips(self, start: str = None, limit: int = None, resource_group_id: str = None, + sort: str = None, **kwargs ) -> DetailedResponse: """ @@ -10166,6 +10405,11 @@ def list_floating_ips(self, :param int limit: (optional) The number of resources to return on a page. :param str resource_group_id: (optional) Filters the collection to resources in the resource group with 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 `FloatingIPCollection` object @@ -10182,7 +10426,8 @@ def list_floating_ips(self, 'generation': self.generation, 'start': start, 'limit': limit, - 'resource_group.id': resource_group_id + 'resource_group.id': resource_group_id, + 'sort': sort } if 'headers' in kwargs: @@ -11223,215 +11468,6 @@ def update_security_group(self, return response - def list_security_group_network_interfaces(self, - security_group_id: str, - *, - start: str = None, - limit: int = None, - **kwargs - ) -> DetailedResponse: - """ - List all network interfaces associated with a security group. - - This request lists all network interfaces associated with a security group, to - which the rules in the security group are applied. - - :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 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 `NetworkInterfaceCollection` object - """ - - if security_group_id is None: - 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_network_interfaces') - headers.update(sdk_headers) - - params = { - 'version': self.version, - 'generation': self.generation, - 'start': start, - 'limit': limit - } - - if 'headers' in kwargs: - headers.update(kwargs.get('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}/network_interfaces'.format(**path_param_dict) - request = self.prepare_request(method='GET', - url=url, - headers=headers, - params=params) - - response = self.send(request, **kwargs) - return response - - - def remove_security_group_network_interface(self, - security_group_id: str, - id: str, - **kwargs - ) -> DetailedResponse: - """ - Remove a network interface from a security group. - - This request removes a network interface from a security group. Security groups - are stateful, so any changes to a network interface's security groups are applied - to new connections. Existing connections are not affected. If the network - interface being removed has no other security groups, it will be attached to the - VPC's default security group. - - :param str security_group_id: The security group identifier. - :param str id: The 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 - """ - - if security_group_id is None: - raise ValueError('security_group_id must be provided') - if id is None: - raise ValueError('id must be provided') - headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='remove_security_group_network_interface') - headers.update(sdk_headers) - - params = { - 'version': self.version, - 'generation': self.generation - } - - if 'headers' in kwargs: - headers.update(kwargs.get('headers')) - - 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}/network_interfaces/{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_security_group_network_interface(self, - security_group_id: str, - id: str, - **kwargs - ) -> DetailedResponse: - """ - Retrieve a network interface in a security group. - - This request retrieves a single network interface specified by the identifier in - the URL path. The network interface must be an existing member of the security - group. - - :param str security_group_id: The security group identifier. - :param str id: The 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 `NetworkInterface` object - """ - - if security_group_id is None: - raise ValueError('security_group_id must be provided') - if id is None: - 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_network_interface') - headers.update(sdk_headers) - - params = { - 'version': self.version, - 'generation': self.generation - } - - if 'headers' in kwargs: - headers.update(kwargs.get('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}/network_interfaces/{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 add_security_group_network_interface(self, - security_group_id: str, - id: str, - **kwargs - ) -> DetailedResponse: - """ - Add a network interface to a security group. - - This request adds an existing network interface to an existing security group. - When a network interface is added to a security group, the security group rules - are applied to the network interface. A request body is not required, and if - provided, is ignored. - - :param str security_group_id: The security group identifier. - :param str id: The 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 `NetworkInterface` object - """ - - if security_group_id is None: - raise ValueError('security_group_id must be provided') - if id is None: - raise ValueError('id must be provided') - headers = {} - sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='add_security_group_network_interface') - headers.update(sdk_headers) - - params = { - 'version': self.version, - 'generation': self.generation - } - - if 'headers' in kwargs: - headers.update(kwargs.get('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}/network_interfaces/{id}'.format(**path_param_dict) - request = self.prepare_request(method='PUT', - url=url, - headers=headers, - params=params) - - response = self.send(request, **kwargs) - return response - - def list_security_group_rules(self, security_group_id: str, **kwargs @@ -11492,10 +11528,10 @@ def create_security_group_rule(self, 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 should 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. + 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 str security_group_id: The security group identifier. :param SecurityGroupRulePrototype security_group_rule_prototype: The @@ -13776,7 +13812,8 @@ def delete_load_balancer(self, """ Delete a load balancer. - This request deletes a load balancer. This operation cannot be reversed. + This request deletes a load balancer. This operation cannot be reversed. A load + balancer cannot be deleted if its `provisioning_status` is `delete_pending`. :param str id: The load balancer identifier. :param dict headers: A `dict` containing the request headers @@ -14028,12 +14065,10 @@ def create_load_balancer_listener(self, :param str protocol: The listener protocol. Each listener in the load balancer must have a unique `port` and `protocol` combination. Additional restrictions: - - If this load balancer is in the `network` family, the protocol must be - `tcp`. - - If this listener has `https_redirect` specified, the protocol must be - `http`. - - If this listener is a listener's `https_redirect` target, the protocol - must be `https`. + - If this load balancer is in the `network` family: + - The protocol must be `tcp` or `udp` (if `udp_supported` is `true`). + - If `default_pool` is set, the pool protocol must match. + - 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`). @@ -14052,10 +14087,11 @@ def create_load_balancer_listener(self, :param int connection_limit: (optional) The connection limit of the listener. :param LoadBalancerPoolIdentity default_pool: (optional) The default pool - associated with the listener. The specified pool must: + for this listener. The specified pool must: - Belong to this load balancer - - Have the same `protocol` as this listener - - Not already be the default pool for another listener. + - 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. :param LoadBalancerListenerHTTPSRedirectPrototype https_redirect: (optional) The target listener that requests will be redirected to. This listener must have a @@ -15007,9 +15043,9 @@ def create_load_balancer_pool(self, :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`. Load balancers in the - `application` family support `tcp`, `http`, and - `https`. + 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 @@ -16198,7 +16234,7 @@ def list_flow_log_collectors(self, def create_flow_log_collector(self, - storage_bucket: 'CloudObjectStorageBucketIdentity', + storage_bucket: 'LegacyCloudObjectStorageBucketIdentity', target: 'FlowLogCollectorTargetPrototype', *, active: bool = None, @@ -16214,8 +16250,8 @@ def create_flow_log_collector(self, retrieved flow log collector, and contains the information necessary to create and start the new flow log collector. - :param CloudObjectStorageBucketIdentity storage_bucket: The Cloud Object - Storage bucket where the collected flows will be logged. + :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. @@ -16501,6 +16537,23 @@ class Sort(str, Enum): 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. @@ -18308,8 +18361,7 @@ class BareMetalServerNetworkInterface(): is not known. :attr str name: The user-defined name for this network interface. :attr int port_speed: The network interface port speed in Mbps. - :attr str primary_ipv4_address: The primary IPv4 address. - If the address has not yet been selected, the value will be `0.0.0.0`. + :attr ReservedIPReference primary_ip: :attr str resource_type: The resource type. :attr List[SecurityGroupReference] security_groups: The security groups targeting this network interface. @@ -18328,7 +18380,7 @@ def __init__(self, mac_address: str, name: str, port_speed: int, - primary_ipv4_address: str, + primary_ip: 'ReservedIPReference', resource_type: str, security_groups: List['SecurityGroupReference'], status: str, @@ -18373,8 +18425,7 @@ def __init__(self, value is not known. :param str name: The user-defined name for this network interface. :param int port_speed: The network interface port speed in Mbps. - :param str primary_ipv4_address: The primary IPv4 address. - If the address has not yet been selected, the value will be `0.0.0.0`. + :param ReservedIPReference primary_ip: :param str resource_type: The resource type. :param List[SecurityGroupReference] security_groups: The security groups targeting this network interface. @@ -18824,9 +18875,14 @@ class BareMetalServerNetworkInterfacePrototype(): :attr str name: (optional) The user-defined name for network interface. Names must be unique within the instance the network interface resides in. If unspecified, the name will be a hyphenated list of randomly-selected words. - :attr str primary_ipv4_address: (optional) The primary IPv4 address. If - specified, it must be an available address on the network interface's subnet. If - unspecified, an available address on the subnet will be automatically selected. + :attr NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP address + to bind to the 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 network interface's subnet. Otherwise, an available address + on the + subnet will be automatically selected and reserved. :attr List[SecurityGroupIdentity] security_groups: (optional) The security groups to use for this network interface. If unspecified, the VPC's default security group is used. @@ -18840,7 +18896,7 @@ def __init__(self, allow_ip_spoofing: bool = None, enable_infrastructure_nat: bool = None, name: str = None, - primary_ipv4_address: str = None, + primary_ip: 'NetworkInterfaceIPPrototype' = None, security_groups: List['SecurityGroupIdentity'] = None) -> None: """ Initialize a BareMetalServerNetworkInterfacePrototype object. @@ -18877,10 +18933,14 @@ def __init__(self, Names must be unique within the instance the network interface resides in. If unspecified, the name will be a hyphenated list of randomly-selected words. - :param str primary_ipv4_address: (optional) The primary IPv4 address. If - specified, it must be an available address on the network interface's - subnet. If unspecified, an available address on the subnet will be - automatically selected. + :param NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP + address to bind to the 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 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 network interface. If unspecified, the VPC's default security group is used. @@ -19030,9 +19090,14 @@ class BareMetalServerPrimaryNetworkInterfacePrototype(): :attr str name: (optional) The user-defined name for network interface. Names must be unique within the instance the network interface resides in. If unspecified, the name will be a hyphenated list of randomly-selected words. - :attr str primary_ipv4_address: (optional) The primary IPv4 address. If - specified, it must be an available address on the network interface's subnet. If - unspecified, an available address on the subnet will be automatically selected. + :attr NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP address + to bind to the 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 network interface's subnet. Otherwise, an available address + on the + subnet will be automatically selected and reserved. :attr List[SecurityGroupIdentity] security_groups: (optional) The security groups to use for this network interface. If unspecified, the VPC's default security group is used. @@ -19047,7 +19112,7 @@ def __init__(self, enable_infrastructure_nat: bool = None, interface_type: str = None, name: str = None, - primary_ipv4_address: str = None, + primary_ip: 'NetworkInterfaceIPPrototype' = None, security_groups: List['SecurityGroupIdentity'] = None) -> None: """ Initialize a BareMetalServerPrimaryNetworkInterfacePrototype object. @@ -19081,10 +19146,14 @@ def __init__(self, Names must be unique within the instance the network interface resides in. If unspecified, the name will be a hyphenated list of randomly-selected words. - :param str primary_ipv4_address: (optional) The primary IPv4 address. If - specified, it must be an available address on the network interface's - subnet. If unspecified, an available address on the subnet will be - automatically selected. + :param NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP + address to bind to the 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 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 network interface. If unspecified, the VPC's default security group is used. @@ -19094,7 +19163,7 @@ def __init__(self, self.enable_infrastructure_nat = enable_infrastructure_nat self.interface_type = interface_type self.name = name - self.primary_ipv4_address = primary_ipv4_address + self.primary_ip = primary_ip self.security_groups = security_groups self.subnet = subnet @@ -19112,8 +19181,8 @@ def from_dict(cls, _dict: Dict) -> 'BareMetalServerPrimaryNetworkInterfaceProtot args['interface_type'] = _dict.get('interface_type') if 'name' in _dict: args['name'] = _dict.get('name') - if 'primary_ipv4_address' in _dict: - args['primary_ipv4_address'] = _dict.get('primary_ipv4_address') + if 'primary_ip' in _dict: + args['primary_ip'] = _dict.get('primary_ip') if 'security_groups' in _dict: args['security_groups'] = _dict.get('security_groups') if 'subnet' in _dict: @@ -19140,8 +19209,11 @@ def to_dict(self) -> Dict: _dict['interface_type'] = self.interface_type if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'primary_ipv4_address') and self.primary_ipv4_address is not None: - _dict['primary_ipv4_address'] = self.primary_ipv4_address + 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 x in self.security_groups: @@ -20516,77 +20588,6 @@ def __ne__(self, other: 'CertificateInstanceReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class CloudObjectStorageBucketIdentity(): - """ - Identifies a Cloud Object Storage bucket by a unique property. - - """ - - def __init__(self) -> None: - """ - Initialize a CloudObjectStorageBucketIdentity object. - - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['CloudObjectStorageBucketIdentityByName'])) - raise Exception(msg) - -class CloudObjectStorageBucketReference(): - """ - CloudObjectStorageBucketReference. - - :attr str name: The globally unique name of this COS bucket. - """ - - def __init__(self, - name: str) -> None: - """ - Initialize a CloudObjectStorageBucketReference object. - - :param str name: The globally unique name of this COS bucket. - """ - self.name = name - - @classmethod - def from_dict(cls, _dict: Dict) -> 'CloudObjectStorageBucketReference': - """Initialize a CloudObjectStorageBucketReference object from a json dictionary.""" - args = {} - if 'name' in _dict: - args['name'] = _dict.get('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.""" - 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 CloudObjectStorageBucketReference object.""" - return json.dumps(self.to_dict(), indent=2) - - 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: 'CloudObjectStorageBucketReference') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - class DedicatedHost(): """ DedicatedHost. @@ -23665,24 +23666,27 @@ class DefaultRoutingTable(): [Direct Link](https://cloud.ibm.com/docs/dl/) to this VPC. Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of `deliver` are treated as `drop` unless the - `next_hop` is an IP address within the VPC's address prefix ranges. Therefore, - if an incoming packet matches a route with a `next_hop` of an internet-bound IP - address or a VPN gateway connection, the packet will be dropped. + `next_hop` is an IP address bound to a network interface on a subnet in the + route's `zone`. Therefore, if an incoming packet matches a route with a + `next_hop` of an internet-bound IP address or a VPN gateway connection, the + packet will be dropped. :attr bool route_transit_gateway_ingress: Indicates whether this routing table is used to route traffic that originates from from [Transit Gateway](https://cloud.ibm.com/cloud/transit-gateway/) to this VPC. Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of `deliver` are treated as `drop` unless the - `next_hop` is an IP address within the VPC's address prefix ranges. Therefore, - if an incoming packet matches a route with a `next_hop` of an internet-bound IP - address or a VPN gateway connection, the packet will be dropped. + `next_hop` is an IP address bound to a network interface on a subnet in the + route's `zone`. Therefore, if an incoming packet matches a route with a + `next_hop` of an internet-bound IP address or a VPN gateway connection, the + packet will be dropped. :attr bool route_vpc_zone_ingress: Indicates whether this routing table is used to route traffic that originates from subnets in other zones in this VPC. Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of `deliver` are treated as `drop` unless the - `next_hop` is an IP address within the VPC's address prefix ranges. Therefore, - if an incoming packet matches a route with a `next_hop` of an internet-bound IP - address or a VPN gateway connection, the packet will be dropped. + `next_hop` is an IP address bound to a network interface on a subnet in the + route's `zone`. Therefore, if an incoming packet matches a route with a + `next_hop` of an internet-bound IP address or a VPN gateway connection, the + packet will be dropped. :attr List[RouteReference] routes: The routes for the default routing table for this VPC. The table is created with no routes, but routes may be added, changed, or removed with a subsequent request. @@ -23722,28 +23726,28 @@ def __init__(self, [Direct Link](https://cloud.ibm.com/docs/dl/) to this VPC. Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of `deliver` are treated as `drop` - unless the `next_hop` is an IP address within the VPC's address prefix - ranges. Therefore, if an incoming packet matches a route with a `next_hop` - of an internet-bound IP address or a VPN gateway connection, the packet - will be dropped. + unless the `next_hop` is an IP address bound to a network interface on a + subnet in the route's `zone`. Therefore, if an incoming packet matches a + route with a `next_hop` of an internet-bound IP address or a VPN gateway + connection, the packet will be dropped. :param bool route_transit_gateway_ingress: Indicates whether this routing table is used to route traffic that originates from from [Transit Gateway](https://cloud.ibm.com/cloud/transit-gateway/) to this VPC. Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of `deliver` are treated as `drop` - unless the `next_hop` is an IP address within the VPC's address prefix - ranges. Therefore, if an incoming packet matches a route with a `next_hop` - of an internet-bound IP address or a VPN gateway connection, the packet - will be dropped. + unless the `next_hop` is an IP address bound to a network interface on a + subnet in the route's `zone`. Therefore, if an incoming packet matches a + route with a `next_hop` of an internet-bound IP address or a VPN gateway + connection, the packet will be dropped. :param bool route_vpc_zone_ingress: Indicates whether this routing table is used to route traffic that originates from subnets in other zones in this VPC. Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of `deliver` are treated as `drop` - unless the `next_hop` is an IP address within the VPC's address prefix - ranges. Therefore, if an incoming packet matches a route with a `next_hop` - of an internet-bound IP address or a VPN gateway connection, the packet - will be dropped. + unless the `next_hop` is an IP address bound to a network interface on a + subnet in the route's `zone`. Therefore, if an incoming packet matches a + route with a `next_hop` of an internet-bound IP address or a VPN gateway + connection, the packet will be dropped. :param List[RouteReference] routes: The routes for the default routing table for this VPC. The table is created with no routes, but routes may be added, changed, or removed with a subsequent request. @@ -25564,8 +25568,8 @@ class FlowLogCollector(): :attr str name: The unique user-defined name for this flow log collector. :attr ResourceGroupReference resource_group: The resource group for this flow log collector. - :attr CloudObjectStorageBucketReference storage_bucket: The Cloud Object Storage - bucket where the collected flows are logged. + :attr LegacyCloudObjectStorageBucketReference storage_bucket: The Cloud Object + Storage bucket where the collected flows are logged. :attr FlowLogCollectorTarget target: The target this collector is collecting flow logs for. If the target is an instance, subnet, or VPC, flow logs will not be collected for any network interfaces @@ -25584,7 +25588,7 @@ def __init__(self, lifecycle_state: str, name: str, resource_group: 'ResourceGroupReference', - storage_bucket: 'CloudObjectStorageBucketReference', + storage_bucket: 'LegacyCloudObjectStorageBucketReference', target: 'FlowLogCollectorTarget', vpc: 'VPCReference') -> None: """ @@ -25603,8 +25607,8 @@ def __init__(self, :param str name: The unique user-defined name for this flow log collector. :param ResourceGroupReference resource_group: The resource group for this flow log collector. - :param CloudObjectStorageBucketReference storage_bucket: The Cloud Object - Storage bucket where the collected flows are logged. + :param LegacyCloudObjectStorageBucketReference storage_bucket: The Cloud + Object Storage bucket where the collected flows are logged. :param FlowLogCollectorTarget target: The target this collector is collecting flow logs for. If the target is an instance, subnet, or VPC, flow logs will not be collected for any network interfaces @@ -25668,7 +25672,7 @@ def from_dict(cls, _dict: Dict) -> 'FlowLogCollector': else: raise ValueError('Required property \'resource_group\' not present in FlowLogCollector JSON') if 'storage_bucket' in _dict: - args['storage_bucket'] = CloudObjectStorageBucketReference.from_dict(_dict.get('storage_bucket')) + args['storage_bucket'] = LegacyCloudObjectStorageBucketReference.from_dict(_dict.get('storage_bucket')) else: raise ValueError('Required property \'storage_bucket\' not present in FlowLogCollector JSON') if 'target' in _dict: @@ -26070,6 +26074,63 @@ def __init__(self) -> None: ", ".join(['FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity', 'FlowLogCollectorTargetPrototypeInstanceIdentity', 'FlowLogCollectorTargetPrototypeSubnetIdentity', 'FlowLogCollectorTargetPrototypeVPCIdentity'])) raise Exception(msg) +class GenericResourceReferenceDeleted(): + """ + If present, this property indicates the referenced resource has been deleted and + provides some supplementary information. + + :attr str more_info: Link to documentation about deleted resources. + """ + + def __init__(self, + more_info: str) -> None: + """ + Initialize a GenericResourceReferenceDeleted object. + + :param str more_info: Link to documentation about deleted resources. + """ + self.more_info = more_info + + @classmethod + def from_dict(cls, _dict: Dict) -> 'GenericResourceReferenceDeleted': + """Initialize a GenericResourceReferenceDeleted object from a json dictionary.""" + args = {} + if 'more_info' in _dict: + args['more_info'] = _dict.get('more_info') + else: + raise ValueError('Required property \'more_info\' not present in GenericResourceReferenceDeleted JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a GenericResourceReferenceDeleted object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + 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 GenericResourceReferenceDeleted object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'GenericResourceReferenceDeleted') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'GenericResourceReferenceDeleted') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + class IKEPolicy(): """ IKEPolicy. @@ -28216,7 +28277,7 @@ class ImageFilePrototype(): """ ImageFilePrototype. - :attr str href: The Cloud Object Store (COS) location of the image file. + :attr str href: The Cloud Object Storage location of the image file. """ def __init__(self, @@ -28224,7 +28285,7 @@ def __init__(self, """ Initialize a ImageFilePrototype object. - :param str href: The Cloud Object Store (COS) location of the image file. + :param str href: The Cloud Object Storage location of the image file. """ self.href = href @@ -28618,6 +28679,8 @@ class Instance(): """ Instance. + :attr InstanceAvailabilityPolicy availability_policy: The availability policy + for this virtual server instance. :attr int bandwidth: The total bandwidth (in megabits per second) shared across the virtual server instance's network interfaces and storage volumes. :attr VolumeAttachmentReferenceInstanceContext boot_volume_attachment: Boot @@ -28635,6 +28698,8 @@ class Instance(): :attr ImageReference image: (optional) The image the virtual server instance was provisioned from. :attr int memory: The amount of memory, truncated to whole gibibytes. + :attr InstanceMetadataService metadata_service: The metadata service + configuration. :attr str name: The user-defined name for this virtual server instance (and default system hostname). :attr List[NetworkInterfaceInstanceContextReference] network_interfaces: The @@ -28672,6 +28737,7 @@ class Instance(): """ def __init__(self, + availability_policy: 'InstanceAvailabilityPolicy', bandwidth: int, boot_volume_attachment: 'VolumeAttachmentReferenceInstanceContext', created_at: datetime, @@ -28680,6 +28746,7 @@ def __init__(self, href: str, id: str, memory: int, + metadata_service: 'InstanceMetadataService', name: str, network_interfaces: List['NetworkInterfaceInstanceContextReference'], primary_network_interface: 'NetworkInterfaceInstanceContextReference', @@ -28702,6 +28769,8 @@ def __init__(self, """ Initialize a Instance object. + :param InstanceAvailabilityPolicy availability_policy: The availability + policy for this virtual server instance. :param int bandwidth: The total bandwidth (in megabits per second) shared across the virtual server instance's network interfaces and storage volumes. @@ -28715,6 +28784,8 @@ def __init__(self, :param str href: The URL for this virtual server instance. :param str id: The unique identifier for this virtual server instance. :param int memory: The amount of memory, truncated to whole gibibytes. + :param InstanceMetadataService metadata_service: The metadata service + configuration. :param str name: The user-defined name for this virtual server instance (and default system hostname). :param List[NetworkInterfaceInstanceContextReference] network_interfaces: @@ -28757,6 +28828,7 @@ def __init__(self, :param InstancePlacementTarget placement_target: (optional) The placement restrictions for the virtual server instance. """ + self.availability_policy = availability_policy self.bandwidth = bandwidth self.boot_volume_attachment = boot_volume_attachment self.created_at = created_at @@ -28768,6 +28840,7 @@ def __init__(self, self.id = id self.image = image self.memory = memory + self.metadata_service = metadata_service self.name = name self.network_interfaces = network_interfaces self.placement_target = placement_target @@ -28788,6 +28861,10 @@ def __init__(self, def from_dict(cls, _dict: Dict) -> 'Instance': """Initialize a Instance object from a json dictionary.""" args = {} + if 'availability_policy' in _dict: + args['availability_policy'] = InstanceAvailabilityPolicy.from_dict(_dict.get('availability_policy')) + else: + raise ValueError('Required property \'availability_policy\' not present in Instance JSON') if 'bandwidth' in _dict: args['bandwidth'] = _dict.get('bandwidth') else: @@ -28826,6 +28903,10 @@ def from_dict(cls, _dict: Dict) -> 'Instance': args['memory'] = _dict.get('memory') else: raise ValueError('Required property \'memory\' not present in Instance JSON') + if 'metadata_service' in _dict: + args['metadata_service'] = InstanceMetadataService.from_dict(_dict.get('metadata_service')) + else: + raise ValueError('Required property \'metadata_service\' not present in Instance JSON') if 'name' in _dict: args['name'] = _dict.get('name') else: @@ -28894,6 +28975,8 @@ def _from_dict(cls, _dict): def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'availability_policy') and self.availability_policy is not None: + _dict['availability_policy'] = self.availability_policy.to_dict() if hasattr(self, 'bandwidth') and self.bandwidth is not None: _dict['bandwidth'] = self.bandwidth if hasattr(self, 'boot_volume_attachment') and self.boot_volume_attachment is not None: @@ -28916,6 +28999,8 @@ def to_dict(self) -> Dict: _dict['image'] = self.image.to_dict() if hasattr(self, 'memory') and self.memory is not None: _dict['memory'] = self.memory + if hasattr(self, 'metadata_service') and self.metadata_service is not None: + _dict['metadata_service'] = self.metadata_service.to_dict() if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'network_interfaces') and self.network_interfaces is not None: @@ -29132,6 +29217,262 @@ class TypeEnum(str, Enum): STOP = 'stop' +class InstanceAvailabilityPolicy(): + """ + InstanceAvailabilityPolicy. + + :attr str host_failure: The action to perform if the compute host experiences a + failure. + - `restart`: Automatically restart the virtual server instance after host + failure + - `stop`: Leave the virtual server instance stopped after host failure + The enumerated values for this property are expected to expand in the future. + When processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the instance on which the unexpected + property value was encountered. + """ + + def __init__(self, + host_failure: str) -> None: + """ + Initialize a InstanceAvailabilityPolicy object. + + :param str host_failure: The action to perform if the compute host + experiences a failure. + - `restart`: Automatically restart the virtual server instance after host + failure + - `stop`: Leave the virtual server instance stopped after host failure + The enumerated values for this property are expected to expand in the + future. When processing this property, check for and log unknown values. + Optionally halt processing and surface the error, or bypass the instance on + which the unexpected property value was encountered. + """ + self.host_failure = host_failure + + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstanceAvailabilityPolicy': + """Initialize a InstanceAvailabilityPolicy object from a json dictionary.""" + args = {} + if 'host_failure' in _dict: + args['host_failure'] = _dict.get('host_failure') + else: + raise ValueError('Required property \'host_failure\' not present in InstanceAvailabilityPolicy JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceAvailabilityPolicy object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'host_failure') and self.host_failure is not None: + _dict['host_failure'] = self.host_failure + 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 InstanceAvailabilityPolicy object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstanceAvailabilityPolicy') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'InstanceAvailabilityPolicy') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class HostFailureEnum(str, Enum): + """ + The action to perform if the compute host experiences a failure. + - `restart`: Automatically restart the virtual server instance after host failure + - `stop`: Leave the virtual server instance stopped after host failure + The enumerated values for this property are expected to expand in the future. When + processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the instance on which the unexpected + property value was encountered. + """ + RESTART = 'restart' + STOP = 'stop' + + +class InstanceAvailabilityPolicyPatch(): + """ + InstanceAvailabilityPolicyPatch. + + :attr str host_failure: (optional) The action to perform if the compute host + experiences a failure. + - `restart`: Automatically restart the virtual server instance after host + failure + - `stop`: Leave the virtual server instance stopped after host failure + The enumerated values for this property are expected to expand in the future. + When processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the instance on which the unexpected + property value was encountered. + """ + + def __init__(self, + *, + host_failure: str = None) -> None: + """ + Initialize a InstanceAvailabilityPolicyPatch object. + + :param str host_failure: (optional) The action to perform if the compute + host experiences a failure. + - `restart`: Automatically restart the virtual server instance after host + failure + - `stop`: Leave the virtual server instance stopped after host failure + The enumerated values for this property are expected to expand in the + future. When processing this property, check for and log unknown values. + Optionally halt processing and surface the error, or bypass the instance on + which the unexpected property value was encountered. + """ + self.host_failure = host_failure + + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstanceAvailabilityPolicyPatch': + """Initialize a InstanceAvailabilityPolicyPatch object from a json dictionary.""" + args = {} + if 'host_failure' in _dict: + args['host_failure'] = _dict.get('host_failure') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceAvailabilityPolicyPatch object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'host_failure') and self.host_failure is not None: + _dict['host_failure'] = self.host_failure + 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 InstanceAvailabilityPolicyPatch object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstanceAvailabilityPolicyPatch') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'InstanceAvailabilityPolicyPatch') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class HostFailureEnum(str, Enum): + """ + The action to perform if the compute host experiences a failure. + - `restart`: Automatically restart the virtual server instance after host failure + - `stop`: Leave the virtual server instance stopped after host failure + The enumerated values for this property are expected to expand in the future. When + processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the instance on which the unexpected + property value was encountered. + """ + RESTART = 'restart' + STOP = 'stop' + + +class InstanceAvailabilityPrototype(): + """ + InstanceAvailabilityPrototype. + + :attr str host_failure: (optional) The action to perform if the compute host + experiences a failure. + - `restart`: Automatically restart the virtual server instance after host + failure + - `stop`: Leave the virtual server instance stopped after host failure + The enumerated values for this property are expected to expand in the future. + When processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the instance on which the unexpected + property value was encountered. + """ + + def __init__(self, + *, + host_failure: str = None) -> None: + """ + Initialize a InstanceAvailabilityPrototype object. + + :param str host_failure: (optional) The action to perform if the compute + host experiences a failure. + - `restart`: Automatically restart the virtual server instance after host + failure + - `stop`: Leave the virtual server instance stopped after host failure + The enumerated values for this property are expected to expand in the + future. When processing this property, check for and log unknown values. + Optionally halt processing and surface the error, or bypass the instance on + which the unexpected property value was encountered. + """ + self.host_failure = host_failure + + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstanceAvailabilityPrototype': + """Initialize a InstanceAvailabilityPrototype object from a json dictionary.""" + args = {} + if 'host_failure' in _dict: + args['host_failure'] = _dict.get('host_failure') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceAvailabilityPrototype object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'host_failure') and self.host_failure is not None: + _dict['host_failure'] = self.host_failure + 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 InstanceAvailabilityPrototype object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstanceAvailabilityPrototype') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'InstanceAvailabilityPrototype') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class HostFailureEnum(str, Enum): + """ + The action to perform if the compute host experiences a failure. + - `restart`: Automatically restart the virtual server instance after host failure + - `stop`: Leave the virtual server instance stopped after host failure + The enumerated values for this property are expected to expand in the future. When + processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the instance on which the unexpected + property value was encountered. + """ + RESTART = 'restart' + STOP = 'stop' + + class InstanceCollection(): """ InstanceCollection. @@ -29471,6 +29812,83 @@ class ConsoleTypeEnum(str, Enum): VNC = 'vnc' +class InstanceDefaultTrustedProfilePrototype(): + """ + InstanceDefaultTrustedProfilePrototype. + + :attr bool auto_link: (optional) If set to `true`, the system will create a link + to the specified `target` trusted profile during instance creation. Regardless + of whether a link is created by the system or manually using the IAM Identity + service, it will be automatically deleted when the instance is deleted. + :attr TrustedProfileIdentity target: The default IAM trusted profile to use for + this virtual server instance. + """ + + def __init__(self, + target: 'TrustedProfileIdentity', + *, + auto_link: bool = None) -> None: + """ + Initialize a InstanceDefaultTrustedProfilePrototype object. + + :param TrustedProfileIdentity target: The default IAM trusted profile to + use for this virtual server instance. + :param bool auto_link: (optional) If set to `true`, the system will create + a link to the specified `target` trusted profile during instance creation. + Regardless of whether a link is created by the system or manually using the + IAM Identity service, it will be automatically deleted when the instance is + deleted. + """ + self.auto_link = auto_link + self.target = target + + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstanceDefaultTrustedProfilePrototype': + """Initialize a InstanceDefaultTrustedProfilePrototype object from a json dictionary.""" + args = {} + if 'auto_link' in _dict: + args['auto_link'] = _dict.get('auto_link') + if 'target' in _dict: + args['target'] = _dict.get('target') + else: + raise ValueError('Required property \'target\' not present in InstanceDefaultTrustedProfilePrototype JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceDefaultTrustedProfilePrototype object from 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_link') and self.auto_link is not None: + _dict['auto_link'] = self.auto_link + 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): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this InstanceDefaultTrustedProfilePrototype object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstanceDefaultTrustedProfilePrototype') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'InstanceDefaultTrustedProfilePrototype') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + class InstanceDisk(): """ InstanceDisk. @@ -30565,8 +30983,8 @@ class InstanceGroupManagerActionGroupPatch(): """ InstanceGroupManagerActionGroupPatch. - :attr int membership_count: (optional) The number of members the instance group - should have at the scheduled time. + :attr int membership_count: (optional) The desired number of instance group + members at the scheduled time. """ def __init__(self, @@ -30575,8 +30993,8 @@ def __init__(self, """ Initialize a InstanceGroupManagerActionGroupPatch object. - :param int membership_count: (optional) The number of members the instance - group should have at the scheduled time. + :param int membership_count: (optional) The desired number of instance + group members at the scheduled time. """ self.membership_count = membership_count @@ -30622,10 +31040,10 @@ class InstanceGroupManagerActionManagerPatch(): """ InstanceGroupManagerActionManagerPatch. - :attr int max_membership_count: (optional) The maximum number of members the - instance group should have at the scheduled time. - :attr int min_membership_count: (optional) The minimum number of members the - instance group should have at the scheduled time. + :attr int max_membership_count: (optional) The desired maximum number of + instance group members at the scheduled time. + :attr int min_membership_count: (optional) The desired minimum number of + instance group members at the scheduled time. """ def __init__(self, @@ -30635,10 +31053,10 @@ def __init__(self, """ Initialize a InstanceGroupManagerActionManagerPatch object. - :param int max_membership_count: (optional) The maximum number of members - the instance group should have at the scheduled time. - :param int min_membership_count: (optional) The minimum number of members - the instance group should have at the scheduled time. + :param int max_membership_count: (optional) The desired maximum number of + instance group members at the scheduled time. + :param int min_membership_count: (optional) The desired minimum number of + instance group members at the scheduled time. """ self.max_membership_count = max_membership_count self.min_membership_count = min_membership_count @@ -32217,8 +32635,8 @@ class InstanceGroupManagerScheduledActionGroup(): """ InstanceGroupManagerScheduledActionGroup. - :attr int membership_count: The number of members the instance group should have - at the scheduled time. + :attr int membership_count: The desired number of instance group members at the + scheduled time. """ def __init__(self, @@ -32226,8 +32644,8 @@ def __init__(self, """ Initialize a InstanceGroupManagerScheduledActionGroup object. - :param int membership_count: The number of members the instance group - should have at the scheduled time. + :param int membership_count: The desired number of instance group members + at the scheduled time. """ self.membership_count = membership_count @@ -32275,8 +32693,8 @@ class InstanceGroupManagerScheduledActionGroupPrototype(): """ InstanceGroupManagerScheduledActionGroupPrototype. - :attr int membership_count: The number of members the instance group should have - at the scheduled time. + :attr int membership_count: The desired number of instance group members at the + scheduled time. """ def __init__(self, @@ -32284,8 +32702,8 @@ def __init__(self, """ Initialize a InstanceGroupManagerScheduledActionGroupPrototype object. - :param int membership_count: The number of members the instance group - should have at the scheduled time. + :param int membership_count: The desired number of instance group members + at the scheduled time. """ self.membership_count = membership_count @@ -32821,8 +33239,11 @@ class InstanceGroupPatch(): :attr int application_port: (optional) Required if specifying a load balancer pool only. Used by the instance group when scaling up instances to supply the port for the load balancer pool member. - :attr InstanceTemplateIdentity instance_template: (optional) Identifies an - instance template by a unique property. + :attr InstanceTemplateIdentity instance_template: (optional) Instance template + to use when creating new instances. + Instance groups are not compatible with instance templates that specify `true` + for + `default_trusted_profile.auto_link`. :attr LoadBalancerIdentity load_balancer: (optional) The load balancer that the load balancer pool used by this group is in. Required when using a load balancer pool. @@ -32853,8 +33274,11 @@ def __init__(self, :param int application_port: (optional) Required if specifying a load balancer pool only. Used by the instance group when scaling up instances to supply the port for the load balancer pool member. - :param InstanceTemplateIdentity instance_template: (optional) Identifies an - instance template by a unique property. + :param InstanceTemplateIdentity instance_template: (optional) Instance + template to use when creating new instances. + Instance groups are not compatible with instance templates that specify + `true` for + `default_trusted_profile.auto_link`. :param LoadBalancerIdentity load_balancer: (optional) The load balancer that the load balancer pool used by this group is in. Required when using a load balancer pool. @@ -33114,6 +33538,10 @@ class InstanceInitialization(): """ InstanceInitialization. + :attr InstanceInitializationDefaultTrustedProfile default_trusted_profile: + (optional) The default trusted profile configuration specified at virtual server + instance + creation. If absent, no default trusted profile was specified. :attr List[KeyReference] keys: The public SSH keys used at instance initialization. :attr InstanceInitializationPassword password: (optional) @@ -33122,14 +33550,20 @@ class InstanceInitialization(): def __init__(self, keys: List['KeyReference'], *, + default_trusted_profile: 'InstanceInitializationDefaultTrustedProfile' = None, password: 'InstanceInitializationPassword' = None) -> None: """ Initialize a InstanceInitialization object. :param List[KeyReference] keys: The public SSH keys used at instance initialization. + :param InstanceInitializationDefaultTrustedProfile default_trusted_profile: + (optional) The default trusted profile configuration specified at virtual + server instance + creation. If absent, no default trusted profile was specified. :param InstanceInitializationPassword password: (optional) """ + self.default_trusted_profile = default_trusted_profile self.keys = keys self.password = password @@ -33137,6 +33571,8 @@ def __init__(self, def from_dict(cls, _dict: Dict) -> 'InstanceInitialization': """Initialize a InstanceInitialization object from a json dictionary.""" args = {} + if 'default_trusted_profile' in _dict: + args['default_trusted_profile'] = InstanceInitializationDefaultTrustedProfile.from_dict(_dict.get('default_trusted_profile')) if 'keys' in _dict: args['keys'] = [KeyReference.from_dict(x) for x in _dict.get('keys')] else: @@ -33153,6 +33589,8 @@ def _from_dict(cls, _dict): def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'default_trusted_profile') and self.default_trusted_profile is not None: + _dict['default_trusted_profile'] = self.default_trusted_profile.to_dict() if hasattr(self, 'keys') and self.keys is not None: _dict['keys'] = [x.to_dict() for x in self.keys] if hasattr(self, 'password') and self.password is not None: @@ -33177,6 +33615,80 @@ def __ne__(self, other: 'InstanceInitialization') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other +class InstanceInitializationDefaultTrustedProfile(): + """ + InstanceInitializationDefaultTrustedProfile. + + :attr bool auto_link: If set to `true`, the system created a link to the + specified `target` trusted profile during instance creation. Regardless of + whether a link was created by the system or manually using the IAM Identity + service, it will be automatically deleted when the instance is deleted. + :attr TrustedProfileReference target: The default IAM trusted profile to use for + this virtual server instance. + """ + + def __init__(self, + auto_link: bool, + target: 'TrustedProfileReference') -> None: + """ + Initialize a InstanceInitializationDefaultTrustedProfile object. + + :param bool auto_link: If set to `true`, the system created a link to the + specified `target` trusted profile during instance creation. Regardless of + whether a link was created by the system or manually using the IAM Identity + service, it will be automatically deleted when the instance is deleted. + :param TrustedProfileReference target: The default IAM trusted profile to + use for this virtual server instance. + """ + self.auto_link = auto_link + self.target = target + + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstanceInitializationDefaultTrustedProfile': + """Initialize a InstanceInitializationDefaultTrustedProfile object from a json dictionary.""" + args = {} + if 'auto_link' in _dict: + args['auto_link'] = _dict.get('auto_link') + else: + raise ValueError('Required property \'auto_link\' not present in InstanceInitializationDefaultTrustedProfile JSON') + if 'target' in _dict: + args['target'] = TrustedProfileReference.from_dict(_dict.get('target')) + else: + raise ValueError('Required property \'target\' not present in InstanceInitializationDefaultTrustedProfile JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceInitializationDefaultTrustedProfile object from 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_link') and self.auto_link is not None: + _dict['auto_link'] = self.auto_link + if hasattr(self, 'target') and self.target is not None: + _dict['target'] = self.target.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 InstanceInitializationDefaultTrustedProfile object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstanceInitializationDefaultTrustedProfile') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'InstanceInitializationDefaultTrustedProfile') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + class InstanceInitializationPassword(): """ InstanceInitializationPassword. @@ -33248,10 +33760,186 @@ def __ne__(self, other: 'InstanceInitializationPassword') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other +class InstanceMetadataService(): + """ + InstanceMetadataService. + + :attr bool enabled: Indicates whether the metadata service endpoint is available + to the virtual server instance. + """ + + def __init__(self, + enabled: bool) -> None: + """ + Initialize a InstanceMetadataService object. + + :param bool enabled: Indicates whether the metadata service endpoint is + available to the virtual server instance. + """ + self.enabled = enabled + + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstanceMetadataService': + """Initialize a InstanceMetadataService object from a json dictionary.""" + args = {} + if 'enabled' in _dict: + args['enabled'] = _dict.get('enabled') + else: + raise ValueError('Required property \'enabled\' not present in InstanceMetadataService JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceMetadataService object from 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 + 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 InstanceMetadataService object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstanceMetadataService') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'InstanceMetadataService') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + +class InstanceMetadataServicePatch(): + """ + InstanceMetadataServicePatch. + + :attr bool enabled: (optional) Indicates whether the metadata service endpoint + is available to the virtual server instance. + """ + + def __init__(self, + *, + enabled: bool = None) -> None: + """ + Initialize a InstanceMetadataServicePatch object. + + :param bool enabled: (optional) Indicates whether the metadata service + endpoint is available to the virtual server instance. + """ + self.enabled = enabled + + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstanceMetadataServicePatch': + """Initialize a InstanceMetadataServicePatch object from a json dictionary.""" + args = {} + if 'enabled' in _dict: + args['enabled'] = _dict.get('enabled') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceMetadataServicePatch object from 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 + 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 InstanceMetadataServicePatch object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstanceMetadataServicePatch') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'InstanceMetadataServicePatch') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + +class InstanceMetadataServicePrototype(): + """ + InstanceMetadataServicePrototype. + + :attr bool enabled: (optional) Indicates whether the metadata service endpoint + is available to the virtual server instance. + """ + + def __init__(self, + *, + enabled: bool = None) -> None: + """ + Initialize a InstanceMetadataServicePrototype object. + + :param bool enabled: (optional) Indicates whether the metadata service + endpoint is available to the virtual server instance. + """ + self.enabled = enabled + + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstanceMetadataServicePrototype': + """Initialize a InstanceMetadataServicePrototype object from a json dictionary.""" + args = {} + if 'enabled' in _dict: + args['enabled'] = _dict.get('enabled') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceMetadataServicePrototype object from 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 + 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 InstanceMetadataServicePrototype object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstanceMetadataServicePrototype') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'InstanceMetadataServicePrototype') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + class InstancePatch(): """ InstancePatch. + :attr InstanceAvailabilityPolicyPatch availability_policy: (optional) The + availability policy for this virtual server instance. + :attr InstanceMetadataServicePatch metadata_service: (optional) The metadata + service configuration. :attr str name: (optional) The user-defined name for this virtual server instance (and default system hostname). :attr InstancePlacementTargetPatch placement_target: (optional) The placement @@ -33278,6 +33966,8 @@ class InstancePatch(): def __init__(self, *, + availability_policy: 'InstanceAvailabilityPolicyPatch' = None, + metadata_service: 'InstanceMetadataServicePatch' = None, name: str = None, placement_target: 'InstancePlacementTargetPatch' = None, profile: 'InstancePatchProfile' = None, @@ -33285,6 +33975,10 @@ def __init__(self, """ Initialize a InstancePatch object. + :param InstanceAvailabilityPolicyPatch availability_policy: (optional) The + availability policy for this virtual server instance. + :param InstanceMetadataServicePatch metadata_service: (optional) The + metadata service configuration. :param str name: (optional) The user-defined name for this virtual server instance (and default system hostname). :param InstancePlacementTargetPatch placement_target: (optional) The @@ -33312,6 +34006,8 @@ def __init__(self, increase in this value will result in a corresponding decrease to `total_network_bandwidth`. """ + self.availability_policy = availability_policy + self.metadata_service = metadata_service self.name = name self.placement_target = placement_target self.profile = profile @@ -33321,6 +34017,10 @@ def __init__(self, def from_dict(cls, _dict: Dict) -> 'InstancePatch': """Initialize a InstancePatch object from a json dictionary.""" args = {} + if 'availability_policy' in _dict: + args['availability_policy'] = InstanceAvailabilityPolicyPatch.from_dict(_dict.get('availability_policy')) + if 'metadata_service' in _dict: + args['metadata_service'] = InstanceMetadataServicePatch.from_dict(_dict.get('metadata_service')) if 'name' in _dict: args['name'] = _dict.get('name') if 'placement_target' in _dict: @@ -33339,6 +34039,10 @@ def _from_dict(cls, _dict): def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'availability_policy') and self.availability_policy is not None: + _dict['availability_policy'] = self.availability_policy.to_dict() + if hasattr(self, 'metadata_service') and self.metadata_service is not None: + _dict['metadata_service'] = self.metadata_service.to_dict() if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'placement_target') and self.placement_target is not None: @@ -34455,6 +35159,16 @@ class InstancePrototype(): """ InstancePrototype. + :attr InstanceAvailabilityPrototype availability_policy: (optional) The + availability policy to use for this virtual server instance. + :attr InstanceDefaultTrustedProfilePrototype default_trusted_profile: (optional) + The default trusted profile configuration to use for this virtual server + instance + This property's value is used when provisioning the virtual server instance, but + not + subsequently managed. Accordingly, it is reflected as an [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. :attr List[KeyIdentity] keys: (optional) The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the virtual server instance as cloud-init vendor data. For cloud-init enabled @@ -34469,6 +35183,8 @@ class InstancePrototype(): not subsequently managed. Accordingly, it is reflected as an [instance initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + :attr InstanceMetadataServicePrototype metadata_service: (optional) + Configuration options for the instance metadata service. :attr str name: (optional) The unique user-defined name for this virtual server instance (and default system hostname). If unspecified, the name will be a hyphenated list of randomly-selected words. @@ -34477,7 +35193,8 @@ class InstancePrototype(): :attr InstancePlacementTargetPrototype placement_target: (optional) The placement restrictions to use for the virtual server instance. :attr InstanceProfileIdentity profile: (optional) The profile to use for this - virtual server instance. + virtual server instance. If unspecified, `bx2-2x8` will + be used, but this default value is expected to change in the future. :attr 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) is used. @@ -34496,7 +35213,10 @@ class InstancePrototype(): def __init__(self, *, + availability_policy: 'InstanceAvailabilityPrototype' = None, + default_trusted_profile: 'InstanceDefaultTrustedProfilePrototype' = None, keys: List['KeyIdentity'] = None, + metadata_service: 'InstanceMetadataServicePrototype' = None, name: str = None, network_interfaces: List['NetworkInterfacePrototype'] = None, placement_target: 'InstancePlacementTargetPrototype' = None, @@ -34509,6 +35229,16 @@ def __init__(self, """ Initialize a InstancePrototype object. + :param InstanceAvailabilityPrototype availability_policy: (optional) The + availability policy to use for this virtual server instance. + :param InstanceDefaultTrustedProfilePrototype default_trusted_profile: + (optional) The default trusted profile configuration to use for this + virtual server instance + This property's value is used when provisioning the virtual server + instance, but not + subsequently managed. Accordingly, it is reflected as an [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. :param List[KeyIdentity] keys: (optional) The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the virtual server instance as cloud-init vendor data. For @@ -34525,6 +35255,8 @@ def __init__(self, [instance initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + :param InstanceMetadataServicePrototype metadata_service: (optional) + Configuration options for the instance metadata service. :param str name: (optional) The unique user-defined name for this virtual server instance (and default system hostname). If unspecified, the name will be a hyphenated list of randomly-selected words. @@ -34533,7 +35265,8 @@ def __init__(self, :param InstancePlacementTargetPrototype placement_target: (optional) The placement restrictions to use for the virtual server instance. :param InstanceProfileIdentity profile: (optional) The profile to use for - this virtual server instance. + this virtual server instance. If unspecified, `bx2-2x8` will + be used, but this default value is expected to change in the future. :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) is @@ -34551,7 +35284,7 @@ def __init__(self, the VPC referenced by the subnets of the instance's network interfaces. """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['InstancePrototypeInstanceByImage', 'InstancePrototypeInstanceByVolume', 'InstancePrototypeInstanceBySourceTemplate'])) + ", ".join(['InstancePrototypeInstanceByImage', 'InstancePrototypeInstanceBySourceSnapshot', 'InstancePrototypeInstanceBySourceTemplate'])) raise Exception(msg) class InstanceReference(): @@ -34801,6 +35534,7 @@ class CodeEnum(str, Enum): CANNOT_START_PLACEMENT_GROUP = 'cannot_start_placement_group' CANNOT_START_STORAGE = 'cannot_start_storage' ENCRYPTION_KEY_DELETED = 'encryption_key_deleted' + STOPPED_BY_HOST_FAILURE = 'stopped_by_host_failure' STOPPED_FOR_IMAGE_CREATION = 'stopped_for_image_creation' @@ -34808,9 +35542,19 @@ class InstanceTemplate(): """ InstanceTemplate. + :attr InstanceAvailabilityPrototype availability_policy: (optional) The + availability policy to use for this virtual server instance. :attr datetime created_at: The date and time that the instance template was created. :attr str crn: The CRN for this instance template. + :attr InstanceDefaultTrustedProfilePrototype default_trusted_profile: (optional) + The default trusted profile configuration to use for this virtual server + instance + This property's value is used when provisioning the virtual server instance, but + not + subsequently managed. Accordingly, it is reflected as an [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. :attr str href: The URL for this instance template. :attr str id: The unique identifier for this instance template. :attr List[KeyIdentity] keys: (optional) The public SSH keys for the @@ -34827,13 +35571,16 @@ class InstanceTemplate(): not subsequently managed. Accordingly, it is reflected as an [instance initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + :attr InstanceMetadataServicePrototype metadata_service: (optional) + Configuration options for the instance metadata service. :attr str name: The unique user-defined name for this instance template. :attr List[NetworkInterfacePrototype] network_interfaces: (optional) The additional network interfaces to create for the virtual server instance. :attr InstancePlacementTargetPrototype placement_target: (optional) The placement restrictions to use for the virtual server instance. :attr InstanceProfileIdentity profile: (optional) The profile to use for this - virtual server instance. + virtual server instance. If unspecified, `bx2-2x8` will + be used, but this default value is expected to change in the future. :attr ResourceGroupReference resource_group: The resource group for this instance template. :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in @@ -34857,7 +35604,10 @@ def __init__(self, name: str, resource_group: 'ResourceGroupReference', *, + availability_policy: 'InstanceAvailabilityPrototype' = None, + default_trusted_profile: 'InstanceDefaultTrustedProfilePrototype' = None, keys: List['KeyIdentity'] = None, + metadata_service: 'InstanceMetadataServicePrototype' = None, network_interfaces: List['NetworkInterfacePrototype'] = None, placement_target: 'InstancePlacementTargetPrototype' = None, profile: 'InstanceProfileIdentity' = None, @@ -34876,6 +35626,16 @@ def __init__(self, :param str name: The unique user-defined name for this instance template. :param ResourceGroupReference resource_group: The resource group for this instance template. + :param InstanceAvailabilityPrototype availability_policy: (optional) The + availability policy to use for this virtual server instance. + :param InstanceDefaultTrustedProfilePrototype default_trusted_profile: + (optional) The default trusted profile configuration to use for this + virtual server instance + This property's value is used when provisioning the virtual server + instance, but not + subsequently managed. Accordingly, it is reflected as an [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. :param List[KeyIdentity] keys: (optional) The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the virtual server instance as cloud-init vendor data. For @@ -34892,12 +35652,15 @@ def __init__(self, [instance initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + :param InstanceMetadataServicePrototype metadata_service: (optional) + Configuration options for the instance metadata service. :param List[NetworkInterfacePrototype] network_interfaces: (optional) The additional network interfaces to create for the virtual server instance. :param InstancePlacementTargetPrototype placement_target: (optional) The placement restrictions to use for the virtual server instance. :param InstanceProfileIdentity profile: (optional) The profile to use for - this virtual server instance. + this virtual server instance. If unspecified, `bx2-2x8` will + be used, but this default value is expected to change in the future. :param int total_volume_bandwidth: (optional) The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in this value will result in a corresponding decrease to @@ -34911,7 +35674,7 @@ def __init__(self, the VPC referenced by the subnets of the instance's network interfaces. """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['InstanceTemplateInstanceByImage', 'InstanceTemplateInstanceByVolume'])) + ", ".join(['InstanceTemplateInstanceByImage'])) raise Exception(msg) class InstanceTemplateCollection(): @@ -35212,6 +35975,16 @@ class InstanceTemplatePrototype(): """ InstanceTemplatePrototype. + :attr InstanceAvailabilityPrototype availability_policy: (optional) The + availability policy to use for this virtual server instance. + :attr InstanceDefaultTrustedProfilePrototype default_trusted_profile: (optional) + The default trusted profile configuration to use for this virtual server + instance + This property's value is used when provisioning the virtual server instance, but + not + subsequently managed. Accordingly, it is reflected as an [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. :attr List[KeyIdentity] keys: (optional) The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the virtual server instance as cloud-init vendor data. For cloud-init enabled @@ -35226,6 +35999,8 @@ class InstanceTemplatePrototype(): not subsequently managed. Accordingly, it is reflected as an [instance initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + :attr InstanceMetadataServicePrototype metadata_service: (optional) + Configuration options for the instance metadata service. :attr str name: (optional) The unique user-defined name for this virtual server instance (and default system hostname). If unspecified, the name will be a hyphenated list of randomly-selected words. @@ -35234,7 +36009,8 @@ class InstanceTemplatePrototype(): :attr InstancePlacementTargetPrototype placement_target: (optional) The placement restrictions to use for the virtual server instance. :attr InstanceProfileIdentity profile: (optional) The profile to use for this - virtual server instance. + virtual server instance. If unspecified, `bx2-2x8` will + be used, but this default value is expected to change in the future. :attr 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) is used. @@ -35253,7 +36029,10 @@ class InstanceTemplatePrototype(): def __init__(self, *, + availability_policy: 'InstanceAvailabilityPrototype' = None, + default_trusted_profile: 'InstanceDefaultTrustedProfilePrototype' = None, keys: List['KeyIdentity'] = None, + metadata_service: 'InstanceMetadataServicePrototype' = None, name: str = None, network_interfaces: List['NetworkInterfacePrototype'] = None, placement_target: 'InstancePlacementTargetPrototype' = None, @@ -35266,6 +36045,16 @@ def __init__(self, """ Initialize a InstanceTemplatePrototype object. + :param InstanceAvailabilityPrototype availability_policy: (optional) The + availability policy to use for this virtual server instance. + :param InstanceDefaultTrustedProfilePrototype default_trusted_profile: + (optional) The default trusted profile configuration to use for this + virtual server instance + This property's value is used when provisioning the virtual server + instance, but not + subsequently managed. Accordingly, it is reflected as an [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. :param List[KeyIdentity] keys: (optional) The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the virtual server instance as cloud-init vendor data. For @@ -35282,6 +36071,8 @@ def __init__(self, [instance initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + :param InstanceMetadataServicePrototype metadata_service: (optional) + Configuration options for the instance metadata service. :param str name: (optional) The unique user-defined name for this virtual server instance (and default system hostname). If unspecified, the name will be a hyphenated list of randomly-selected words. @@ -35290,7 +36081,8 @@ def __init__(self, :param InstancePlacementTargetPrototype placement_target: (optional) The placement restrictions to use for the virtual server instance. :param InstanceProfileIdentity profile: (optional) The profile to use for - this virtual server instance. + this virtual server instance. If unspecified, `bx2-2x8` will + be used, but this default value is expected to change in the future. :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) is @@ -35308,7 +36100,7 @@ def __init__(self, the VPC referenced by the subnets of the instance's network interfaces. """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['InstanceTemplatePrototypeInstanceByImage', 'InstanceTemplatePrototypeInstanceByVolume', 'InstanceTemplatePrototypeInstanceBySourceTemplate'])) + ", ".join(['InstanceTemplatePrototypeInstanceByImage', 'InstanceTemplatePrototypeInstanceBySourceTemplate'])) raise Exception(msg) class InstanceTemplateReference(): @@ -36148,6 +36940,78 @@ def __ne__(self, other: 'KeyReferenceDeleted') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other +class LegacyCloudObjectStorageBucketIdentity(): + """ + Identifies a Cloud Object Storage bucket by a unique property. + + """ + + def __init__(self) -> None: + """ + Initialize a LegacyCloudObjectStorageBucketIdentity object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName'])) + raise Exception(msg) + +class LegacyCloudObjectStorageBucketReference(): + """ + LegacyCloudObjectStorageBucketReference. + + :attr str name: The globally unique name of this Cloud Object Storage bucket. + """ + + def __init__(self, + name: str) -> None: + """ + Initialize a LegacyCloudObjectStorageBucketReference object. + + :param str name: The globally unique name of this Cloud Object Storage + bucket. + """ + self.name = name + + @classmethod + def from_dict(cls, _dict: Dict) -> 'LegacyCloudObjectStorageBucketReference': + """Initialize a LegacyCloudObjectStorageBucketReference object from a json dictionary.""" + args = {} + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in LegacyCloudObjectStorageBucketReference JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a LegacyCloudObjectStorageBucketReference object from 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 LegacyCloudObjectStorageBucketReference object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'LegacyCloudObjectStorageBucketReference') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'LegacyCloudObjectStorageBucketReference') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + class LoadBalancer(): """ LoadBalancer. @@ -36166,8 +37030,8 @@ class LoadBalancer(): :attr str name: The unique user-defined name for this load balancer. :attr str operating_status: The operating status of this load balancer. :attr List[LoadBalancerPoolReference] pools: The pools of this load balancer. - :attr List[IP] private_ips: The private IP addresses assigned to this load - balancer. + :attr List[LoadBalancerPrivateIpsItem] private_ips: The private IP addresses + assigned to this load balancer. :attr LoadBalancerProfileReference profile: The profile to use for this load balancer. :attr str provisioning_status: The provisioning status of this load balancer. @@ -36176,6 +37040,7 @@ class LoadBalancer(): Applicable only for public load balancers. :attr ResourceGroupReference resource_group: The resource group for this load balancer. + :attr str resource_type: The resource type. :attr bool route_mode: Indicates whether route mode is enabled for this load balancer. At present, public load balancers are not supported with route mode enabled. @@ -36185,6 +37050,7 @@ class LoadBalancer(): :attr bool security_groups_supported: Indicates whether this load balancer supports security groups. :attr List[SubnetReference] subnets: The subnets this load balancer is part of. + :attr bool udp_supported: Indicates whether this load balancer supports UDP. """ def __init__(self, @@ -36199,15 +37065,17 @@ def __init__(self, name: str, operating_status: str, pools: List['LoadBalancerPoolReference'], - private_ips: List['IP'], + private_ips: List['LoadBalancerPrivateIpsItem'], profile: 'LoadBalancerProfileReference', provisioning_status: str, public_ips: List['IP'], resource_group: 'ResourceGroupReference', + resource_type: str, route_mode: bool, security_groups: List['SecurityGroupReference'], security_groups_supported: bool, - subnets: List['SubnetReference']) -> None: + subnets: List['SubnetReference'], + udp_supported: bool) -> None: """ Initialize a LoadBalancer object. @@ -36227,8 +37095,8 @@ def __init__(self, :param str operating_status: The operating status of this load balancer. :param List[LoadBalancerPoolReference] pools: The pools of this load balancer. - :param List[IP] private_ips: The private IP addresses assigned to this load - balancer. + :param List[LoadBalancerPrivateIpsItem] private_ips: The private IP + addresses assigned to this load balancer. :param LoadBalancerProfileReference profile: The profile to use for this load balancer. :param str provisioning_status: The provisioning status of this load @@ -36238,6 +37106,7 @@ def __init__(self, Applicable only for public load balancers. :param ResourceGroupReference resource_group: The resource group for this load balancer. + :param str resource_type: The resource type. :param bool route_mode: Indicates whether route mode is enabled for this load balancer. At present, public load balancers are not supported with route mode @@ -36249,6 +37118,8 @@ def __init__(self, supports security groups. :param List[SubnetReference] subnets: The subnets this load balancer is part of. + :param bool udp_supported: Indicates whether this load balancer supports + UDP. """ self.created_at = created_at self.crn = crn @@ -36266,10 +37137,12 @@ def __init__(self, self.provisioning_status = provisioning_status self.public_ips = public_ips self.resource_group = resource_group + self.resource_type = resource_type self.route_mode = route_mode self.security_groups = security_groups self.security_groups_supported = security_groups_supported self.subnets = subnets + self.udp_supported = udp_supported @classmethod def from_dict(cls, _dict: Dict) -> 'LoadBalancer': @@ -36320,7 +37193,7 @@ def from_dict(cls, _dict: Dict) -> 'LoadBalancer': else: raise ValueError('Required property \'pools\' not present in LoadBalancer JSON') if 'private_ips' in _dict: - args['private_ips'] = [IP.from_dict(x) for x in _dict.get('private_ips')] + args['private_ips'] = [LoadBalancerPrivateIpsItem.from_dict(x) for x in _dict.get('private_ips')] else: raise ValueError('Required property \'private_ips\' not present in LoadBalancer JSON') if 'profile' in _dict: @@ -36339,6 +37212,10 @@ def from_dict(cls, _dict: Dict) -> 'LoadBalancer': args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) else: raise ValueError('Required property \'resource_group\' not present in LoadBalancer JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in LoadBalancer JSON') if 'route_mode' in _dict: args['route_mode'] = _dict.get('route_mode') else: @@ -36355,6 +37232,10 @@ def from_dict(cls, _dict: Dict) -> 'LoadBalancer': args['subnets'] = [SubnetReference.from_dict(x) for x in _dict.get('subnets')] else: raise ValueError('Required property \'subnets\' not present in LoadBalancer JSON') + if 'udp_supported' in _dict: + args['udp_supported'] = _dict.get('udp_supported') + else: + raise ValueError('Required property \'udp_supported\' not present in LoadBalancer JSON') return cls(**args) @classmethod @@ -36397,6 +37278,8 @@ def to_dict(self) -> Dict: _dict['public_ips'] = [x.to_dict() for x in self.public_ips] if hasattr(self, 'resource_group') and self.resource_group is not None: _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, 'route_mode') and self.route_mode is not None: _dict['route_mode'] = self.route_mode if hasattr(self, 'security_groups') and self.security_groups is not None: @@ -36405,6 +37288,8 @@ def to_dict(self) -> Dict: _dict['security_groups_supported'] = self.security_groups_supported if hasattr(self, 'subnets') and self.subnets is not None: _dict['subnets'] = [x.to_dict() for x in self.subnets] + if hasattr(self, 'udp_supported') and self.udp_supported is not None: + _dict['udp_supported'] = self.udp_supported return _dict def _to_dict(self): @@ -36445,6 +37330,13 @@ class ProvisioningStatusEnum(str, Enum): UPDATE_PENDING = 'update_pending' + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + LOAD_BALANCER = 'load_balancer' + + class LoadBalancerCollection(): """ LoadBalancerCollection. @@ -36693,8 +37585,8 @@ class LoadBalancerListener(): protocol. :attr int connection_limit: (optional) The connection limit of the listener. :attr datetime created_at: The date and time that this listener was created. - :attr LoadBalancerPoolReference default_pool: (optional) The default pool - associated with the listener. + :attr LoadBalancerPoolReference default_pool: (optional) The default pool for + this listener. If absent, this listener has no default pool. :attr str href: The listener's canonical URL. :attr LoadBalancerListenerHTTPSRedirect https_redirect: (optional) If specified, the target listener that requests are redirected to. @@ -36712,9 +37604,14 @@ class LoadBalancerListener(): At present, only load balancers in the `network` family support more than one port per listener. :attr str protocol: The listener protocol. Load balancers in the `network` - family support `tcp`. Load balancers in the `application` family support `tcp`, - `http`, and `https`. Each listener in the load balancer must have a unique - `port` and `protocol` combination. + family support `tcp` and + `udp` (if `udp_supported` is `true`). Load balancers in the `application` family + support `tcp`, `http`, and `https`. Each listener in the load balancer must have + a unique `port` and `protocol` combination. + The enumerated values for this property are expected to expand in the future. + When processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the listener on which the unexpected + property value was encountered. :attr str provisioning_status: The provisioning status of this listener. """ @@ -36763,9 +37660,14 @@ def __init__(self, At present, only load balancers in the `network` family support more than one port per listener. :param str protocol: The listener protocol. Load balancers in the `network` - family support `tcp`. Load balancers in the `application` family support - `tcp`, `http`, and `https`. Each listener in the load balancer must have a - unique `port` and `protocol` combination. + family support `tcp` and + `udp` (if `udp_supported` is `true`). Load balancers in the `application` + family support `tcp`, `http`, and `https`. Each listener in the load + balancer must have a unique `port` and `protocol` combination. + The enumerated values for this property are expected to expand in the + future. When processing this property, check for and log unknown values. + Optionally halt processing and surface the error, or bypass the listener on + which the unexpected property value was encountered. :param str provisioning_status: The provisioning status of this listener. :param CertificateInstanceReference certificate_instance: (optional) The certificate instance used for SSL termination. It is applicable only to @@ -36774,7 +37676,7 @@ def __init__(self, :param int connection_limit: (optional) The connection limit of the listener. :param LoadBalancerPoolReference default_pool: (optional) The default pool - associated with the listener. + for this listener. If absent, this listener has no default pool. :param LoadBalancerListenerHTTPSRedirect https_redirect: (optional) If specified, the target listener that requests are redirected to. :param List[LoadBalancerListenerPolicyReference] policies: (optional) The @@ -36905,14 +37807,19 @@ def __ne__(self, other: 'LoadBalancerListener') -> bool: class ProtocolEnum(str, Enum): """ - The listener protocol. Load balancers in the `network` family support `tcp`. Load - balancers in the `application` family support `tcp`, `http`, and `https`. Each - listener in the load balancer must have a unique `port` and `protocol` - combination. + The listener protocol. 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`. Each listener in the load balancer must have a + unique `port` and `protocol` combination. + The enumerated values for this property are expected to expand in the future. When + processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the listener on which the unexpected + property value was encountered. """ HTTP = 'http' HTTPS = 'https' TCP = 'tcp' + UDP = 'udp' class ProvisioningStatusEnum(str, Enum): @@ -37247,11 +38154,13 @@ class LoadBalancerListenerPatch(): certificate instance used for SSL termination. It is applicable only to `https` protocol. :attr int connection_limit: (optional) The connection limit of the listener. - :attr LoadBalancerPoolIdentity default_pool: (optional) The default pool - associated with the listener. The specified pool must: + :attr LoadBalancerPoolIdentity default_pool: (optional) The default pool for + this listener. The specified pool must: - Belong to this load balancer - - Have the same `protocol` as this listener - - Not already be the default pool for another listener. + - 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 + Specify `null` to remove an existing default pool. :attr LoadBalancerListenerHTTPSRedirectPatch https_redirect: (optional) The target listener that requests will be redirected to. This listener must have a `protocol` of `http`, and the target listener must have a `protocol` of `https`. @@ -37279,10 +38188,12 @@ class LoadBalancerListenerPatch(): :attr str protocol: (optional) The listener protocol. Each listener in the load balancer must have a unique `port` and `protocol` combination. Additional restrictions: - - If this load balancer is in the `network` family, the protocol must be `tcp`. - - If this listener has `https_redirect` specified, the protocol must be `http`. + - If this load balancer is in the `network` family, the protocol must be `tcp` + or `udp` (if `udp_supported` is `true`) , and it cannot be changed while + `default_pool` is set. + - If `https_redirect` is set, the protocol must be `http`. - If this listener is a listener's `https_redirect` target, the protocol must be - `https`. + `https`. """ def __init__(self, @@ -37317,10 +38228,12 @@ def __init__(self, :param int connection_limit: (optional) The connection limit of the listener. :param LoadBalancerPoolIdentity default_pool: (optional) The default pool - associated with the listener. The specified pool must: + for this listener. The specified pool must: - Belong to this load balancer - - Have the same `protocol` as this listener - - Not already be the default pool for another listener. + - 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 + Specify `null` to remove an existing default pool. :param LoadBalancerListenerHTTPSRedirectPatch https_redirect: (optional) The target listener that requests will be redirected to. This listener must have a @@ -37352,11 +38265,13 @@ def __init__(self, load balancer must have a unique `port` and `protocol` combination. Additional restrictions: - If this load balancer is in the `network` family, the protocol must be - `tcp`. - - If this listener has `https_redirect` specified, the protocol must be - `http`. + `tcp` + or `udp` (if `udp_supported` is `true`) , and it cannot be changed while + `default_pool` is set. + - If `https_redirect` is set, the protocol must be `http`. - If this listener is a listener's `https_redirect` target, the protocol - must be `https`. + must be + `https`. """ self.accept_proxy_protocol = accept_proxy_protocol self.certificate_instance = certificate_instance @@ -37448,14 +38363,17 @@ class ProtocolEnum(str, Enum): """ The listener protocol. Each listener in the load balancer must have a unique `port` and `protocol` combination. Additional restrictions: - - If this load balancer is in the `network` family, the protocol must be `tcp`. - - If this listener has `https_redirect` specified, the protocol must be `http`. + - If this load balancer is in the `network` family, the protocol must be `tcp` + or `udp` (if `udp_supported` is `true`) , and it cannot be changed while + `default_pool` is set. + - If `https_redirect` is set, the protocol must be `http`. - If this listener is a listener's `https_redirect` target, the protocol must be - `https`. + `https`. """ HTTP = 'http' HTTPS = 'https' TCP = 'tcp' + UDP = 'udp' class LoadBalancerListenerPolicy(): @@ -38748,7 +39666,13 @@ class LoadBalancerListenerPrototypeLoadBalancerContext(): `accept_proxy_protocol` value. :attr int connection_limit: (optional) The connection limit of the listener. :attr LoadBalancerPoolIdentityByName default_pool: (optional) The default pool - associated with the listener. + for this listener. If specified, the pool's protocol must match the + listener's protocol, or the protocols must be compatible. At present, the + compatible + protocols are `http` and `https`. + If unspecified, this listener will be created with no default pool, but one may + be + subsequently set. :attr 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. @@ -38770,9 +39694,14 @@ class LoadBalancerListenerPrototypeLoadBalancerContext(): The specified port range must not overlap with port ranges used by other listeners for this load balancer using the same protocol. :attr str protocol: The listener protocol. Load balancers in the `network` - family support `tcp`. Load balancers in the `application` family support `tcp`, - `http`, and `https`. Each listener in the load balancer must have a unique - `port` and `protocol` combination. + family support `tcp` and + `udp` (if `udp_supported` is `true`). Load balancers in the `application` family + support `tcp`, `http`, and `https`. Each listener in the load balancer must have + a unique `port` and `protocol` combination. + The enumerated values for this property are expected to expand in the future. + When processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the listener on which the unexpected + property value was encountered. """ def __init__(self, @@ -38788,9 +39717,14 @@ def __init__(self, Initialize a LoadBalancerListenerPrototypeLoadBalancerContext object. :param str protocol: The listener protocol. Load balancers in the `network` - family support `tcp`. Load balancers in the `application` family support - `tcp`, `http`, and `https`. Each listener in the load balancer must have a - unique `port` and `protocol` combination. + family support `tcp` and + `udp` (if `udp_supported` is `true`). Load balancers in the `application` + family support `tcp`, `http`, and `https`. Each listener in the load + balancer must have a unique `port` and `protocol` combination. + The enumerated values for this property are expected to expand in the + future. When processing this property, check for and log unknown values. + Optionally halt processing and surface the error, or bypass the listener on + which the unexpected property value was encountered. :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`). @@ -38805,7 +39739,13 @@ def __init__(self, :param int connection_limit: (optional) The connection limit of the listener. :param LoadBalancerPoolIdentityByName default_pool: (optional) The default - pool associated with the listener. + pool for this listener. If specified, the pool's protocol must match the + listener's protocol, or the protocols must be compatible. At present, the + compatible + protocols are `http` and `https`. + If unspecified, this listener will be created with no default pool, but one + may be + subsequently set. :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. @@ -38902,14 +39842,19 @@ def __ne__(self, other: 'LoadBalancerListenerPrototypeLoadBalancerContext') -> b class ProtocolEnum(str, Enum): """ - The listener protocol. Load balancers in the `network` family support `tcp`. Load - balancers in the `application` family support `tcp`, `http`, and `https`. Each - listener in the load balancer must have a unique `port` and `protocol` - combination. + The listener protocol. 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`. Each listener in the load balancer must have a + unique `port` and `protocol` combination. + The enumerated values for this property are expected to expand in the future. When + processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the listener on which the unexpected + property value was encountered. """ HTTP = 'http' HTTPS = 'https' TCP = 'tcp' + UDP = 'udp' class LoadBalancerListenerReference(): @@ -39452,6 +40397,7 @@ class ProtocolEnum(str, Enum): HTTP = 'http' HTTPS = 'https' TCP = 'tcp' + UDP = 'udp' class ProvisioningStatusEnum(str, Enum): @@ -40590,11 +41536,13 @@ class LoadBalancerPoolPatch(): :attr LoadBalancerPoolHealthMonitorPatch health_monitor: (optional) The health monitor of this pool. :attr str name: (optional) The user-defined name for this load balancer pool. - :attr str protocol: (optional) The protocol used for this load balancer pool. - The enumerated values for this property are expected to expand in the future. - When processing this property, check for and log unknown values. Optionally halt - processing and surface the error, or bypass the pool on which the unexpected - property value was encountered. + :attr str protocol: (optional) The protocol to use 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`. + If this pool is associated with a load balancer listener, the specified protocol + must be compatible with the listener's protocol. At present, the compatible + protocols are `http` and `https`. :attr 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) @@ -40621,12 +41569,13 @@ def __init__(self, health monitor of this pool. :param str name: (optional) The user-defined name for this load balancer pool. - :param str protocol: (optional) The protocol used for this load balancer - pool. - The enumerated values for this property are expected to expand in the - future. When processing this property, check for and log unknown values. - Optionally halt processing and surface the error, or bypass the pool on - which the unexpected property value was encountered. + :param str protocol: (optional) The protocol to use 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`. + If this pool is associated with a load balancer listener, the specified + protocol must be compatible with the listener's protocol. At present, the + compatible protocols are `http` and `https`. :param str proxy_protocol: (optional) The PROXY protocol setting for this pool: - `v1`: Enabled with version 1 (human-readable header format) @@ -40713,15 +41662,17 @@ class AlgorithmEnum(str, Enum): class ProtocolEnum(str, Enum): """ - The protocol used for this load balancer pool. - The enumerated values for this property are expected to expand in the future. When - processing this property, check for and log unknown values. Optionally halt - processing and surface the error, or bypass the pool on which the unexpected - property value was encountered. + The protocol to use 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`. + If this pool is associated with a load balancer listener, the specified protocol + must be compatible with the listener's protocol. At present, the compatible + protocols are `http` and `https`. """ HTTP = 'http' HTTPS = 'https' TCP = 'tcp' + UDP = 'udp' class ProxyProtocolEnum(str, Enum): @@ -40752,9 +41703,9 @@ class LoadBalancerPoolPrototype(): :attr str name: (optional) The user-defined name for this load balancer pool. If unspecified, the name will be a hyphenated list of randomly-selected words. :attr str protocol: The protocol used for this load balancer pool. Load - balancers in the `network` family support `tcp`. Load balancers in the - `application` family support `tcp`, `http`, and - `https`. + 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`. :attr 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) @@ -40781,9 +41732,9 @@ def __init__(self, :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`. Load balancers in the - `application` family support `tcp`, `http`, and - `https`. + 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 @@ -40889,13 +41840,14 @@ class AlgorithmEnum(str, Enum): class ProtocolEnum(str, Enum): """ The protocol used for this load balancer pool. Load balancers in the `network` - family support `tcp`. Load balancers in the `application` family support `tcp`, - `http`, and - `https`. + family support `tcp` and `udp` (if `udp_supported` is `true`). Load balancers in + the + `application` family support `tcp`, `http`, and `https`. """ HTTP = 'http' HTTPS = 'https' TCP = 'tcp' + UDP = 'udp' class ProxyProtocolEnum(str, Enum): @@ -41302,6 +42254,134 @@ class TypeEnum(str, Enum): SOURCE_IP = 'source_ip' +class LoadBalancerPrivateIpsItem(): + """ + LoadBalancerPrivateIpsItem. + + :attr str address: The IP address. + If the address has not yet been selected, the value will be `0.0.0.0`. + This property may add support for IPv6 addresses in the future. When processing + a value in this property, verify that the address is in an expected format. If + it is not, log an error. Optionally halt processing and surface the error, or + bypass the resource on which the unexpected IP address format was encountered. + :attr ReservedIPReferenceDeleted deleted: (optional) If present, this property + indicates the referenced resource has been deleted and provides + some supplementary information. + :attr str href: The URL for this reserved IP. + :attr str id: The unique identifier for this reserved IP. + :attr str name: The user-defined or system-provided name for this reserved IP. + :attr str resource_type: The resource type. + """ + + def __init__(self, + address: str, + href: str, + id: str, + name: str, + resource_type: str, + *, + deleted: 'ReservedIPReferenceDeleted' = None) -> None: + """ + Initialize a LoadBalancerPrivateIpsItem object. + + :param str address: The IP address. + If the address has not yet been selected, the value will be `0.0.0.0`. + This property may add support for IPv6 addresses in the future. When + processing a value in this property, verify that the address is in an + expected format. If it is not, log an error. Optionally halt processing and + surface the error, or bypass the resource on which the unexpected IP + address format was encountered. + :param str href: The URL for this reserved IP. + :param str id: The unique identifier for this reserved IP. + :param str name: The user-defined or system-provided name for this reserved + IP. + :param str resource_type: The resource type. + :param ReservedIPReferenceDeleted 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) -> 'LoadBalancerPrivateIpsItem': + """Initialize a LoadBalancerPrivateIpsItem object from a json dictionary.""" + args = {} + if 'address' in _dict: + args['address'] = _dict.get('address') + else: + raise ValueError('Required property \'address\' not present in LoadBalancerPrivateIpsItem JSON') + if 'deleted' in _dict: + args['deleted'] = ReservedIPReferenceDeleted.from_dict(_dict.get('deleted')) + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in LoadBalancerPrivateIpsItem JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in LoadBalancerPrivateIpsItem JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in LoadBalancerPrivateIpsItem JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in LoadBalancerPrivateIpsItem JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a LoadBalancerPrivateIpsItem object from 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: + _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 LoadBalancerPrivateIpsItem object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'LoadBalancerPrivateIpsItem') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'LoadBalancerPrivateIpsItem') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + SUBNET_RESERVED_IP = 'subnet_reserved_ip' + + class LoadBalancerProfile(): """ LoadBalancerProfile. @@ -41313,6 +42393,7 @@ class LoadBalancerProfile(): :attr str name: The globally unique name for this load balancer profile. :attr LoadBalancerProfileRouteModeSupported route_mode_supported: :attr LoadBalancerProfileSecurityGroupsSupported security_groups_supported: + :attr LoadBalancerProfileUDPSupported udp_supported: """ def __init__(self, @@ -41321,7 +42402,8 @@ def __init__(self, logging_supported: 'LoadBalancerProfileLoggingSupported', name: str, route_mode_supported: 'LoadBalancerProfileRouteModeSupported', - security_groups_supported: 'LoadBalancerProfileSecurityGroupsSupported') -> None: + security_groups_supported: 'LoadBalancerProfileSecurityGroupsSupported', + udp_supported: 'LoadBalancerProfileUDPSupported') -> None: """ Initialize a LoadBalancerProfile object. @@ -41334,6 +42416,7 @@ def __init__(self, :param LoadBalancerProfileRouteModeSupported route_mode_supported: :param LoadBalancerProfileSecurityGroupsSupported security_groups_supported: + :param LoadBalancerProfileUDPSupported udp_supported: """ self.family = family self.href = href @@ -41341,6 +42424,7 @@ def __init__(self, self.name = name self.route_mode_supported = route_mode_supported self.security_groups_supported = security_groups_supported + self.udp_supported = udp_supported @classmethod def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfile': @@ -41370,6 +42454,10 @@ def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfile': args['security_groups_supported'] = _dict.get('security_groups_supported') else: raise ValueError('Required property \'security_groups_supported\' not present in LoadBalancerProfile JSON') + if 'udp_supported' in _dict: + args['udp_supported'] = _dict.get('udp_supported') + else: + raise ValueError('Required property \'udp_supported\' not present in LoadBalancerProfile JSON') return cls(**args) @classmethod @@ -41398,6 +42486,11 @@ def to_dict(self) -> Dict: _dict['security_groups_supported'] = self.security_groups_supported else: _dict['security_groups_supported'] = self.security_groups_supported.to_dict() + if hasattr(self, 'udp_supported') and self.udp_supported is not None: + if isinstance(self.udp_supported, dict): + _dict['udp_supported'] = self.udp_supported + else: + _dict['udp_supported'] = self.udp_supported.to_dict() return _dict def _to_dict(self): @@ -41832,6 +42925,21 @@ def __init__(self) -> None: ", ".join(['LoadBalancerProfileSecurityGroupsSupportedFixed', 'LoadBalancerProfileSecurityGroupsSupportedDependent'])) raise Exception(msg) +class LoadBalancerProfileUDPSupported(): + """ + LoadBalancerProfileUDPSupported. + + """ + + def __init__(self) -> None: + """ + Initialize a LoadBalancerProfileUDPSupported object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['LoadBalancerProfileUDPSupportedFixed', 'LoadBalancerProfileUDPSupportedDependent'])) + raise Exception(msg) + class LoadBalancerReferenceDeleted(): """ If present, this property indicates the referenced resource has been deleted and @@ -43633,8 +44741,7 @@ class NetworkInterface(): :attr str id: The unique identifier for this network interface. :attr str name: The user-defined name for this network interface. :attr int port_speed: The network interface port speed in Mbps. - :attr str primary_ipv4_address: The primary IPv4 address. - If the address has not yet been selected, the value will be `0.0.0.0`. + :attr ReservedIPReference primary_ip: :attr str resource_type: The resource type. :attr List[SecurityGroupReference] security_groups: The security groups targeting this network interface. @@ -43650,7 +44757,7 @@ def __init__(self, id: str, name: str, port_speed: int, - primary_ipv4_address: str, + primary_ip: 'ReservedIPReference', resource_type: str, security_groups: List['SecurityGroupReference'], status: str, @@ -43670,8 +44777,7 @@ def __init__(self, :param str id: The unique identifier for this network interface. :param str name: The user-defined name for this network interface. :param int port_speed: The network interface port speed in Mbps. - :param str primary_ipv4_address: The primary IPv4 address. - If the address has not yet been selected, the value will be `0.0.0.0`. + :param ReservedIPReference primary_ip: :param str resource_type: The resource type. :param List[SecurityGroupReference] security_groups: The security groups targeting this network interface. @@ -43689,7 +44795,7 @@ def __init__(self, self.id = id self.name = name self.port_speed = port_speed - self.primary_ipv4_address = primary_ipv4_address + self.primary_ip = primary_ip self.resource_type = resource_type self.security_groups = security_groups self.status = status @@ -43726,10 +44832,10 @@ def from_dict(cls, _dict: Dict) -> 'NetworkInterface': args['port_speed'] = _dict.get('port_speed') else: raise ValueError('Required property \'port_speed\' not present in NetworkInterface JSON') - if 'primary_ipv4_address' in _dict: - args['primary_ipv4_address'] = _dict.get('primary_ipv4_address') + if 'primary_ip' in _dict: + args['primary_ip'] = ReservedIPReference.from_dict(_dict.get('primary_ip')) else: - raise ValueError('Required property \'primary_ipv4_address\' not present in NetworkInterface JSON') + raise ValueError('Required property \'primary_ip\' not present in NetworkInterface JSON') if 'resource_type' in _dict: args['resource_type'] = _dict.get('resource_type') else: @@ -43774,8 +44880,8 @@ def to_dict(self) -> Dict: _dict['name'] = self.name if hasattr(self, 'port_speed') and self.port_speed is not None: _dict['port_speed'] = self.port_speed - if hasattr(self, 'primary_ipv4_address') and self.primary_ipv4_address is not None: - _dict['primary_ipv4_address'] = self.primary_ipv4_address + if hasattr(self, 'primary_ip') and self.primary_ip is not None: + _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, 'security_groups') and self.security_groups is not None: @@ -43842,8 +44948,7 @@ class NetworkInterfaceBareMetalServerContextReference(): :attr str href: The URL for this network interface. :attr str id: The unique identifier for this network interface. :attr str name: The user-defined name for this network interface. - :attr str primary_ipv4_address: The primary IPv4 address. - If the address has not yet been selected, the value will be `0.0.0.0`. + :attr ReservedIPReference primary_ip: :attr str resource_type: The resource type. :attr SubnetReference subnet: The associated subnet. """ @@ -43852,7 +44957,7 @@ def __init__(self, href: str, id: str, name: str, - primary_ipv4_address: str, + primary_ip: 'ReservedIPReference', resource_type: str, subnet: 'SubnetReference', *, @@ -43863,8 +44968,7 @@ def __init__(self, :param str href: The URL for this network interface. :param str id: The unique identifier for this network interface. :param str name: The user-defined name for this network interface. - :param str primary_ipv4_address: The primary IPv4 address. - If the address has not yet been selected, the value will be `0.0.0.0`. + :param ReservedIPReference primary_ip: :param str resource_type: The resource type. :param SubnetReference subnet: The associated subnet. :param NetworkInterfaceBareMetalServerContextReferenceDeleted deleted: @@ -43876,7 +44980,7 @@ def __init__(self, self.href = href self.id = id self.name = name - self.primary_ipv4_address = primary_ipv4_address + self.primary_ip = primary_ip self.resource_type = resource_type self.subnet = subnet @@ -43898,10 +45002,10 @@ def from_dict(cls, _dict: Dict) -> 'NetworkInterfaceBareMetalServerContextRefere args['name'] = _dict.get('name') else: raise ValueError('Required property \'name\' not present in NetworkInterfaceBareMetalServerContextReference JSON') - if 'primary_ipv4_address' in _dict: - args['primary_ipv4_address'] = _dict.get('primary_ipv4_address') + if 'primary_ip' in _dict: + args['primary_ip'] = ReservedIPReference.from_dict(_dict.get('primary_ip')) else: - raise ValueError('Required property \'primary_ipv4_address\' not present in NetworkInterfaceBareMetalServerContextReference JSON') + raise ValueError('Required property \'primary_ip\' not present in NetworkInterfaceBareMetalServerContextReference JSON') if 'resource_type' in _dict: args['resource_type'] = _dict.get('resource_type') else: @@ -43928,8 +45032,8 @@ 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, 'primary_ipv4_address') and self.primary_ipv4_address is not None: - _dict['primary_ipv4_address'] = self.primary_ipv4_address + if hasattr(self, 'primary_ip') and self.primary_ip is not None: + _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: @@ -44018,223 +45122,20 @@ def __ne__(self, other: 'NetworkInterfaceBareMetalServerContextReferenceDeleted' """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class NetworkInterfaceCollection(): - """ - NetworkInterfaceCollection. - - :attr NetworkInterfaceCollectionFirst first: A link to the first page of - resources. - :attr int limit: The maximum number of resources that can be returned by the - request. - :attr List[NetworkInterface] network_interfaces: Collection of network - interfaces. - :attr NetworkInterfaceCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages - except the last page. - :attr int total_count: The total number of resources across all pages. - """ - - def __init__(self, - first: 'NetworkInterfaceCollectionFirst', - limit: int, - network_interfaces: List['NetworkInterface'], - total_count: int, - *, - next: 'NetworkInterfaceCollectionNext' = None) -> None: - """ - Initialize a NetworkInterfaceCollection object. - - :param NetworkInterfaceCollectionFirst 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[NetworkInterface] network_interfaces: Collection of network - interfaces. - :param int total_count: The total number of resources across all pages. - :param NetworkInterfaceCollectionNext 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) -> 'NetworkInterfaceCollection': - """Initialize a NetworkInterfaceCollection object from a json dictionary.""" - args = {} - if 'first' in _dict: - args['first'] = NetworkInterfaceCollectionFirst.from_dict(_dict.get('first')) - else: - raise ValueError('Required property \'first\' not present in NetworkInterfaceCollection JSON') - if 'limit' in _dict: - args['limit'] = _dict.get('limit') - else: - raise ValueError('Required property \'limit\' not present in NetworkInterfaceCollection JSON') - if 'network_interfaces' in _dict: - args['network_interfaces'] = [NetworkInterface.from_dict(x) for x in _dict.get('network_interfaces')] - else: - raise ValueError('Required property \'network_interfaces\' not present in NetworkInterfaceCollection JSON') - if 'next' in _dict: - args['next'] = NetworkInterfaceCollectionNext.from_dict(_dict.get('next')) - if 'total_count' in _dict: - args['total_count'] = _dict.get('total_count') - else: - raise ValueError('Required property \'total_count\' not present in NetworkInterfaceCollection JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a NetworkInterfaceCollection object from 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: - _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: - _dict['network_interfaces'] = [x.to_dict() for x in self.network_interfaces] - if hasattr(self, 'next') and self.next is not None: - _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 NetworkInterfaceCollection object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'NetworkInterfaceCollection') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - - def __ne__(self, other: 'NetworkInterfaceCollection') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - -class NetworkInterfaceCollectionFirst(): +class NetworkInterfaceIPPrototype(): """ - A link to the first page of resources. - - :attr str href: The URL for a page of resources. - """ - - def __init__(self, - href: str) -> None: - """ - Initialize a NetworkInterfaceCollectionFirst object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkInterfaceCollectionFirst': - """Initialize a NetworkInterfaceCollectionFirst object from a json dictionary.""" - args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in NetworkInterfaceCollectionFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a NetworkInterfaceCollectionFirst object from 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 NetworkInterfaceCollectionFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'NetworkInterfaceCollectionFirst') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - - def __ne__(self, other: 'NetworkInterfaceCollectionFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - -class NetworkInterfaceCollectionNext(): - """ - A link to the next page of resources. This property is present for all pages except - the last page. + NetworkInterfaceIPPrototype. - :attr str href: The URL for a page of resources. """ - def __init__(self, - href: str) -> None: + def __init__(self) -> None: """ - Initialize a NetworkInterfaceCollectionNext object. + Initialize a NetworkInterfaceIPPrototype object. - :param str href: The URL for a page of resources. """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkInterfaceCollectionNext': - """Initialize a NetworkInterfaceCollectionNext object from a json dictionary.""" - args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in NetworkInterfaceCollectionNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a NetworkInterfaceCollectionNext object from 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 NetworkInterfaceCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'NetworkInterfaceCollectionNext') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - - def __ne__(self, other: 'NetworkInterfaceCollectionNext') -> 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(['NetworkInterfaceIPPrototypeReservedIPIdentity', 'NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext'])) + raise Exception(msg) class NetworkInterfaceInstanceContextReference(): """ @@ -44247,8 +45148,7 @@ class NetworkInterfaceInstanceContextReference(): :attr str href: The URL for this network interface. :attr str id: The unique identifier for this network interface. :attr str name: The user-defined name for this network interface. - :attr str primary_ipv4_address: The primary IPv4 address. - If the address has not yet been selected, the value will be `0.0.0.0`. + :attr ReservedIPReference primary_ip: :attr str resource_type: The resource type. :attr SubnetReference subnet: The associated subnet. """ @@ -44257,7 +45157,7 @@ def __init__(self, href: str, id: str, name: str, - primary_ipv4_address: str, + primary_ip: 'ReservedIPReference', resource_type: str, subnet: 'SubnetReference', *, @@ -44268,8 +45168,7 @@ def __init__(self, :param str href: The URL for this network interface. :param str id: The unique identifier for this network interface. :param str name: The user-defined name for this network interface. - :param str primary_ipv4_address: The primary IPv4 address. - If the address has not yet been selected, the value will be `0.0.0.0`. + :param ReservedIPReference primary_ip: :param str resource_type: The resource type. :param SubnetReference subnet: The associated subnet. :param NetworkInterfaceInstanceContextReferenceDeleted deleted: (optional) @@ -44281,7 +45180,7 @@ def __init__(self, self.href = href self.id = id self.name = name - self.primary_ipv4_address = primary_ipv4_address + self.primary_ip = primary_ip self.resource_type = resource_type self.subnet = subnet @@ -44303,10 +45202,10 @@ def from_dict(cls, _dict: Dict) -> 'NetworkInterfaceInstanceContextReference': args['name'] = _dict.get('name') else: raise ValueError('Required property \'name\' not present in NetworkInterfaceInstanceContextReference JSON') - if 'primary_ipv4_address' in _dict: - args['primary_ipv4_address'] = _dict.get('primary_ipv4_address') + if 'primary_ip' in _dict: + args['primary_ip'] = ReservedIPReference.from_dict(_dict.get('primary_ip')) else: - raise ValueError('Required property \'primary_ipv4_address\' not present in NetworkInterfaceInstanceContextReference JSON') + raise ValueError('Required property \'primary_ip\' not present in NetworkInterfaceInstanceContextReference JSON') if 'resource_type' in _dict: args['resource_type'] = _dict.get('resource_type') else: @@ -44333,8 +45232,8 @@ 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, 'primary_ipv4_address') and self.primary_ipv4_address is not None: - _dict['primary_ipv4_address'] = self.primary_ipv4_address + if hasattr(self, 'primary_ip') and self.primary_ip is not None: + _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: @@ -44503,9 +45402,14 @@ class NetworkInterfacePrototype(): :attr str name: (optional) The user-defined name for network interface. Names must be unique within the instance the network interface resides in. If unspecified, the name will be a hyphenated list of randomly-selected words. - :attr str primary_ipv4_address: (optional) The primary IPv4 address. If - specified, it must be an available address on the network interface's subnet. If - unspecified, an available address on the subnet will be automatically selected. + :attr NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP address + to bind to the 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 network interface's subnet. Otherwise, an available address + on the + subnet will be automatically selected and reserved. :attr List[SecurityGroupIdentity] security_groups: (optional) The security groups to use for this network interface. If unspecified, the VPC's default security group is used. @@ -44517,7 +45421,7 @@ def __init__(self, *, allow_ip_spoofing: bool = None, name: str = None, - primary_ipv4_address: str = None, + primary_ip: 'NetworkInterfaceIPPrototype' = None, security_groups: List['SecurityGroupIdentity'] = None) -> None: """ Initialize a NetworkInterfacePrototype object. @@ -44531,17 +45435,21 @@ def __init__(self, Names must be unique within the instance the network interface resides in. If unspecified, the name will be a hyphenated list of randomly-selected words. - :param str primary_ipv4_address: (optional) The primary IPv4 address. If - specified, it must be an available address on the network interface's - subnet. If unspecified, an available address on the subnet will be - automatically selected. + :param NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP + address to bind to the 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 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 network interface. If unspecified, the VPC's default security group is used. """ self.allow_ip_spoofing = allow_ip_spoofing self.name = name - self.primary_ipv4_address = primary_ipv4_address + self.primary_ip = primary_ip self.security_groups = security_groups self.subnet = subnet @@ -44553,8 +45461,8 @@ def from_dict(cls, _dict: Dict) -> 'NetworkInterfacePrototype': args['allow_ip_spoofing'] = _dict.get('allow_ip_spoofing') if 'name' in _dict: args['name'] = _dict.get('name') - if 'primary_ipv4_address' in _dict: - args['primary_ipv4_address'] = _dict.get('primary_ipv4_address') + if 'primary_ip' in _dict: + args['primary_ip'] = _dict.get('primary_ip') if 'security_groups' in _dict: args['security_groups'] = _dict.get('security_groups') if 'subnet' in _dict: @@ -44575,8 +45483,11 @@ def to_dict(self) -> Dict: _dict['allow_ip_spoofing'] = self.allow_ip_spoofing if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'primary_ipv4_address') and self.primary_ipv4_address is not None: - _dict['primary_ipv4_address'] = self.primary_ipv4_address + 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 x in self.security_groups: @@ -44610,125 +45521,6 @@ def __ne__(self, other: 'NetworkInterfacePrototype') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class NetworkInterfaceReference(): - """ - NetworkInterfaceReference. - - :attr NetworkInterfaceReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted and provides - some supplementary information. - :attr str href: The URL for this network interface. - :attr str id: The unique identifier for this network interface. - :attr str name: The user-defined name for this network interface. - :attr str primary_ipv4_address: The primary IPv4 address. - If the address has not yet been selected, the value will be `0.0.0.0`. - :attr str resource_type: The resource type. - """ - - def __init__(self, - href: str, - id: str, - name: str, - primary_ipv4_address: str, - resource_type: str, - *, - deleted: 'NetworkInterfaceReferenceDeleted' = None) -> None: - """ - Initialize a NetworkInterfaceReference object. - - :param str href: The URL for this network interface. - :param str id: The unique identifier for this network interface. - :param str name: The user-defined name for this network interface. - :param str primary_ipv4_address: The primary IPv4 address. - If the address has not yet been selected, the value will be `0.0.0.0`. - :param str resource_type: The resource type. - :param NetworkInterfaceReferenceDeleted 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_ipv4_address = primary_ipv4_address - self.resource_type = resource_type - - @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkInterfaceReference': - """Initialize a NetworkInterfaceReference object from a json dictionary.""" - args = {} - if 'deleted' in _dict: - args['deleted'] = NetworkInterfaceReferenceDeleted.from_dict(_dict.get('deleted')) - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in NetworkInterfaceReference JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in NetworkInterfaceReference JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in NetworkInterfaceReference JSON') - if 'primary_ipv4_address' in _dict: - args['primary_ipv4_address'] = _dict.get('primary_ipv4_address') - else: - raise ValueError('Required property \'primary_ipv4_address\' not present in NetworkInterfaceReference JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') - else: - raise ValueError('Required property \'resource_type\' not present in NetworkInterfaceReference JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a NetworkInterfaceReference object from 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: - _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_ipv4_address') and self.primary_ipv4_address is not None: - _dict['primary_ipv4_address'] = self.primary_ipv4_address - 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 NetworkInterfaceReference object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'NetworkInterfaceReference') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - - def __ne__(self, other: 'NetworkInterfaceReference') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class ResourceTypeEnum(str, Enum): - """ - The resource type. - """ - NETWORK_INTERFACE = 'network_interface' - - class NetworkInterfaceReferenceDeleted(): """ If present, this property indicates the referenced resource has been deleted and @@ -46831,11 +47623,12 @@ class ReservedIP(): :attr datetime created_at: The date and time that the reserved IP was created. :attr str href: The URL for this reserved IP. :attr str id: The unique identifier for this reserved IP. + :attr str lifecycle_state: The lifecycle state of the reserved IP. :attr str name: The user-defined or system-provided name for this reserved IP. - :attr str owner: The owner of a reserved IP, defining whether it is managed by - the user or the provider. + :attr str owner: The owner of the reserved IP. :attr str resource_type: The resource type. :attr ReservedIPTarget target: (optional) The target of this reserved IP. + If absent, this reserved IP is provider-owned or unbound. """ def __init__(self, @@ -46844,6 +47637,7 @@ def __init__(self, created_at: datetime, href: str, id: str, + lifecycle_state: str, name: str, owner: str, resource_type: str, @@ -46866,18 +47660,20 @@ def __init__(self, created. :param str href: The URL for this reserved IP. :param str id: The unique identifier for this reserved IP. + :param str lifecycle_state: The lifecycle state of the reserved IP. :param str name: The user-defined or system-provided name for this reserved IP. - :param str owner: The owner of a reserved IP, defining whether it is - managed by the user or the provider. + :param str owner: The owner of the reserved IP. :param str resource_type: The resource type. :param ReservedIPTarget target: (optional) The target of this reserved IP. + If absent, this reserved IP is provider-owned or unbound. """ self.address = address self.auto_delete = auto_delete self.created_at = created_at self.href = href self.id = id + self.lifecycle_state = lifecycle_state self.name = name self.owner = owner self.resource_type = resource_type @@ -46907,6 +47703,10 @@ def from_dict(cls, _dict: Dict) -> 'ReservedIP': args['id'] = _dict.get('id') else: raise ValueError('Required property \'id\' not present in ReservedIP JSON') + if 'lifecycle_state' in _dict: + args['lifecycle_state'] = _dict.get('lifecycle_state') + else: + raise ValueError('Required property \'lifecycle_state\' not present in ReservedIP JSON') if 'name' in _dict: args['name'] = _dict.get('name') else: @@ -46941,6 +47741,8 @@ def to_dict(self) -> Dict: _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, 'owner') and self.owner is not None: @@ -46972,10 +47774,22 @@ def __ne__(self, other: 'ReservedIP') -> 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 reserved IP. + """ + DELETING = 'deleting' + FAILED = 'failed' + PENDING = 'pending' + STABLE = 'stable' + SUSPENDED = 'suspended' + UPDATING = 'updating' + WAITING = 'waiting' + + class OwnerEnum(str, Enum): """ - The owner of a reserved IP, defining whether it is managed by the user or the - provider. + The owner of the reserved IP. """ PROVIDER = 'provider' USER = 'user' @@ -47365,6 +48179,224 @@ def __ne__(self, other: 'ReservedIPCollectionFirst') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other +class ReservedIPCollectionNetworkInterfaceContext(): + """ + ReservedIPCollectionNetworkInterfaceContext. + + :attr ReservedIPCollectionNetworkInterfaceContextFirst first: A link to the + first page of resources. + :attr List[ReservedIP] ips: Collection of reserved IPs bound to a network + interface. + :attr int limit: The maximum number of resources that can be returned by the + request. + :attr ReservedIPCollectionNetworkInterfaceContextNext next: (optional) A link to + the next page of resources. This property is present for all pages + except the last page. + :attr int total_count: The total number of resources across all pages. + """ + + def __init__(self, + first: 'ReservedIPCollectionNetworkInterfaceContextFirst', + ips: List['ReservedIP'], + limit: int, + total_count: int, + *, + next: 'ReservedIPCollectionNetworkInterfaceContextNext' = None) -> None: + """ + Initialize a ReservedIPCollectionNetworkInterfaceContext object. + + :param ReservedIPCollectionNetworkInterfaceContextFirst first: A link to + the first page of resources. + :param List[ReservedIP] ips: Collection of reserved IPs bound to a 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 ReservedIPCollectionNetworkInterfaceContextNext 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) -> 'ReservedIPCollectionNetworkInterfaceContext': + """Initialize a ReservedIPCollectionNetworkInterfaceContext object from a json dictionary.""" + args = {} + if 'first' in _dict: + args['first'] = ReservedIPCollectionNetworkInterfaceContextFirst.from_dict(_dict.get('first')) + else: + raise ValueError('Required property \'first\' not present in ReservedIPCollectionNetworkInterfaceContext JSON') + if 'ips' in _dict: + args['ips'] = [ReservedIP.from_dict(x) for x in _dict.get('ips')] + else: + raise ValueError('Required property \'ips\' not present in ReservedIPCollectionNetworkInterfaceContext JSON') + if 'limit' in _dict: + args['limit'] = _dict.get('limit') + else: + raise ValueError('Required property \'limit\' not present in ReservedIPCollectionNetworkInterfaceContext JSON') + if 'next' in _dict: + args['next'] = ReservedIPCollectionNetworkInterfaceContextNext.from_dict(_dict.get('next')) + if 'total_count' in _dict: + args['total_count'] = _dict.get('total_count') + else: + raise ValueError('Required property \'total_count\' not present in ReservedIPCollectionNetworkInterfaceContext JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a ReservedIPCollectionNetworkInterfaceContext object from 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: + _dict['first'] = self.first.to_dict() + if hasattr(self, 'ips') and self.ips is not None: + _dict['ips'] = [x.to_dict() for x in self.ips] + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'next') and self.next is not None: + _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 ReservedIPCollectionNetworkInterfaceContext object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ReservedIPCollectionNetworkInterfaceContext') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'ReservedIPCollectionNetworkInterfaceContext') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + +class ReservedIPCollectionNetworkInterfaceContextFirst(): + """ + A link to the first page of resources. + + :attr str href: The URL for a page of resources. + """ + + def __init__(self, + href: str) -> None: + """ + Initialize a ReservedIPCollectionNetworkInterfaceContextFirst object. + + :param str href: The URL for a page of resources. + """ + self.href = href + + @classmethod + def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionNetworkInterfaceContextFirst': + """Initialize a ReservedIPCollectionNetworkInterfaceContextFirst object from a json dictionary.""" + args = {} + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in ReservedIPCollectionNetworkInterfaceContextFirst JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a ReservedIPCollectionNetworkInterfaceContextFirst object from 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 ReservedIPCollectionNetworkInterfaceContextFirst object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ReservedIPCollectionNetworkInterfaceContextFirst') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'ReservedIPCollectionNetworkInterfaceContextFirst') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + +class ReservedIPCollectionNetworkInterfaceContextNext(): + """ + A link to the next page of resources. This property is present for all pages except + the last page. + + :attr str href: The URL for a page of resources. + """ + + def __init__(self, + href: str) -> None: + """ + Initialize a ReservedIPCollectionNetworkInterfaceContextNext object. + + :param str href: The URL for a page of resources. + """ + self.href = href + + @classmethod + def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionNetworkInterfaceContextNext': + """Initialize a ReservedIPCollectionNetworkInterfaceContextNext object from a json dictionary.""" + args = {} + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in ReservedIPCollectionNetworkInterfaceContextNext JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a ReservedIPCollectionNetworkInterfaceContextNext object from 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 ReservedIPCollectionNetworkInterfaceContextNext object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ReservedIPCollectionNetworkInterfaceContextNext') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'ReservedIPCollectionNetworkInterfaceContextNext') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + class ReservedIPCollectionNext(): """ A link to the next page of resources. This property is present for all pages except @@ -47683,6 +48715,7 @@ def __ne__(self, other: 'ReservedIPReferenceDeleted') -> bool: class ReservedIPTarget(): """ The target of this reserved IP. + If absent, this reserved IP is provider-owned or unbound. """ @@ -47692,7 +48725,7 @@ def __init__(self) -> None: """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['ReservedIPTargetEndpointGatewayReference'])) + ", ".join(['ReservedIPTargetEndpointGatewayReference', 'ReservedIPTargetNetworkInterfaceReferenceTargetContext', 'ReservedIPTargetLoadBalancerReference', 'ReservedIPTargetVPNGatewayReference', 'ReservedIPTargetGenericResourceReference'])) raise Exception(msg) class ReservedIPTargetPrototype(): @@ -48601,24 +49634,27 @@ class RoutingTable(): [Direct Link](https://cloud.ibm.com/docs/dl/) to this VPC. Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of `deliver` are treated as `drop` unless the - `next_hop` is an IP address within the VPC's address prefix ranges. Therefore, - if an incoming packet matches a route with a `next_hop` of an internet-bound IP - address or a VPN gateway connection, the packet will be dropped. + `next_hop` is an IP address bound to a network interface on a subnet in the + route's `zone`. Therefore, if an incoming packet matches a route with a + `next_hop` of an internet-bound IP address or a VPN gateway connection, the + packet will be dropped. :attr bool route_transit_gateway_ingress: Indicates whether this routing table is used to route traffic that originates from from [Transit Gateway](https://cloud.ibm.com/cloud/transit-gateway/) to this VPC. Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of `deliver` are treated as `drop` unless the - `next_hop` is an IP address within the VPC's address prefix ranges. Therefore, - if an incoming packet matches a route with a `next_hop` of an internet-bound IP - address or a VPN gateway connection, the packet will be dropped. + `next_hop` is an IP address bound to a network interface on a subnet in the + route's `zone`. Therefore, if an incoming packet matches a route with a + `next_hop` of an internet-bound IP address or a VPN gateway connection, the + packet will be dropped. :attr bool route_vpc_zone_ingress: Indicates whether this routing table is used to route traffic that originates from subnets in other zones in this VPC. Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of `deliver` are treated as `drop` unless the - `next_hop` is an IP address within the VPC's address prefix ranges. Therefore, - if an incoming packet matches a route with a `next_hop` of an internet-bound IP - address or a VPN gateway connection, the packet will be dropped. + `next_hop` is an IP address bound to a network interface on a subnet in the + route's `zone`. Therefore, if an incoming packet matches a route with a + `next_hop` of an internet-bound IP address or a VPN gateway connection, the + packet will be dropped. :attr List[RouteReference] routes: The routes for this routing table. :attr List[SubnetReference] subnets: The subnets to which this routing table is attached. @@ -48654,28 +49690,28 @@ def __init__(self, [Direct Link](https://cloud.ibm.com/docs/dl/) to this VPC. Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of `deliver` are treated as `drop` - unless the `next_hop` is an IP address within the VPC's address prefix - ranges. Therefore, if an incoming packet matches a route with a `next_hop` - of an internet-bound IP address or a VPN gateway connection, the packet - will be dropped. + unless the `next_hop` is an IP address bound to a network interface on a + subnet in the route's `zone`. Therefore, if an incoming packet matches a + route with a `next_hop` of an internet-bound IP address or a VPN gateway + connection, the packet will be dropped. :param bool route_transit_gateway_ingress: Indicates whether this routing table is used to route traffic that originates from from [Transit Gateway](https://cloud.ibm.com/cloud/transit-gateway/) to this VPC. Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of `deliver` are treated as `drop` - unless the `next_hop` is an IP address within the VPC's address prefix - ranges. Therefore, if an incoming packet matches a route with a `next_hop` - of an internet-bound IP address or a VPN gateway connection, the packet - will be dropped. + unless the `next_hop` is an IP address bound to a network interface on a + subnet in the route's `zone`. Therefore, if an incoming packet matches a + route with a `next_hop` of an internet-bound IP address or a VPN gateway + connection, the packet will be dropped. :param bool route_vpc_zone_ingress: Indicates whether this routing table is used to route traffic that originates from subnets in other zones in this VPC. Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of `deliver` are treated as `drop` - unless the `next_hop` is an IP address within the VPC's address prefix - ranges. Therefore, if an incoming packet matches a route with a `next_hop` - of an internet-bound IP address or a VPN gateway connection, the packet - will be dropped. + unless the `next_hop` is an IP address bound to a network interface on a + subnet in the route's `zone`. Therefore, if an incoming packet matches a + route with a `next_hop` of an internet-bound IP address or a VPN gateway + connection, the packet will be dropped. :param List[RouteReference] routes: The routes for this routing table. :param List[SubnetReference] subnets: The subnets to which this routing table is attached. @@ -49063,9 +50099,10 @@ class RoutingTablePatch(): table. Updating to `false` deselects this routing table. Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of `deliver` are treated as `drop` unless the - `next_hop` is an IP address within the VPC's address prefix ranges. Therefore, - if an incoming packet matches a route with a `next_hop` of an internet-bound IP - address or a VPN gateway connection, the packet will be dropped. + `next_hop` is an IP address bound to a network interface on a subnet in the + route's `zone`. Therefore, if an incoming packet matches a route with a + `next_hop` of an internet-bound IP address or a VPN gateway connection, the + packet will be dropped. :attr bool route_transit_gateway_ingress: (optional) Indicates whether this routing table is used to route traffic that originates from [Transit Gateway](https://cloud.ibm.com/cloud/transit-gateway/) to this VPC. @@ -49075,9 +50112,10 @@ class RoutingTablePatch(): routing table. Updating to `false` deselects this routing table. Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of `deliver` are treated as `drop` unless the - `next_hop` is an IP address within the VPC's address prefix ranges. Therefore, - if an incoming packet matches a route with a `next_hop` of an internet-bound IP - address or a VPN gateway connection, the packet will be dropped. + `next_hop` is an IP address bound to a network interface on a subnet in the + route's `zone`. Therefore, if an incoming packet matches a route with a + `next_hop` of an internet-bound IP address or a VPN gateway connection, the + packet will be dropped. If [Classic Access](https://cloud.ibm.com/docs/vpc?topic=vpc-setting-up-access-to-classic-infrastructure) is enabled for this VPC, and this property is set to `true`, its incoming @@ -49090,9 +50128,10 @@ class RoutingTablePatch(): table. Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of `deliver` are treated as `drop` unless the - `next_hop` is an IP address within the VPC's address prefix ranges. Therefore, - if an incoming packet matches a route with a `next_hop` of an internet-bound IP - address or a VPN gateway connection, the packet will be dropped. + `next_hop` is an IP address bound to a network interface on a subnet in the + route's `zone`. Therefore, if an incoming packet matches a route with a + `next_hop` of an internet-bound IP address or a VPN gateway connection, the + packet will be dropped. """ def __init__(self, @@ -49114,10 +50153,10 @@ def __init__(self, this routing table. Updating to `false` deselects this routing table. Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of `deliver` are treated as `drop` - unless the `next_hop` is an IP address within the VPC's address prefix - ranges. Therefore, if an incoming packet matches a route with a `next_hop` - of an internet-bound IP address or a VPN gateway connection, the packet - will be dropped. + unless the `next_hop` is an IP address bound to a network interface on a + subnet in the route's `zone`. Therefore, if an incoming packet matches a + route with a `next_hop` of an internet-bound IP address or a VPN gateway + connection, the packet will be dropped. :param bool route_transit_gateway_ingress: (optional) Indicates whether this routing table is used to route traffic that originates from [Transit Gateway](https://cloud.ibm.com/cloud/transit-gateway/) to this @@ -49127,10 +50166,10 @@ def __init__(self, this routing table. Updating to `false` deselects this routing table. Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of `deliver` are treated as `drop` - unless the `next_hop` is an IP address within the VPC's address prefix - ranges. Therefore, if an incoming packet matches a route with a `next_hop` - of an internet-bound IP address or a VPN gateway connection, the packet - will be dropped. + unless the `next_hop` is an IP address bound to a network interface on a + subnet in the route's `zone`. Therefore, if an incoming packet matches a + route with a `next_hop` of an internet-bound IP address or a VPN gateway + connection, the packet will be dropped. If [Classic Access](https://cloud.ibm.com/docs/vpc?topic=vpc-setting-up-access-to-classic-infrastructure) is enabled for this VPC, and this property is set to `true`, its incoming @@ -49143,10 +50182,10 @@ def __init__(self, `false` deselects this routing table. Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of `deliver` are treated as `drop` - unless the `next_hop` is an IP address within the VPC's address prefix - ranges. Therefore, if an incoming packet matches a route with a `next_hop` - of an internet-bound IP address or a VPN gateway connection, the packet - will be dropped. + unless the `next_hop` is an IP address bound to a network interface on a + subnet in the route's `zone`. Therefore, if an incoming packet matches a + route with a `next_hop` of an internet-bound IP address or a VPN gateway + connection, the packet will be dropped. """ self.name = name self.route_direct_link_ingress = route_direct_link_ingress @@ -49377,8 +50416,6 @@ class SecurityGroup(): :attr str id: The unique identifier for this security group. :attr str name: The user-defined name for this security group. Names must be unique within the VPC the security group resides in. - :attr List[NetworkInterfaceReference] network_interfaces: The network interfaces - for this security group. :attr ResourceGroupReference resource_group: The resource group for this security group. :attr List[SecurityGroupRule] rules: The rules for this security group. If no @@ -49394,7 +50431,6 @@ def __init__(self, href: str, id: str, name: str, - network_interfaces: List['NetworkInterfaceReference'], resource_group: 'ResourceGroupReference', rules: List['SecurityGroupRule'], targets: List['SecurityGroupTargetReference'], @@ -49409,8 +50445,6 @@ def __init__(self, :param str id: The unique identifier for this security group. :param str name: The user-defined name for this security group. Names must be unique within the VPC the security group resides in. - :param List[NetworkInterfaceReference] network_interfaces: The network - interfaces for this security group. :param ResourceGroupReference resource_group: The resource group for this security group. :param List[SecurityGroupRule] rules: The rules for this security group. If @@ -49424,7 +50458,6 @@ def __init__(self, self.href = href self.id = id self.name = name - self.network_interfaces = network_interfaces self.resource_group = resource_group self.rules = rules self.targets = targets @@ -49454,10 +50487,6 @@ def from_dict(cls, _dict: Dict) -> 'SecurityGroup': args['name'] = _dict.get('name') else: raise ValueError('Required property \'name\' not present in SecurityGroup JSON') - if 'network_interfaces' in _dict: - args['network_interfaces'] = [NetworkInterfaceReference.from_dict(x) for x in _dict.get('network_interfaces')] - else: - raise ValueError('Required property \'network_interfaces\' not present in SecurityGroup JSON') if 'resource_group' in _dict: args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) else: @@ -49494,8 +50523,6 @@ 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, 'network_interfaces') and self.network_interfaces is not None: - _dict['network_interfaces'] = [x.to_dict() for x in self.network_interfaces] if hasattr(self, 'resource_group') and self.resource_group is not None: _dict['resource_group'] = self.resource_group.to_dict() if hasattr(self, 'rules') and self.rules is not None: @@ -50709,7 +51736,7 @@ class Snapshot(): If absent, this snapshot's data has not yet been captured. Additionally, this property may be absent for snapshots created before 1 January 2022. :attr datetime created_at: The date and time that this snapshot was created. - :attr str crn: The CRN for this snapshot. + :attr str crn: The CRN of this snapshot. :attr bool deletable: Indicates whether this snapshot can be deleted. This value will always be `true`. :attr str encryption: The type of encryption used on the source volume. @@ -50729,13 +51756,16 @@ class Snapshot(): :attr ResourceGroupReference resource_group: The resource group for this snapshot. :attr str resource_type: The resource type. + :attr List[str] service_tags: The service tags prefixed with `is.snapshot:` + associated with this snapshot. :attr int size: The size of this snapshot rounded up to the next gigabyte. :attr ImageReference source_image: (optional) If present, the image from which - the data on this volume was most directly + the data on this snapshot was most directly provisioned. :attr VolumeReference source_volume: The source volume this snapshot was created from (may be [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). + :attr List[str] user_tags: The user tags associated with this snapshot. """ def __init__(self, @@ -50751,8 +51781,10 @@ def __init__(self, name: str, resource_group: 'ResourceGroupReference', resource_type: str, + service_tags: List[str], size: int, source_volume: 'VolumeReference', + user_tags: List[str], *, captured_at: datetime = None, encryption_key: 'EncryptionKeyReference' = None, @@ -50765,7 +51797,7 @@ def __init__(self, with a volume created from this snapshot. :param datetime created_at: The date and time that this snapshot was created. - :param str crn: The CRN for this snapshot. + :param str crn: The CRN of this snapshot. :param bool deletable: Indicates whether this snapshot can be deleted. This value will always be `true`. :param str encryption: The type of encryption used on the source volume. @@ -50779,10 +51811,13 @@ def __init__(self, :param ResourceGroupReference resource_group: The resource group for this snapshot. :param str resource_type: The resource type. + :param List[str] service_tags: The service tags prefixed with + `is.snapshot:` associated with this snapshot. :param int size: The size of this snapshot rounded up to the next gigabyte. :param VolumeReference source_volume: The source volume this snapshot was created from (may be [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). + :param List[str] user_tags: The user tags associated with this snapshot. :param datetime captured_at: (optional) The date and time the data capture for this snapshot was completed. If absent, this snapshot's data has not yet been captured. Additionally, @@ -50794,7 +51829,7 @@ def __init__(self, :param OperatingSystem operating_system: (optional) The operating system included in this image. :param ImageReference source_image: (optional) If present, the image from - which the data on this volume was most directly + which the data on this snapshot was most directly provisioned. """ self.bootable = bootable @@ -50812,9 +51847,11 @@ def __init__(self, self.operating_system = operating_system self.resource_group = resource_group self.resource_type = resource_type + self.service_tags = service_tags self.size = size self.source_image = source_image self.source_volume = source_volume + self.user_tags = user_tags @classmethod def from_dict(cls, _dict: Dict) -> 'Snapshot': @@ -50874,6 +51911,10 @@ def from_dict(cls, _dict: Dict) -> 'Snapshot': args['resource_type'] = _dict.get('resource_type') else: raise ValueError('Required property \'resource_type\' not present in Snapshot JSON') + if 'service_tags' in _dict: + args['service_tags'] = _dict.get('service_tags') + else: + raise ValueError('Required property \'service_tags\' not present in Snapshot JSON') if 'size' in _dict: args['size'] = _dict.get('size') else: @@ -50884,6 +51925,10 @@ def from_dict(cls, _dict: Dict) -> 'Snapshot': args['source_volume'] = VolumeReference.from_dict(_dict.get('source_volume')) else: raise ValueError('Required property \'source_volume\' not present in Snapshot JSON') + if 'user_tags' in _dict: + args['user_tags'] = _dict.get('user_tags') + else: + raise ValueError('Required property \'user_tags\' not present in Snapshot JSON') return cls(**args) @classmethod @@ -50924,12 +51969,16 @@ def to_dict(self) -> 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, 'service_tags') and self.service_tags is not None: + _dict['service_tags'] = self.service_tags if hasattr(self, 'size') and self.size is not None: _dict['size'] = self.size if hasattr(self, 'source_image') and self.source_image is not None: _dict['source_image'] = self.source_image.to_dict() if hasattr(self, 'source_volume') and self.source_volume is not None: _dict['source_volume'] = self.source_volume.to_dict() + if hasattr(self, 'user_tags') and self.user_tags is not None: + _dict['user_tags'] = self.user_tags return _dict def _to_dict(self): @@ -51213,17 +52262,23 @@ class SnapshotPatch(): SnapshotPatch. :attr str name: (optional) The user-defined name for this snapshot. + :attr List[str] user_tags: (optional) The user tags associated with this + snapshot. """ def __init__(self, *, - name: str = None) -> None: + name: str = None, + user_tags: List[str] = None) -> None: """ Initialize a SnapshotPatch object. :param str name: (optional) The user-defined name for this snapshot. + :param List[str] user_tags: (optional) The user tags associated with this + snapshot. """ self.name = name + self.user_tags = user_tags @classmethod def from_dict(cls, _dict: Dict) -> 'SnapshotPatch': @@ -51231,6 +52286,8 @@ def from_dict(cls, _dict: Dict) -> 'SnapshotPatch': args = {} if 'name' in _dict: args['name'] = _dict.get('name') + if 'user_tags' in _dict: + args['user_tags'] = _dict.get('user_tags') return cls(**args) @classmethod @@ -51243,6 +52300,8 @@ def to_dict(self) -> Dict: _dict = {} if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name + if hasattr(self, 'user_tags') and self.user_tags is not None: + _dict['user_tags'] = self.user_tags return _dict def _to_dict(self): @@ -51263,11 +52322,46 @@ def __ne__(self, other: 'SnapshotPatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other +class SnapshotPrototype(): + """ + SnapshotPrototype. + + :attr str name: (optional) The unique user-defined name for this snapshot. If + unspecified, the name will be a hyphenated list of randomly-selected words. + :attr 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) is used. + :attr List[str] user_tags: (optional) The user tags associated with this + snapshot. + """ + + def __init__(self, + *, + name: str = None, + resource_group: 'ResourceGroupIdentity' = None, + user_tags: List[str] = None) -> None: + """ + Initialize a SnapshotPrototype object. + + :param str name: (optional) The unique user-defined name for this snapshot. + 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) is + used. + :param List[str] user_tags: (optional) The user tags associated with this + snapshot. + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['SnapshotPrototypeSnapshotBySourceVolume'])) + raise Exception(msg) + class SnapshotReference(): """ SnapshotReference. - :attr str crn: The CRN for this snapshot. + :attr str crn: The CRN of this snapshot. :attr SnapshotReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted and provides some supplementary information. @@ -51288,7 +52382,7 @@ def __init__(self, """ Initialize a SnapshotReference object. - :param str crn: The CRN for this snapshot. + :param str crn: The CRN of this snapshot. :param str href: The URL for this snapshot. :param str id: The unique identifier for this snapshot. :param str name: The user-defined name for this snapshot. @@ -51459,8 +52553,8 @@ class Subnet(): :attr str status: The status of the subnet. :attr int total_ipv4_address_count: The total number of IPv4 addresses in this subnet. - Note: This is calculated as 2(32 − prefix length). For example, the - prefix length `/24` gives:
2(32 − 24) = 28 = 256 + Note: This is calculated as 2(32 - prefix length). For example, the + prefix length `/24` gives:
2(32 - 24) = 28 = 256 addresses. :attr VPCReference vpc: The VPC this subnet is a part of. :attr ZoneReference zone: The zone this subnet resides in. @@ -51506,8 +52600,8 @@ def __init__(self, :param str status: The status of the subnet. :param int total_ipv4_address_count: The total number of IPv4 addresses in this subnet. - Note: This is calculated as 2(32 − prefix length). For example, - the prefix length `/24` gives:
2(32 − 24) = 28 = + Note: This is calculated as 2(32 - prefix length). For example, + the prefix length `/24` gives:
2(32 - 24) = 28 = 256 addresses. :param VPCReference vpc: The VPC this subnet is a part of. :param ZoneReference zone: The zone this subnet resides in. @@ -52244,6 +53338,104 @@ def __ne__(self, other: 'SubnetReferenceDeleted') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other +class TrustedProfileIdentity(): + """ + Identifies a trusted profile by a unique property. + + """ + + def __init__(self) -> None: + """ + Initialize a TrustedProfileIdentity object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['TrustedProfileIdentityTrustedProfileById', 'TrustedProfileIdentityTrustedProfileByCRN'])) + raise Exception(msg) + +class TrustedProfileReference(): + """ + TrustedProfileReference. + + :attr str crn: The CRN for this trusted profile. + :attr str id: The unique identifier for this trusted profile. + :attr str resource_type: The resource type. + """ + + def __init__(self, + crn: str, + id: str, + resource_type: str) -> None: + """ + Initialize a TrustedProfileReference object. + + :param str crn: The CRN for this trusted profile. + :param str id: The unique identifier for this trusted profile. + :param str resource_type: The resource type. + """ + self.crn = crn + self.id = id + self.resource_type = resource_type + + @classmethod + def from_dict(cls, _dict: Dict) -> 'TrustedProfileReference': + """Initialize a TrustedProfileReference object from a json dictionary.""" + args = {} + if 'crn' in _dict: + args['crn'] = _dict.get('crn') + else: + raise ValueError('Required property \'crn\' not present in TrustedProfileReference JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in TrustedProfileReference JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in TrustedProfileReference JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a TrustedProfileReference object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, '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 TrustedProfileReference object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'TrustedProfileReference') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'TrustedProfileReference') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + TRUSTED_PROFILE = 'trusted_profile' + + class VCPU(): """ The VCPU configuration. @@ -54249,9 +55441,8 @@ class VPNGatewayMember(): VPNGatewayMember. :attr IP private_ip: (optional) The private IP address assigned to the VPN - gateway member. This - property will be present only when the VPN gateway status is - `available`. + gateway member. + This property will be present only when the VPN gateway status is `available`. :attr IP public_ip: The public IP address assigned to the VPN gateway member. :attr str role: The high availability role assigned to the VPN gateway member. :attr str status: The status of the VPN gateway member. @@ -54272,8 +55463,8 @@ def __init__(self, member. :param str status: The status of the VPN gateway member. :param IP private_ip: (optional) The private IP address assigned to the VPN - gateway member. This - property will be present only when the VPN gateway status is + gateway member. + This property will be present only when the VPN gateway status is `available`. """ self.private_ip = private_ip @@ -54440,6 +55631,63 @@ def __init__(self, ", ".join(['VPNGatewayPrototypeVPNGatewayRouteModePrototype', 'VPNGatewayPrototypeVPNGatewayPolicyModePrototype'])) raise Exception(msg) +class VPNGatewayReferenceDeleted(): + """ + If present, this property indicates the referenced resource has been deleted and + provides some supplementary information. + + :attr str more_info: Link to documentation about deleted resources. + """ + + def __init__(self, + more_info: str) -> None: + """ + Initialize a VPNGatewayReferenceDeleted object. + + :param str more_info: Link to documentation about deleted resources. + """ + self.more_info = more_info + + @classmethod + def from_dict(cls, _dict: Dict) -> 'VPNGatewayReferenceDeleted': + """Initialize a VPNGatewayReferenceDeleted object from a json dictionary.""" + args = {} + if 'more_info' in _dict: + args['more_info'] = _dict.get('more_info') + else: + raise ValueError('Required property \'more_info\' not present in VPNGatewayReferenceDeleted JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a VPNGatewayReferenceDeleted object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + 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 VPNGatewayReferenceDeleted object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'VPNGatewayReferenceDeleted') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'VPNGatewayReferenceDeleted') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + class Volume(): """ Volume. @@ -54488,6 +55736,7 @@ class Volume(): When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected reason code was encountered. + :attr List[str] user_tags: Tags for this resource. :attr List[VolumeAttachmentReferenceVolumeContext] volume_attachments: The volume attachments for this volume. :attr ZoneReference zone: The zone this volume resides in. @@ -54509,6 +55758,7 @@ def __init__(self, resource_group: 'ResourceGroupReference', status: str, status_reasons: List['VolumeStatusReason'], + user_tags: List[str], volume_attachments: List['VolumeAttachmentReferenceVolumeContext'], zone: 'ZoneReference', *, @@ -54552,6 +55802,7 @@ def __init__(self, future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected reason code was encountered. + :param List[str] user_tags: Tags for this resource. :param List[VolumeAttachmentReferenceVolumeContext] volume_attachments: The volume attachments for this volume. :param ZoneReference zone: The zone this volume resides in. @@ -54588,6 +55839,7 @@ def __init__(self, self.source_snapshot = source_snapshot self.status = status self.status_reasons = status_reasons + self.user_tags = user_tags self.volume_attachments = volume_attachments self.zone = zone @@ -54663,6 +55915,10 @@ def from_dict(cls, _dict: Dict) -> 'Volume': args['status_reasons'] = [VolumeStatusReason.from_dict(x) for x in _dict.get('status_reasons')] else: raise ValueError('Required property \'status_reasons\' not present in Volume JSON') + if 'user_tags' in _dict: + args['user_tags'] = _dict.get('user_tags') + else: + raise ValueError('Required property \'user_tags\' not present in Volume JSON') if 'volume_attachments' in _dict: args['volume_attachments'] = [VolumeAttachmentReferenceVolumeContext.from_dict(x) for x in _dict.get('volume_attachments')] else: @@ -54719,6 +55975,8 @@ def to_dict(self) -> Dict: _dict['status'] = self.status if hasattr(self, 'status_reasons') and self.status_reasons is not None: _dict['status_reasons'] = [x.to_dict() for x in self.status_reasons] + if hasattr(self, 'user_tags') and self.user_tags is not None: + _dict['user_tags'] = self.user_tags if hasattr(self, 'volume_attachments') and self.volume_attachments is not None: _dict['volume_attachments'] = [x.to_dict() for x in self.volume_attachments] if hasattr(self, 'zone') and self.zone is not None: @@ -55204,29 +56462,108 @@ def __ne__(self, other: 'VolumeAttachmentPrototypeInstanceByImageContext') -> bo """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class VolumeAttachmentPrototypeInstanceByVolumeContext(): +class VolumeAttachmentPrototypeInstanceBySourceSnapshotContext(): """ - VolumeAttachmentPrototypeInstanceByVolumeContext. + VolumeAttachmentPrototypeInstanceBySourceSnapshotContext. :attr bool delete_volume_on_instance_delete: (optional) If set to true, when deleting the instance the volume will also be deleted. :attr str name: (optional) The user-defined name for this volume attachment. Names must be unique within the instance the volume attachment resides in. - :attr VolumeAttachmentVolumePrototypeInstanceByVolumeContext volume: An existing - volume to attach to the instance, or a prototype object for a new volume. + :attr VolumePrototypeInstanceBySourceSnapshotContext volume: A prototype object + for a new volume from a snapshot. """ def __init__(self, - volume: 'VolumeAttachmentVolumePrototypeInstanceByVolumeContext', + volume: 'VolumePrototypeInstanceBySourceSnapshotContext', *, delete_volume_on_instance_delete: bool = None, name: str = None) -> None: """ - Initialize a VolumeAttachmentPrototypeInstanceByVolumeContext object. + Initialize a VolumeAttachmentPrototypeInstanceBySourceSnapshotContext object. - :param VolumeAttachmentVolumePrototypeInstanceByVolumeContext volume: An - existing volume to attach to the instance, or a prototype object for a new - volume. + :param VolumePrototypeInstanceBySourceSnapshotContext volume: A prototype + object for a new volume from a snapshot. + :param bool delete_volume_on_instance_delete: (optional) If set to true, + when deleting the instance the volume will also be deleted. + :param str name: (optional) The user-defined name for this volume + attachment. Names must be unique within the instance the volume attachment + resides in. + """ + self.delete_volume_on_instance_delete = delete_volume_on_instance_delete + self.name = name + self.volume = volume + + @classmethod + def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentPrototypeInstanceBySourceSnapshotContext': + """Initialize a VolumeAttachmentPrototypeInstanceBySourceSnapshotContext object from a json dictionary.""" + args = {} + if 'delete_volume_on_instance_delete' in _dict: + args['delete_volume_on_instance_delete'] = _dict.get('delete_volume_on_instance_delete') + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'volume' in _dict: + args['volume'] = VolumePrototypeInstanceBySourceSnapshotContext.from_dict(_dict.get('volume')) + else: + raise ValueError('Required property \'volume\' not present in VolumeAttachmentPrototypeInstanceBySourceSnapshotContext JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a VolumeAttachmentPrototypeInstanceBySourceSnapshotContext object from 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_volume_on_instance_delete') and self.delete_volume_on_instance_delete is not None: + _dict['delete_volume_on_instance_delete'] = self.delete_volume_on_instance_delete + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'volume') and self.volume is not None: + _dict['volume'] = self.volume.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 VolumeAttachmentPrototypeInstanceBySourceSnapshotContext object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'VolumeAttachmentPrototypeInstanceBySourceSnapshotContext') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'VolumeAttachmentPrototypeInstanceBySourceSnapshotContext') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + +class VolumeAttachmentPrototypeInstanceContext(): + """ + VolumeAttachmentPrototypeInstanceContext. + + :attr bool delete_volume_on_instance_delete: (optional) If set to true, when + deleting the instance the volume will also be deleted. + :attr str name: (optional) The user-defined name for this volume attachment. + Names must be unique within the instance the volume attachment resides in. + :attr VolumeAttachmentVolumePrototypeInstanceContext volume: An existing volume + to attach to the instance, or a prototype object for a new volume. + """ + + def __init__(self, + volume: 'VolumeAttachmentVolumePrototypeInstanceContext', + *, + delete_volume_on_instance_delete: bool = None, + name: str = None) -> None: + """ + Initialize a VolumeAttachmentPrototypeInstanceContext object. + + :param VolumeAttachmentVolumePrototypeInstanceContext volume: An existing + volume to attach to the instance, or a prototype object for a new volume. :param bool delete_volume_on_instance_delete: (optional) If set to true, when deleting the instance the volume will also be deleted. :param str name: (optional) The user-defined name for this volume @@ -55238,8 +56575,8 @@ def __init__(self, self.volume = volume @classmethod - def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentPrototypeInstanceByVolumeContext': - """Initialize a VolumeAttachmentPrototypeInstanceByVolumeContext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentPrototypeInstanceContext': + """Initialize a VolumeAttachmentPrototypeInstanceContext object from a json dictionary.""" args = {} if 'delete_volume_on_instance_delete' in _dict: args['delete_volume_on_instance_delete'] = _dict.get('delete_volume_on_instance_delete') @@ -55248,95 +56585,12 @@ def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentPrototypeInstanceByVolumeCon if 'volume' in _dict: args['volume'] = _dict.get('volume') else: - raise ValueError('Required property \'volume\' not present in VolumeAttachmentPrototypeInstanceByVolumeContext JSON') + raise ValueError('Required property \'volume\' not present in VolumeAttachmentPrototypeInstanceContext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VolumeAttachmentPrototypeInstanceByVolumeContext object from 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_volume_on_instance_delete') and self.delete_volume_on_instance_delete is not None: - _dict['delete_volume_on_instance_delete'] = self.delete_volume_on_instance_delete - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'volume') and self.volume is not None: - if isinstance(self.volume, dict): - _dict['volume'] = self.volume - else: - _dict['volume'] = self.volume.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 VolumeAttachmentPrototypeInstanceByVolumeContext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'VolumeAttachmentPrototypeInstanceByVolumeContext') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - - def __ne__(self, other: 'VolumeAttachmentPrototypeInstanceByVolumeContext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - -class VolumeAttachmentPrototypeInstanceContext(): - """ - VolumeAttachmentPrototypeInstanceContext. - - :attr bool delete_volume_on_instance_delete: (optional) If set to true, when - deleting the instance the volume will also be deleted. - :attr str name: (optional) The user-defined name for this volume attachment. - Names must be unique within the instance the volume attachment resides in. - :attr VolumeAttachmentVolumePrototypeInstanceContext volume: An existing volume - to attach to the instance, or a prototype object for a new volume. - """ - - def __init__(self, - volume: 'VolumeAttachmentVolumePrototypeInstanceContext', - *, - delete_volume_on_instance_delete: bool = None, - name: str = None) -> None: - """ - Initialize a VolumeAttachmentPrototypeInstanceContext object. - - :param VolumeAttachmentVolumePrototypeInstanceContext volume: An existing - volume to attach to the instance, or a prototype object for a new volume. - :param bool delete_volume_on_instance_delete: (optional) If set to true, - when deleting the instance the volume will also be deleted. - :param str name: (optional) The user-defined name for this volume - attachment. Names must be unique within the instance the volume attachment - resides in. - """ - self.delete_volume_on_instance_delete = delete_volume_on_instance_delete - self.name = name - self.volume = volume - - @classmethod - def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentPrototypeInstanceContext': - """Initialize a VolumeAttachmentPrototypeInstanceContext object from a json dictionary.""" - args = {} - if 'delete_volume_on_instance_delete' in _dict: - args['delete_volume_on_instance_delete'] = _dict.get('delete_volume_on_instance_delete') - if 'name' in _dict: - args['name'] = _dict.get('name') - if 'volume' in _dict: - args['volume'] = _dict.get('volume') - else: - raise ValueError('Required property \'volume\' not present in VolumeAttachmentPrototypeInstanceContext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a VolumeAttachmentPrototypeInstanceContext object from a json dictionary.""" + """Initialize a VolumeAttachmentPrototypeInstanceContext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -55760,21 +57014,6 @@ def __ne__(self, other: 'VolumeAttachmentReferenceVolumeContextDeleted') -> bool """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class VolumeAttachmentVolumePrototypeInstanceByVolumeContext(): - """ - An existing volume to attach to the instance, or a prototype object for a new volume. - - """ - - def __init__(self) -> None: - """ - Initialize a VolumeAttachmentVolumePrototypeInstanceByVolumeContext object. - - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['VolumeAttachmentVolumePrototypeInstanceByVolumeContextVolumePrototypeInstanceByVolumeContext'])) - raise Exception(msg) - class VolumeAttachmentVolumePrototypeInstanceContext(): """ An existing volume to attach to the instance, or a prototype object for a new volume. @@ -56014,9 +57253,10 @@ class VolumePatch(): VolumePatch. :attr int capacity: (optional) The capacity to use for the volume (in - gigabytes). The volume must be attached as a data volume to a running virtual - server instance, and the specified value must not be less than the current - capacity. + gigabytes). The volume must be attached to a running virtual server instance, + and the specified value must not be less than the current capacity. + Additionally, if the volume is attached as a boot volume, the maximum value is + 250 gigabytes. The minimum and maximum capacity limits for creating or updating volumes may expand in the future. :attr int iops: (optional) The maximum I/O operations per second (IOPS) to use @@ -56025,10 +57265,12 @@ class VolumePatch(): instance. :attr str name: (optional) The unique user-defined name for this volume. :attr VolumeProfileIdentity profile: (optional) The profile to use for this - volume. The requested profile must be in the same - `family` as the current profile. The volume must be attached as a data volume - to a - running virtual server instance. + volume. The requested profile must be in the same + `family` as the current profile. The volume must be attached as a data volume to + a + running virtual server instance, and must have a `capacity` within the range + supported by the specified profile. + :attr List[str] user_tags: (optional) Tags for this resource. """ def __init__(self, @@ -56036,14 +57278,16 @@ def __init__(self, capacity: int = None, iops: int = None, name: str = None, - profile: 'VolumeProfileIdentity' = None) -> None: + profile: 'VolumeProfileIdentity' = None, + user_tags: List[str] = None) -> None: """ Initialize a VolumePatch object. :param int capacity: (optional) The capacity to use for the volume (in - gigabytes). The volume must be attached as a data volume to a running - virtual server instance, and the specified value must not be less than the - current capacity. + gigabytes). The volume must be attached to a running virtual server + instance, and the specified value must not be less than the current + capacity. Additionally, if the volume is attached as a boot volume, the + maximum value is 250 gigabytes. The minimum and maximum capacity limits for creating or updating volumes may expand in the future. :param int iops: (optional) The maximum I/O operations per second (IOPS) to @@ -56052,15 +57296,19 @@ def __init__(self, server instance. :param str name: (optional) The unique user-defined name for this volume. :param VolumeProfileIdentity profile: (optional) The profile to use for - this volume. The requested profile must be in the same - `family` as the current profile. The volume must be attached as a data + this volume. The requested profile must be in the same + `family` as the current profile. The volume must be attached as a data volume to a - running virtual server instance. + running virtual server instance, and must have a `capacity` within the + range + supported by the specified profile. + :param List[str] user_tags: (optional) Tags for this resource. """ self.capacity = capacity self.iops = iops self.name = name self.profile = profile + self.user_tags = user_tags @classmethod def from_dict(cls, _dict: Dict) -> 'VolumePatch': @@ -56074,6 +57322,8 @@ def from_dict(cls, _dict: Dict) -> 'VolumePatch': args['name'] = _dict.get('name') if 'profile' in _dict: args['profile'] = _dict.get('profile') + if 'user_tags' in _dict: + args['user_tags'] = _dict.get('user_tags') return cls(**args) @classmethod @@ -56095,6 +57345,8 @@ def to_dict(self) -> Dict: _dict['profile'] = self.profile else: _dict['profile'] = self.profile.to_dict() + if hasattr(self, 'user_tags') and self.user_tags is not None: + _dict['user_tags'] = self.user_tags return _dict def _to_dict(self): @@ -56518,6 +57770,7 @@ class VolumePrototype(): :attr 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) is used. + :attr List[str] user_tags: (optional) Tags for this resource. :attr ZoneIdentity zone: The zone this volume will reside in. """ @@ -56527,7 +57780,8 @@ def __init__(self, *, iops: int = None, name: str = None, - resource_group: 'ResourceGroupIdentity' = None) -> None: + resource_group: 'ResourceGroupIdentity' = None, + user_tags: List[str] = None) -> None: """ Initialize a VolumePrototype object. @@ -56541,6 +57795,7 @@ def __init__(self, to use. If unspecified, the account's [default resource group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + :param List[str] user_tags: (optional) Tags for this resource. """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( ", ".join(['VolumePrototypeVolumeByCapacity'])) @@ -56551,8 +57806,8 @@ class VolumePrototypeInstanceByImageContext(): VolumePrototypeInstanceByImageContext. :attr int capacity: (optional) The capacity to use for the volume (in - gigabytes). The only allowed value is the image's `minimum_provisioned_size`, - but the allowed values are expected to expand in the future. + gigabytes). Must be at least the image's + `minimum_provisioned_size`. The maximum value may increase in the future. If unspecified, the capacity will be the image's `minimum_provisioned_size`. :attr EncryptionKeyIdentity encryption_key: (optional) The root key to use to wrap the data encryption key for the volume. @@ -56577,9 +57832,8 @@ def __init__(self, :param VolumeProfileIdentity profile: The profile to use for this volume. :param int capacity: (optional) The capacity to use for the volume (in - gigabytes). The only allowed value is the image's - `minimum_provisioned_size`, but the allowed values are expected to expand - in the future. + gigabytes). Must be at least the image's + `minimum_provisioned_size`. The maximum value may increase in the future. If unspecified, the capacity will be the image's `minimum_provisioned_size`. :param EncryptionKeyIdentity encryption_key: (optional) The root key to use @@ -56661,6 +57915,130 @@ def __ne__(self, other: 'VolumePrototypeInstanceByImageContext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other +class VolumePrototypeInstanceBySourceSnapshotContext(): + """ + VolumePrototypeInstanceBySourceSnapshotContext. + + :attr int capacity: (optional) The capacity to use for the volume (in + gigabytes). Must be at least the snapshot's + `minimum_capacity`. The maximum value may increase in the future. + If unspecified, the capacity will be the source snapshot's `minimum_capacity`. + :attr EncryptionKeyIdentity encryption_key: (optional) The root key to use to + wrap the data encryption key for the volume. + If unspecified, the snapshot's `encryption_key` will be used. + :attr int iops: (optional) The maximum I/O operations per second (IOPS) to use + for the volume. Applicable only to volumes using a profile `family` of `custom`. + :attr str name: (optional) The unique user-defined name for this volume. + :attr VolumeProfileIdentity profile: The profile to use for this volume. + :attr SnapshotIdentity source_snapshot: The snapshot from which to clone the + volume. + """ + + def __init__(self, + profile: 'VolumeProfileIdentity', + source_snapshot: 'SnapshotIdentity', + *, + capacity: int = None, + encryption_key: 'EncryptionKeyIdentity' = None, + iops: int = None, + name: str = None) -> None: + """ + Initialize a VolumePrototypeInstanceBySourceSnapshotContext object. + + :param VolumeProfileIdentity profile: The profile to use for this volume. + :param SnapshotIdentity source_snapshot: The snapshot from which to clone + the volume. + :param int capacity: (optional) The capacity to use for the volume (in + gigabytes). Must be at least the snapshot's + `minimum_capacity`. The maximum value may increase in the future. + If unspecified, the capacity will be the source snapshot's + `minimum_capacity`. + :param EncryptionKeyIdentity encryption_key: (optional) The root key to use + to wrap the data encryption key for the volume. + If unspecified, the snapshot's `encryption_key` will be used. + :param int iops: (optional) The maximum I/O operations per second (IOPS) to + use for the volume. Applicable only to volumes using a profile `family` of + `custom`. + :param str name: (optional) The unique user-defined name for this volume. + """ + self.capacity = capacity + self.encryption_key = encryption_key + self.iops = iops + self.name = name + self.profile = profile + self.source_snapshot = source_snapshot + + @classmethod + def from_dict(cls, _dict: Dict) -> 'VolumePrototypeInstanceBySourceSnapshotContext': + """Initialize a VolumePrototypeInstanceBySourceSnapshotContext object from a json dictionary.""" + args = {} + if 'capacity' in _dict: + args['capacity'] = _dict.get('capacity') + if 'encryption_key' in _dict: + args['encryption_key'] = _dict.get('encryption_key') + if 'iops' in _dict: + args['iops'] = _dict.get('iops') + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'profile' in _dict: + args['profile'] = _dict.get('profile') + else: + raise ValueError('Required property \'profile\' not present in VolumePrototypeInstanceBySourceSnapshotContext JSON') + if 'source_snapshot' in _dict: + args['source_snapshot'] = _dict.get('source_snapshot') + else: + raise ValueError('Required property \'source_snapshot\' not present in VolumePrototypeInstanceBySourceSnapshotContext JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a VolumePrototypeInstanceBySourceSnapshotContext object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'capacity') and self.capacity is not None: + _dict['capacity'] = self.capacity + 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, 'iops') and self.iops is not None: + _dict['iops'] = self.iops + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + 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, 'source_snapshot') and self.source_snapshot is not None: + if isinstance(self.source_snapshot, dict): + _dict['source_snapshot'] = self.source_snapshot + else: + _dict['source_snapshot'] = self.source_snapshot.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 VolumePrototypeInstanceBySourceSnapshotContext object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'VolumePrototypeInstanceBySourceSnapshotContext') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'VolumePrototypeInstanceBySourceSnapshotContext') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + class VolumeReference(): """ VolumeReference. @@ -57380,8 +58758,7 @@ class BareMetalServerNetworkInterfaceByPCI(BareMetalServerNetworkInterface): is not known. :attr str name: The user-defined name for this network interface. :attr int port_speed: The network interface port speed in Mbps. - :attr str primary_ipv4_address: The primary IPv4 address. - If the address has not yet been selected, the value will be `0.0.0.0`. + :attr ReservedIPReference primary_ip: :attr str resource_type: The resource type. :attr List[SecurityGroupReference] security_groups: The security groups targeting this network interface. @@ -57403,7 +58780,7 @@ def __init__(self, mac_address: str, name: str, port_speed: int, - primary_ipv4_address: str, + primary_ip: 'ReservedIPReference', resource_type: str, security_groups: List['SecurityGroupReference'], status: str, @@ -57449,8 +58826,7 @@ def __init__(self, value is not known. :param str name: The user-defined name for this network interface. :param int port_speed: The network interface port speed in Mbps. - :param str primary_ipv4_address: The primary IPv4 address. - If the address has not yet been selected, the value will be `0.0.0.0`. + :param ReservedIPReference primary_ip: :param str resource_type: The resource type. :param List[SecurityGroupReference] security_groups: The security groups targeting this network interface. @@ -57475,7 +58851,7 @@ def __init__(self, self.mac_address = mac_address self.name = name self.port_speed = port_speed - self.primary_ipv4_address = primary_ipv4_address + self.primary_ip = primary_ip self.resource_type = resource_type self.security_groups = security_groups self.status = status @@ -57525,10 +58901,10 @@ def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfaceByPCI': args['port_speed'] = _dict.get('port_speed') else: raise ValueError('Required property \'port_speed\' not present in BareMetalServerNetworkInterfaceByPCI JSON') - if 'primary_ipv4_address' in _dict: - args['primary_ipv4_address'] = _dict.get('primary_ipv4_address') + if 'primary_ip' in _dict: + args['primary_ip'] = ReservedIPReference.from_dict(_dict.get('primary_ip')) else: - raise ValueError('Required property \'primary_ipv4_address\' not present in BareMetalServerNetworkInterfaceByPCI JSON') + raise ValueError('Required property \'primary_ip\' not present in BareMetalServerNetworkInterfaceByPCI JSON') if 'resource_type' in _dict: args['resource_type'] = _dict.get('resource_type') else: @@ -57583,8 +58959,8 @@ def to_dict(self) -> Dict: _dict['name'] = self.name if hasattr(self, 'port_speed') and self.port_speed is not None: _dict['port_speed'] = self.port_speed - if hasattr(self, 'primary_ipv4_address') and self.primary_ipv4_address is not None: - _dict['primary_ipv4_address'] = self.primary_ipv4_address + if hasattr(self, 'primary_ip') and self.primary_ip is not None: + _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, 'security_groups') and self.security_groups is not None: @@ -57704,8 +59080,7 @@ class BareMetalServerNetworkInterfaceByVLAN(BareMetalServerNetworkInterface): is not known. :attr str name: The user-defined name for this network interface. :attr int port_speed: The network interface port speed in Mbps. - :attr str primary_ipv4_address: The primary IPv4 address. - If the address has not yet been selected, the value will be `0.0.0.0`. + :attr ReservedIPReference primary_ip: :attr str resource_type: The resource type. :attr List[SecurityGroupReference] security_groups: The security groups targeting this network interface. @@ -57731,7 +59106,7 @@ def __init__(self, mac_address: str, name: str, port_speed: int, - primary_ipv4_address: str, + primary_ip: 'ReservedIPReference', resource_type: str, security_groups: List['SecurityGroupReference'], status: str, @@ -57778,8 +59153,7 @@ def __init__(self, value is not known. :param str name: The user-defined name for this network interface. :param int port_speed: The network interface port speed in Mbps. - :param str primary_ipv4_address: The primary IPv4 address. - If the address has not yet been selected, the value will be `0.0.0.0`. + :param ReservedIPReference primary_ip: :param str resource_type: The resource type. :param List[SecurityGroupReference] security_groups: The security groups targeting this network interface. @@ -57807,7 +59181,7 @@ def __init__(self, self.mac_address = mac_address self.name = name self.port_speed = port_speed - self.primary_ipv4_address = primary_ipv4_address + self.primary_ip = primary_ip self.resource_type = resource_type self.security_groups = security_groups self.status = status @@ -57858,10 +59232,10 @@ def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfaceByVLAN': args['port_speed'] = _dict.get('port_speed') else: raise ValueError('Required property \'port_speed\' not present in BareMetalServerNetworkInterfaceByVLAN JSON') - if 'primary_ipv4_address' in _dict: - args['primary_ipv4_address'] = _dict.get('primary_ipv4_address') + if 'primary_ip' in _dict: + args['primary_ip'] = ReservedIPReference.from_dict(_dict.get('primary_ip')) else: - raise ValueError('Required property \'primary_ipv4_address\' not present in BareMetalServerNetworkInterfaceByVLAN JSON') + raise ValueError('Required property \'primary_ip\' not present in BareMetalServerNetworkInterfaceByVLAN JSON') if 'resource_type' in _dict: args['resource_type'] = _dict.get('resource_type') else: @@ -57920,8 +59294,8 @@ def to_dict(self) -> Dict: _dict['name'] = self.name if hasattr(self, 'port_speed') and self.port_speed is not None: _dict['port_speed'] = self.port_speed - if hasattr(self, 'primary_ipv4_address') and self.primary_ipv4_address is not None: - _dict['primary_ipv4_address'] = self.primary_ipv4_address + if hasattr(self, 'primary_ip') and self.primary_ip is not None: + _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, 'security_groups') and self.security_groups is not None: @@ -58036,9 +59410,12 @@ class BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByP :attr str name: (optional) The user-defined name for network interface. Names must be unique within the instance the network interface resides in. If unspecified, the name will be a hyphenated list of randomly-selected words. - :attr str primary_ipv4_address: (optional) The primary IPv4 address. If - specified, it must be an available address on the network interface's subnet. If - unspecified, an available address on the subnet will be automatically selected. + :attr NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP address + to bind to the 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 network interface's subnet. Otherwise, an available + address on the subnet will be automatically selected and reserved. :attr List[SecurityGroupIdentity] security_groups: (optional) The security groups to use for this network interface. If unspecified, the VPC's default security group is used. @@ -58055,7 +59432,7 @@ def __init__(self, allow_ip_spoofing: bool = None, enable_infrastructure_nat: bool = None, name: str = None, - primary_ipv4_address: str = None, + primary_ip: 'NetworkInterfaceIPPrototype' = None, security_groups: List['SecurityGroupIdentity'] = None, allowed_vlans: List[int] = None) -> None: """ @@ -58093,10 +59470,13 @@ def __init__(self, Names must be unique within the instance the network interface resides in. If unspecified, the name will be a hyphenated list of randomly-selected words. - :param str primary_ipv4_address: (optional) The primary IPv4 address. If - specified, it must be an available address on the network interface's - subnet. If unspecified, an available address on the subnet will be - automatically selected. + :param NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP + address to bind to the 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 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 network interface. If unspecified, the VPC's default security group is used. @@ -58110,7 +59490,7 @@ def __init__(self, self.enable_infrastructure_nat = enable_infrastructure_nat self.interface_type = interface_type self.name = name - self.primary_ipv4_address = primary_ipv4_address + self.primary_ip = primary_ip self.security_groups = security_groups self.subnet = subnet self.allowed_vlans = allowed_vlans @@ -58129,8 +59509,8 @@ def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfacePrototypeBare raise ValueError('Required property \'interface_type\' not present in BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype JSON') if 'name' in _dict: args['name'] = _dict.get('name') - if 'primary_ipv4_address' in _dict: - args['primary_ipv4_address'] = _dict.get('primary_ipv4_address') + if 'primary_ip' in _dict: + args['primary_ip'] = _dict.get('primary_ip') if 'security_groups' in _dict: args['security_groups'] = _dict.get('security_groups') if 'subnet' in _dict: @@ -58157,8 +59537,11 @@ def to_dict(self) -> Dict: _dict['interface_type'] = self.interface_type if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'primary_ipv4_address') and self.primary_ipv4_address is not None: - _dict['primary_ipv4_address'] = self.primary_ipv4_address + 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 x in self.security_groups: @@ -58249,9 +59632,12 @@ class BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByV :attr str name: (optional) The user-defined name for network interface. Names must be unique within the instance the network interface resides in. If unspecified, the name will be a hyphenated list of randomly-selected words. - :attr str primary_ipv4_address: (optional) The primary IPv4 address. If - specified, it must be an available address on the network interface's subnet. If - unspecified, an available address on the subnet will be automatically selected. + :attr NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP address + to bind to the 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 network interface's subnet. Otherwise, an available + address on the subnet will be automatically selected and reserved. :attr List[SecurityGroupIdentity] security_groups: (optional) The security groups to use for this network interface. If unspecified, the VPC's default security group is used. @@ -58273,7 +59659,7 @@ def __init__(self, allow_ip_spoofing: bool = None, enable_infrastructure_nat: bool = None, name: str = None, - primary_ipv4_address: str = None, + primary_ip: 'NetworkInterfaceIPPrototype' = None, security_groups: List['SecurityGroupIdentity'] = None, allow_interface_to_float: bool = None) -> None: """ @@ -58313,10 +59699,13 @@ def __init__(self, Names must be unique within the instance the network interface resides in. If unspecified, the name will be a hyphenated list of randomly-selected words. - :param str primary_ipv4_address: (optional) The primary IPv4 address. If - specified, it must be an available address on the network interface's - subnet. If unspecified, an available address on the subnet will be - automatically selected. + :param NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP + address to bind to the 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 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 network interface. If unspecified, the VPC's default security group is used. @@ -58331,7 +59720,7 @@ def __init__(self, self.enable_infrastructure_nat = enable_infrastructure_nat self.interface_type = interface_type self.name = name - self.primary_ipv4_address = primary_ipv4_address + self.primary_ip = primary_ip self.security_groups = security_groups self.subnet = subnet self.allow_interface_to_float = allow_interface_to_float @@ -58351,8 +59740,8 @@ def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfacePrototypeBare raise ValueError('Required property \'interface_type\' not present in BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype JSON') if 'name' in _dict: args['name'] = _dict.get('name') - if 'primary_ipv4_address' in _dict: - args['primary_ipv4_address'] = _dict.get('primary_ipv4_address') + if 'primary_ip' in _dict: + args['primary_ip'] = _dict.get('primary_ip') if 'security_groups' in _dict: args['security_groups'] = _dict.get('security_groups') if 'subnet' in _dict: @@ -58383,8 +59772,11 @@ def to_dict(self) -> Dict: _dict['interface_type'] = self.interface_type if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'primary_ipv4_address') and self.primary_ipv4_address is not None: - _dict['primary_ipv4_address'] = self.primary_ipv4_address + 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 x in self.security_groups: @@ -60586,63 +61978,6 @@ def __ne__(self, other: 'CertificateInstanceIdentityByCRN') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class CloudObjectStorageBucketIdentityByName(CloudObjectStorageBucketIdentity): - """ - CloudObjectStorageBucketIdentityByName. - - :attr str name: The globally unique name of this COS bucket. - """ - - def __init__(self, - name: str) -> None: - """ - Initialize a CloudObjectStorageBucketIdentityByName object. - - :param str name: The globally unique name of this COS bucket. - """ - # pylint: disable=super-init-not-called - self.name = name - - @classmethod - def from_dict(cls, _dict: Dict) -> 'CloudObjectStorageBucketIdentityByName': - """Initialize a CloudObjectStorageBucketIdentityByName object from a json dictionary.""" - args = {} - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in CloudObjectStorageBucketIdentityByName JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a CloudObjectStorageBucketIdentityByName object from 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 CloudObjectStorageBucketIdentityByName object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'CloudObjectStorageBucketIdentityByName') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - - def __ne__(self, other: 'CloudObjectStorageBucketIdentityByName') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - class DedicatedHostGroupIdentityByCRN(DedicatedHostGroupIdentity): """ DedicatedHostGroupIdentityByCRN. @@ -62219,6 +63554,10 @@ class EndpointGatewayReservedIPReservedIPPrototypeTargetContext(EndpointGatewayR """ EndpointGatewayReservedIPReservedIPPrototypeTargetContext. + :attr 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. :attr bool auto_delete: (optional) Indicates whether this reserved IP member will be automatically deleted when either `target` is deleted, or the reserved IP is unbound. @@ -62232,6 +63571,7 @@ class EndpointGatewayReservedIPReservedIPPrototypeTargetContext(EndpointGatewayR def __init__(self, subnet: 'SubnetIdentity', *, + address: str = None, auto_delete: bool = None, name: str = None) -> None: """ @@ -62239,6 +63579,10 @@ def __init__(self, :param SubnetIdentity subnet: The subnet in which to create this reserved IP. + :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 reserved IP member will be automatically deleted when either `target` is deleted, or the reserved IP is unbound. @@ -62248,6 +63592,7 @@ def __init__(self, beginning with `ibm-` are reserved for provider-owned resources. """ # pylint: disable=super-init-not-called + self.address = address self.auto_delete = auto_delete self.name = name self.subnet = subnet @@ -62256,6 +63601,8 @@ def __init__(self, def from_dict(cls, _dict: Dict) -> 'EndpointGatewayReservedIPReservedIPPrototypeTargetContext': """Initialize a EndpointGatewayReservedIPReservedIPPrototypeTargetContext object from a json dictionary.""" args = {} + if 'address' in _dict: + args['address'] = _dict.get('address') if 'auto_delete' in _dict: args['auto_delete'] = _dict.get('auto_delete') if 'name' in _dict: @@ -62274,6 +63621,8 @@ def _from_dict(cls, _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: @@ -62915,8 +64264,7 @@ class FloatingIPTargetNetworkInterfaceReference(FloatingIPTarget): :attr str href: The URL for this network interface. :attr str id: The unique identifier for this network interface. :attr str name: The user-defined name for this network interface. - :attr str primary_ipv4_address: The primary IPv4 address. - If the address has not yet been selected, the value will be `0.0.0.0`. + :attr ReservedIPReference primary_ip: :attr str resource_type: The resource type. """ @@ -62924,7 +64272,7 @@ def __init__(self, href: str, id: str, name: str, - primary_ipv4_address: str, + primary_ip: 'ReservedIPReference', resource_type: str, *, deleted: 'NetworkInterfaceReferenceDeleted' = None) -> None: @@ -62934,8 +64282,7 @@ def __init__(self, :param str href: The URL for this network interface. :param str id: The unique identifier for this network interface. :param str name: The user-defined name for this network interface. - :param str primary_ipv4_address: The primary IPv4 address. - If the address has not yet been selected, the value will be `0.0.0.0`. + :param ReservedIPReference primary_ip: :param str resource_type: The resource type. :param NetworkInterfaceReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted and @@ -62947,7 +64294,7 @@ def __init__(self, self.href = href self.id = id self.name = name - self.primary_ipv4_address = primary_ipv4_address + self.primary_ip = primary_ip self.resource_type = resource_type @classmethod @@ -62968,10 +64315,10 @@ def from_dict(cls, _dict: Dict) -> 'FloatingIPTargetNetworkInterfaceReference': args['name'] = _dict.get('name') else: raise ValueError('Required property \'name\' not present in FloatingIPTargetNetworkInterfaceReference JSON') - if 'primary_ipv4_address' in _dict: - args['primary_ipv4_address'] = _dict.get('primary_ipv4_address') + if 'primary_ip' in _dict: + args['primary_ip'] = ReservedIPReference.from_dict(_dict.get('primary_ip')) else: - raise ValueError('Required property \'primary_ipv4_address\' not present in FloatingIPTargetNetworkInterfaceReference JSON') + raise ValueError('Required property \'primary_ip\' not present in FloatingIPTargetNetworkInterfaceReference JSON') if 'resource_type' in _dict: args['resource_type'] = _dict.get('resource_type') else: @@ -62994,8 +64341,8 @@ 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, 'primary_ipv4_address') and self.primary_ipv4_address is not None: - _dict['primary_ipv4_address'] = self.primary_ipv4_address + if hasattr(self, 'primary_ip') and self.primary_ip is not None: + _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 return _dict @@ -65009,10 +66356,10 @@ class InstanceGroupManagerScheduledActionManagerAutoScale(InstanceGroupManagerSc :attr str href: The URL for this instance group manager. :attr str id: The unique identifier for this instance group manager. :attr str name: The user-defined name for this instance group manager. - :attr int max_membership_count: (optional) The maximum number of members the - instance group should have at the scheduled time. - :attr int min_membership_count: (optional) The minimum number of members the - instance group should have at the scheduled time. + :attr int max_membership_count: (optional) The desired maximum number of + instance group members at the scheduled time. + :attr int min_membership_count: (optional) The desired minimum number of + instance group members at the scheduled time. """ def __init__(self, @@ -65033,10 +66380,10 @@ def __init__(self, this property indicates the referenced resource has been deleted and provides some supplementary information. - :param int max_membership_count: (optional) The maximum number of members - the instance group should have at the scheduled time. - :param int min_membership_count: (optional) The minimum number of members - the instance group should have at the scheduled time. + :param int max_membership_count: (optional) The desired maximum number of + instance group members at the scheduled time. + :param int min_membership_count: (optional) The desired minimum number of + instance group members at the scheduled time. """ # pylint: disable=super-init-not-called self.deleted = deleted @@ -65117,10 +66464,10 @@ class InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype(Inst `min_membership_count` and `max_membership_count`. - :attr int max_membership_count: (optional) The maximum number of members the - instance group should have at the scheduled time. - :attr int min_membership_count: (optional) The minimum number of members the - instance group should have at the scheduled time. + :attr int max_membership_count: (optional) The desired maximum number of + instance group members at the scheduled time. + :attr int min_membership_count: (optional) The desired minimum number of + instance group members at the scheduled time. """ def __init__(self, @@ -65130,10 +66477,10 @@ def __init__(self, """ Initialize a InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype object. - :param int max_membership_count: (optional) The maximum number of members - the instance group should have at the scheduled time. - :param int min_membership_count: (optional) The minimum number of members - the instance group should have at the scheduled time. + :param int max_membership_count: (optional) The desired maximum number of + instance group members at the scheduled time. + :param int min_membership_count: (optional) The desired minimum number of + instance group members at the scheduled time. """ # pylint: disable=super-init-not-called msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( @@ -68574,6 +69921,15 @@ class InstancePrototypeInstanceByImage(InstancePrototype): """ InstancePrototypeInstanceByImage. + :attr InstanceAvailabilityPrototype availability_policy: (optional) The + availability policy to use for this virtual server instance. + :attr InstanceDefaultTrustedProfilePrototype default_trusted_profile: (optional) + The default trusted profile configuration to use for this virtual server + instance This property's value is used when provisioning the virtual server + instance, but not subsequently managed. Accordingly, it is reflected as an + [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. :attr List[KeyIdentity] keys: (optional) The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the virtual server instance as cloud-init vendor data. For cloud-init enabled @@ -68588,6 +69944,8 @@ class InstancePrototypeInstanceByImage(InstancePrototype): not subsequently managed. Accordingly, it is reflected as an [instance initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + :attr InstanceMetadataServicePrototype metadata_service: (optional) + Configuration options for the instance metadata service. :attr str name: (optional) The unique user-defined name for this virtual server instance (and default system hostname). If unspecified, the name will be a hyphenated list of randomly-selected words. @@ -68596,7 +69954,8 @@ class InstancePrototypeInstanceByImage(InstancePrototype): :attr InstancePlacementTargetPrototype placement_target: (optional) The placement restrictions to use for the virtual server instance. :attr InstanceProfileIdentity profile: (optional) The profile to use for this - virtual server instance. + virtual server instance. If unspecified, `bx2-2x8` will be used, but this + default value is expected to change in the future. :attr ResourceGroupIdentity resource_group: (optional) :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An @@ -68623,7 +69982,10 @@ def __init__(self, primary_network_interface: 'NetworkInterfacePrototype', zone: 'ZoneIdentity', *, + availability_policy: 'InstanceAvailabilityPrototype' = None, + default_trusted_profile: 'InstanceDefaultTrustedProfilePrototype' = None, keys: List['KeyIdentity'] = None, + metadata_service: 'InstanceMetadataServicePrototype' = None, name: str = None, network_interfaces: List['NetworkInterfacePrototype'] = None, placement_target: 'InstancePlacementTargetPrototype' = None, @@ -68643,6 +70005,15 @@ def __init__(self, interface. :param ZoneIdentity zone: The zone this virtual server instance will reside in. + :param InstanceAvailabilityPrototype availability_policy: (optional) The + availability policy to use for this virtual server instance. + :param InstanceDefaultTrustedProfilePrototype default_trusted_profile: + (optional) The default trusted profile configuration to use for this + virtual server instance This property's value is used when provisioning + the virtual server instance, but not subsequently managed. Accordingly, it + is reflected as an [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. :param List[KeyIdentity] keys: (optional) The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the virtual server instance as cloud-init vendor data. For @@ -68659,6 +70030,8 @@ def __init__(self, [instance initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + :param InstanceMetadataServicePrototype metadata_service: (optional) + Configuration options for the instance metadata service. :param str name: (optional) The unique user-defined name for this virtual server instance (and default system hostname). If unspecified, the name will be a hyphenated list of randomly-selected words. @@ -68667,7 +70040,8 @@ def __init__(self, :param InstancePlacementTargetPrototype placement_target: (optional) The placement restrictions to use for the virtual server instance. :param InstanceProfileIdentity profile: (optional) The profile to use for - this virtual server instance. + this virtual server instance. If unspecified, `bx2-2x8` will be used, but + this default value is expected to change in the future. :param ResourceGroupIdentity resource_group: (optional) :param int total_volume_bandwidth: (optional) The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An @@ -68685,7 +70059,10 @@ def __init__(self, virtual server instance. """ # pylint: disable=super-init-not-called + self.availability_policy = availability_policy + self.default_trusted_profile = default_trusted_profile self.keys = keys + self.metadata_service = metadata_service self.name = name self.network_interfaces = network_interfaces self.placement_target = placement_target @@ -68704,8 +70081,14 @@ def __init__(self, def from_dict(cls, _dict: Dict) -> 'InstancePrototypeInstanceByImage': """Initialize a InstancePrototypeInstanceByImage object from a json dictionary.""" args = {} + if 'availability_policy' in _dict: + args['availability_policy'] = InstanceAvailabilityPrototype.from_dict(_dict.get('availability_policy')) + if 'default_trusted_profile' in _dict: + args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(_dict.get('default_trusted_profile')) if 'keys' in _dict: args['keys'] = _dict.get('keys') + if 'metadata_service' in _dict: + args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(_dict.get('metadata_service')) if 'name' in _dict: args['name'] = _dict.get('name') if 'network_interfaces' in _dict: @@ -68748,6 +70131,10 @@ def _from_dict(cls, _dict): def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'availability_policy') and self.availability_policy is not None: + _dict['availability_policy'] = self.availability_policy.to_dict() + if hasattr(self, 'default_trusted_profile') and self.default_trusted_profile is not None: + _dict['default_trusted_profile'] = self.default_trusted_profile.to_dict() if hasattr(self, 'keys') and self.keys is not None: keys_list = [] for x in self.keys: @@ -68756,6 +70143,8 @@ def to_dict(self) -> Dict: else: keys_list.append(x.to_dict()) _dict['keys'] = keys_list + if hasattr(self, 'metadata_service') and self.metadata_service is not None: + _dict['metadata_service'] = self.metadata_service.to_dict() if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'network_interfaces') and self.network_interfaces is not None: @@ -68820,10 +70209,19 @@ def __ne__(self, other: 'InstancePrototypeInstanceByImage') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class InstancePrototypeInstanceBySourceTemplate(InstancePrototype): +class InstancePrototypeInstanceBySourceSnapshot(InstancePrototype): """ - InstancePrototypeInstanceBySourceTemplate. + InstancePrototypeInstanceBySourceSnapshot. + :attr InstanceAvailabilityPrototype availability_policy: (optional) The + availability policy to use for this virtual server instance. + :attr InstanceDefaultTrustedProfilePrototype default_trusted_profile: (optional) + The default trusted profile configuration to use for this virtual server + instance This property's value is used when provisioning the virtual server + instance, but not subsequently managed. Accordingly, it is reflected as an + [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. :attr List[KeyIdentity] keys: (optional) The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the virtual server instance as cloud-init vendor data. For cloud-init enabled @@ -68838,6 +70236,8 @@ class InstancePrototypeInstanceBySourceTemplate(InstancePrototype): not subsequently managed. Accordingly, it is reflected as an [instance initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + :attr InstanceMetadataServicePrototype metadata_service: (optional) + Configuration options for the instance metadata service. :attr str name: (optional) The unique user-defined name for this virtual server instance (and default system hostname). If unspecified, the name will be a hyphenated list of randomly-selected words. @@ -68846,7 +70246,8 @@ class InstancePrototypeInstanceBySourceTemplate(InstancePrototype): :attr InstancePlacementTargetPrototype placement_target: (optional) The placement restrictions to use for the virtual server instance. :attr InstanceProfileIdentity profile: (optional) The profile to use for this - virtual server instance. + virtual server instance. If unspecified, `bx2-2x8` will be used, but this + default value is expected to change in the future. :attr ResourceGroupIdentity resource_group: (optional) :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An @@ -68859,22 +70260,23 @@ class InstancePrototypeInstanceBySourceTemplate(InstancePrototype): :attr VPCIdentity vpc: (optional) The VPC the virtual server instance is to be a part of. If specified, it must match the VPC referenced by the subnets of the instance's network interfaces. - :attr VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment: - (optional) The boot volume attachment for the virtual server instance. - :attr ImageIdentity image: (optional) The image to use when provisioning the - virtual server instance. - :attr NetworkInterfacePrototype primary_network_interface: (optional) Primary - network interface. - :attr InstanceTemplateIdentity source_template: The template to create this - virtual server instance from. - :attr ZoneIdentity zone: (optional) The zone this virtual server instance will - reside in. + :attr VolumeAttachmentPrototypeInstanceBySourceSnapshotContext + boot_volume_attachment: The boot volume attachment for the virtual server + instance. + :attr NetworkInterfacePrototype primary_network_interface: Primary network + interface. + :attr ZoneIdentity zone: The zone this virtual server instance will reside in. """ def __init__(self, - source_template: 'InstanceTemplateIdentity', + boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceBySourceSnapshotContext', + primary_network_interface: 'NetworkInterfacePrototype', + zone: 'ZoneIdentity', *, + availability_policy: 'InstanceAvailabilityPrototype' = None, + default_trusted_profile: 'InstanceDefaultTrustedProfilePrototype' = None, keys: List['KeyIdentity'] = None, + metadata_service: 'InstanceMetadataServicePrototype' = None, name: str = None, network_interfaces: List['NetworkInterfacePrototype'] = None, placement_target: 'InstancePlacementTargetPrototype' = None, @@ -68883,16 +70285,26 @@ def __init__(self, total_volume_bandwidth: int = None, user_data: str = None, volume_attachments: List['VolumeAttachmentPrototypeInstanceContext'] = None, - vpc: 'VPCIdentity' = None, - boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceByImageContext' = None, - image: 'ImageIdentity' = None, - primary_network_interface: 'NetworkInterfacePrototype' = None, - zone: 'ZoneIdentity' = None) -> None: + vpc: 'VPCIdentity' = None) -> None: """ - Initialize a InstancePrototypeInstanceBySourceTemplate object. + Initialize a InstancePrototypeInstanceBySourceSnapshot object. - :param InstanceTemplateIdentity source_template: The template to create - this virtual server instance from. + :param VolumeAttachmentPrototypeInstanceBySourceSnapshotContext + boot_volume_attachment: The boot volume attachment for the virtual server + instance. + :param NetworkInterfacePrototype primary_network_interface: Primary network + interface. + :param ZoneIdentity zone: The zone this virtual server instance will reside + in. + :param InstanceAvailabilityPrototype availability_policy: (optional) The + availability policy to use for this virtual server instance. + :param InstanceDefaultTrustedProfilePrototype default_trusted_profile: + (optional) The default trusted profile configuration to use for this + virtual server instance This property's value is used when provisioning + the virtual server instance, but not subsequently managed. Accordingly, it + is reflected as an [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. :param List[KeyIdentity] keys: (optional) The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the virtual server instance as cloud-init vendor data. For @@ -68909,6 +70321,8 @@ def __init__(self, [instance initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + :param InstanceMetadataServicePrototype metadata_service: (optional) + Configuration options for the instance metadata service. :param str name: (optional) The unique user-defined name for this virtual server instance (and default system hostname). If unspecified, the name will be a hyphenated list of randomly-selected words. @@ -68917,7 +70331,8 @@ def __init__(self, :param InstancePlacementTargetPrototype placement_target: (optional) The placement restrictions to use for the virtual server instance. :param InstanceProfileIdentity profile: (optional) The profile to use for - this virtual server instance. + this virtual server instance. If unspecified, `bx2-2x8` will be used, but + this default value is expected to change in the future. :param ResourceGroupIdentity resource_group: (optional) :param int total_volume_bandwidth: (optional) The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An @@ -68930,18 +70345,12 @@ def __init__(self, :param VPCIdentity vpc: (optional) The VPC the virtual server instance is to be a part of. If specified, it must match the VPC referenced by the subnets of the instance's network interfaces. - :param VolumeAttachmentPrototypeInstanceByImageContext - boot_volume_attachment: (optional) The boot volume attachment for the - virtual server instance. - :param ImageIdentity image: (optional) The image to use when provisioning - the virtual server instance. - :param NetworkInterfacePrototype primary_network_interface: (optional) - Primary network interface. - :param ZoneIdentity zone: (optional) The zone this virtual server instance - will reside in. """ # pylint: disable=super-init-not-called + self.availability_policy = availability_policy + self.default_trusted_profile = default_trusted_profile self.keys = keys + self.metadata_service = metadata_service self.name = name self.network_interfaces = network_interfaces self.placement_target = placement_target @@ -68952,17 +70361,21 @@ def __init__(self, self.volume_attachments = volume_attachments self.vpc = vpc self.boot_volume_attachment = boot_volume_attachment - self.image = image self.primary_network_interface = primary_network_interface - self.source_template = source_template self.zone = zone @classmethod - def from_dict(cls, _dict: Dict) -> 'InstancePrototypeInstanceBySourceTemplate': - """Initialize a InstancePrototypeInstanceBySourceTemplate object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstancePrototypeInstanceBySourceSnapshot': + """Initialize a InstancePrototypeInstanceBySourceSnapshot object from a json dictionary.""" args = {} + if 'availability_policy' in _dict: + args['availability_policy'] = InstanceAvailabilityPrototype.from_dict(_dict.get('availability_policy')) + if 'default_trusted_profile' in _dict: + args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(_dict.get('default_trusted_profile')) if 'keys' in _dict: args['keys'] = _dict.get('keys') + if 'metadata_service' in _dict: + args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(_dict.get('metadata_service')) if 'name' in _dict: args['name'] = _dict.get('name') if 'network_interfaces' in _dict: @@ -68982,27 +70395,31 @@ def from_dict(cls, _dict: Dict) -> 'InstancePrototypeInstanceBySourceTemplate': if 'vpc' in _dict: args['vpc'] = _dict.get('vpc') if 'boot_volume_attachment' in _dict: - args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByImageContext.from_dict(_dict.get('boot_volume_attachment')) - if 'image' in _dict: - args['image'] = _dict.get('image') + args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceBySourceSnapshotContext.from_dict(_dict.get('boot_volume_attachment')) + else: + raise ValueError('Required property \'boot_volume_attachment\' not present in InstancePrototypeInstanceBySourceSnapshot JSON') if 'primary_network_interface' in _dict: args['primary_network_interface'] = NetworkInterfacePrototype.from_dict(_dict.get('primary_network_interface')) - if 'source_template' in _dict: - args['source_template'] = _dict.get('source_template') else: - raise ValueError('Required property \'source_template\' not present in InstancePrototypeInstanceBySourceTemplate JSON') + raise ValueError('Required property \'primary_network_interface\' not present in InstancePrototypeInstanceBySourceSnapshot JSON') if 'zone' in _dict: args['zone'] = _dict.get('zone') + else: + raise ValueError('Required property \'zone\' not present in InstancePrototypeInstanceBySourceSnapshot JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstancePrototypeInstanceBySourceTemplate object from a json dictionary.""" + """Initialize a InstancePrototypeInstanceBySourceSnapshot object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'availability_policy') and self.availability_policy is not None: + _dict['availability_policy'] = self.availability_policy.to_dict() + if hasattr(self, 'default_trusted_profile') and self.default_trusted_profile is not None: + _dict['default_trusted_profile'] = self.default_trusted_profile.to_dict() if hasattr(self, 'keys') and self.keys is not None: keys_list = [] for x in self.keys: @@ -69011,6 +70428,8 @@ def to_dict(self) -> Dict: else: keys_list.append(x.to_dict()) _dict['keys'] = keys_list + if hasattr(self, 'metadata_service') and self.metadata_service is not None: + _dict['metadata_service'] = self.metadata_service.to_dict() if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'network_interfaces') and self.network_interfaces is not None: @@ -69043,18 +70462,8 @@ def to_dict(self) -> Dict: _dict['vpc'] = self.vpc.to_dict() if hasattr(self, 'boot_volume_attachment') and self.boot_volume_attachment is not None: _dict['boot_volume_attachment'] = self.boot_volume_attachment.to_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, 'primary_network_interface') and self.primary_network_interface is not None: _dict['primary_network_interface'] = self.primary_network_interface.to_dict() - if hasattr(self, 'source_template') and self.source_template is not None: - if isinstance(self.source_template, dict): - _dict['source_template'] = self.source_template - else: - _dict['source_template'] = self.source_template.to_dict() if hasattr(self, 'zone') and self.zone is not None: if isinstance(self.zone, dict): _dict['zone'] = self.zone @@ -69067,23 +70476,32 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstancePrototypeInstanceBySourceTemplate object.""" + """Return a `str` version of this InstancePrototypeInstanceBySourceSnapshot object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstancePrototypeInstanceBySourceTemplate') -> bool: + def __eq__(self, other: 'InstancePrototypeInstanceBySourceSnapshot') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstancePrototypeInstanceBySourceTemplate') -> bool: + def __ne__(self, other: 'InstancePrototypeInstanceBySourceSnapshot') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class InstancePrototypeInstanceByVolume(InstancePrototype): +class InstancePrototypeInstanceBySourceTemplate(InstancePrototype): """ - InstancePrototypeInstanceByVolume. + InstancePrototypeInstanceBySourceTemplate. + :attr InstanceAvailabilityPrototype availability_policy: (optional) The + availability policy to use for this virtual server instance. + :attr InstanceDefaultTrustedProfilePrototype default_trusted_profile: (optional) + The default trusted profile configuration to use for this virtual server + instance This property's value is used when provisioning the virtual server + instance, but not subsequently managed. Accordingly, it is reflected as an + [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. :attr List[KeyIdentity] keys: (optional) The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the virtual server instance as cloud-init vendor data. For cloud-init enabled @@ -69098,6 +70516,8 @@ class InstancePrototypeInstanceByVolume(InstancePrototype): not subsequently managed. Accordingly, it is reflected as an [instance initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + :attr InstanceMetadataServicePrototype metadata_service: (optional) + Configuration options for the instance metadata service. :attr str name: (optional) The unique user-defined name for this virtual server instance (and default system hostname). If unspecified, the name will be a hyphenated list of randomly-selected words. @@ -69106,7 +70526,8 @@ class InstancePrototypeInstanceByVolume(InstancePrototype): :attr InstancePlacementTargetPrototype placement_target: (optional) The placement restrictions to use for the virtual server instance. :attr InstanceProfileIdentity profile: (optional) The profile to use for this - virtual server instance. + virtual server instance. If unspecified, `bx2-2x8` will be used, but this + default value is expected to change in the future. :attr ResourceGroupIdentity resource_group: (optional) :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An @@ -69119,19 +70540,25 @@ class InstancePrototypeInstanceByVolume(InstancePrototype): :attr VPCIdentity vpc: (optional) The VPC the virtual server instance is to be a part of. If specified, it must match the VPC referenced by the subnets of the instance's network interfaces. - :attr VolumeAttachmentPrototypeInstanceByVolumeContext boot_volume_attachment: - The boot volume attachment for the virtual server instance. - :attr NetworkInterfacePrototype primary_network_interface: Primary network - interface. - :attr ZoneIdentity zone: The zone this virtual server instance will reside in. + :attr VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment: + (optional) The boot volume attachment for the virtual server instance. + :attr ImageIdentity image: (optional) The image to use when provisioning the + virtual server instance. + :attr NetworkInterfacePrototype primary_network_interface: (optional) Primary + network interface. + :attr InstanceTemplateIdentity source_template: The template to create this + virtual server instance from. + :attr ZoneIdentity zone: (optional) The zone this virtual server instance will + reside in. """ def __init__(self, - boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceByVolumeContext', - primary_network_interface: 'NetworkInterfacePrototype', - zone: 'ZoneIdentity', + source_template: 'InstanceTemplateIdentity', *, + availability_policy: 'InstanceAvailabilityPrototype' = None, + default_trusted_profile: 'InstanceDefaultTrustedProfilePrototype' = None, keys: List['KeyIdentity'] = None, + metadata_service: 'InstanceMetadataServicePrototype' = None, name: str = None, network_interfaces: List['NetworkInterfacePrototype'] = None, placement_target: 'InstancePlacementTargetPrototype' = None, @@ -69140,17 +70567,25 @@ def __init__(self, total_volume_bandwidth: int = None, user_data: str = None, volume_attachments: List['VolumeAttachmentPrototypeInstanceContext'] = None, - vpc: 'VPCIdentity' = None) -> None: + vpc: 'VPCIdentity' = None, + boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceByImageContext' = None, + image: 'ImageIdentity' = None, + primary_network_interface: 'NetworkInterfacePrototype' = None, + zone: 'ZoneIdentity' = None) -> None: """ - Initialize a InstancePrototypeInstanceByVolume object. + Initialize a InstancePrototypeInstanceBySourceTemplate object. - :param VolumeAttachmentPrototypeInstanceByVolumeContext - boot_volume_attachment: The boot volume attachment for the virtual server - instance. - :param NetworkInterfacePrototype primary_network_interface: Primary network - interface. - :param ZoneIdentity zone: The zone this virtual server instance will reside - in. + :param InstanceTemplateIdentity source_template: The template to create + this virtual server instance from. + :param InstanceAvailabilityPrototype availability_policy: (optional) The + availability policy to use for this virtual server instance. + :param InstanceDefaultTrustedProfilePrototype default_trusted_profile: + (optional) The default trusted profile configuration to use for this + virtual server instance This property's value is used when provisioning + the virtual server instance, but not subsequently managed. Accordingly, it + is reflected as an [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. :param List[KeyIdentity] keys: (optional) The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the virtual server instance as cloud-init vendor data. For @@ -69167,6 +70602,8 @@ def __init__(self, [instance initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + :param InstanceMetadataServicePrototype metadata_service: (optional) + Configuration options for the instance metadata service. :param str name: (optional) The unique user-defined name for this virtual server instance (and default system hostname). If unspecified, the name will be a hyphenated list of randomly-selected words. @@ -69175,7 +70612,8 @@ def __init__(self, :param InstancePlacementTargetPrototype placement_target: (optional) The placement restrictions to use for the virtual server instance. :param InstanceProfileIdentity profile: (optional) The profile to use for - this virtual server instance. + this virtual server instance. If unspecified, `bx2-2x8` will be used, but + this default value is expected to change in the future. :param ResourceGroupIdentity resource_group: (optional) :param int total_volume_bandwidth: (optional) The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An @@ -69188,9 +70626,21 @@ def __init__(self, :param VPCIdentity vpc: (optional) The VPC the virtual server instance is to be a part of. If specified, it must match the VPC referenced by the subnets of the instance's network interfaces. + :param VolumeAttachmentPrototypeInstanceByImageContext + boot_volume_attachment: (optional) The boot volume attachment for the + virtual server instance. + :param ImageIdentity image: (optional) The image to use when provisioning + the virtual server instance. + :param NetworkInterfacePrototype primary_network_interface: (optional) + Primary network interface. + :param ZoneIdentity zone: (optional) The zone this virtual server instance + will reside in. """ # pylint: disable=super-init-not-called + self.availability_policy = availability_policy + self.default_trusted_profile = default_trusted_profile self.keys = keys + self.metadata_service = metadata_service self.name = name self.network_interfaces = network_interfaces self.placement_target = placement_target @@ -69201,15 +70651,23 @@ def __init__(self, self.volume_attachments = volume_attachments self.vpc = vpc self.boot_volume_attachment = boot_volume_attachment + self.image = image self.primary_network_interface = primary_network_interface + self.source_template = source_template self.zone = zone @classmethod - def from_dict(cls, _dict: Dict) -> 'InstancePrototypeInstanceByVolume': - """Initialize a InstancePrototypeInstanceByVolume object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstancePrototypeInstanceBySourceTemplate': + """Initialize a InstancePrototypeInstanceBySourceTemplate object from a json dictionary.""" args = {} + if 'availability_policy' in _dict: + args['availability_policy'] = InstanceAvailabilityPrototype.from_dict(_dict.get('availability_policy')) + if 'default_trusted_profile' in _dict: + args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(_dict.get('default_trusted_profile')) if 'keys' in _dict: args['keys'] = _dict.get('keys') + if 'metadata_service' in _dict: + args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(_dict.get('metadata_service')) if 'name' in _dict: args['name'] = _dict.get('name') if 'network_interfaces' in _dict: @@ -69229,27 +70687,31 @@ def from_dict(cls, _dict: Dict) -> 'InstancePrototypeInstanceByVolume': if 'vpc' in _dict: args['vpc'] = _dict.get('vpc') if 'boot_volume_attachment' in _dict: - args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByVolumeContext.from_dict(_dict.get('boot_volume_attachment')) - else: - raise ValueError('Required property \'boot_volume_attachment\' not present in InstancePrototypeInstanceByVolume JSON') + args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByImageContext.from_dict(_dict.get('boot_volume_attachment')) + if 'image' in _dict: + args['image'] = _dict.get('image') if 'primary_network_interface' in _dict: args['primary_network_interface'] = NetworkInterfacePrototype.from_dict(_dict.get('primary_network_interface')) + if 'source_template' in _dict: + args['source_template'] = _dict.get('source_template') else: - raise ValueError('Required property \'primary_network_interface\' not present in InstancePrototypeInstanceByVolume JSON') + raise ValueError('Required property \'source_template\' not present in InstancePrototypeInstanceBySourceTemplate JSON') if 'zone' in _dict: args['zone'] = _dict.get('zone') - else: - raise ValueError('Required property \'zone\' not present in InstancePrototypeInstanceByVolume JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstancePrototypeInstanceByVolume object from a json dictionary.""" + """Initialize a InstancePrototypeInstanceBySourceTemplate object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'availability_policy') and self.availability_policy is not None: + _dict['availability_policy'] = self.availability_policy.to_dict() + if hasattr(self, 'default_trusted_profile') and self.default_trusted_profile is not None: + _dict['default_trusted_profile'] = self.default_trusted_profile.to_dict() if hasattr(self, 'keys') and self.keys is not None: keys_list = [] for x in self.keys: @@ -69258,6 +70720,8 @@ def to_dict(self) -> Dict: else: keys_list.append(x.to_dict()) _dict['keys'] = keys_list + if hasattr(self, 'metadata_service') and self.metadata_service is not None: + _dict['metadata_service'] = self.metadata_service.to_dict() if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'network_interfaces') and self.network_interfaces is not None: @@ -69290,8 +70754,18 @@ def to_dict(self) -> Dict: _dict['vpc'] = self.vpc.to_dict() if hasattr(self, 'boot_volume_attachment') and self.boot_volume_attachment is not None: _dict['boot_volume_attachment'] = self.boot_volume_attachment.to_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, 'primary_network_interface') and self.primary_network_interface is not None: _dict['primary_network_interface'] = self.primary_network_interface.to_dict() + if hasattr(self, 'source_template') and self.source_template is not None: + if isinstance(self.source_template, dict): + _dict['source_template'] = self.source_template + else: + _dict['source_template'] = self.source_template.to_dict() if hasattr(self, 'zone') and self.zone is not None: if isinstance(self.zone, dict): _dict['zone'] = self.zone @@ -69304,16 +70778,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstancePrototypeInstanceByVolume object.""" + """Return a `str` version of this InstancePrototypeInstanceBySourceTemplate object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstancePrototypeInstanceByVolume') -> bool: + def __eq__(self, other: 'InstancePrototypeInstanceBySourceTemplate') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstancePrototypeInstanceByVolume') -> bool: + def __ne__(self, other: 'InstancePrototypeInstanceBySourceTemplate') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -69492,6 +70966,15 @@ class InstanceTemplatePrototypeInstanceByImage(InstanceTemplatePrototype): """ InstanceTemplatePrototypeInstanceByImage. + :attr InstanceAvailabilityPrototype availability_policy: (optional) The + availability policy to use for this virtual server instance. + :attr InstanceDefaultTrustedProfilePrototype default_trusted_profile: (optional) + The default trusted profile configuration to use for this virtual server + instance This property's value is used when provisioning the virtual server + instance, but not subsequently managed. Accordingly, it is reflected as an + [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. :attr List[KeyIdentity] keys: (optional) The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the virtual server instance as cloud-init vendor data. For cloud-init enabled @@ -69506,6 +70989,8 @@ class InstanceTemplatePrototypeInstanceByImage(InstanceTemplatePrototype): not subsequently managed. Accordingly, it is reflected as an [instance initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + :attr InstanceMetadataServicePrototype metadata_service: (optional) + Configuration options for the instance metadata service. :attr str name: (optional) The unique user-defined name for this virtual server instance (and default system hostname). If unspecified, the name will be a hyphenated list of randomly-selected words. @@ -69514,7 +70999,8 @@ class InstanceTemplatePrototypeInstanceByImage(InstanceTemplatePrototype): :attr InstancePlacementTargetPrototype placement_target: (optional) The placement restrictions to use for the virtual server instance. :attr InstanceProfileIdentity profile: (optional) The profile to use for this - virtual server instance. + virtual server instance. If unspecified, `bx2-2x8` will be used, but this + default value is expected to change in the future. :attr ResourceGroupIdentity resource_group: (optional) :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An @@ -69541,7 +71027,10 @@ def __init__(self, primary_network_interface: 'NetworkInterfacePrototype', zone: 'ZoneIdentity', *, + availability_policy: 'InstanceAvailabilityPrototype' = None, + default_trusted_profile: 'InstanceDefaultTrustedProfilePrototype' = None, keys: List['KeyIdentity'] = None, + metadata_service: 'InstanceMetadataServicePrototype' = None, name: str = None, network_interfaces: List['NetworkInterfacePrototype'] = None, placement_target: 'InstancePlacementTargetPrototype' = None, @@ -69561,6 +71050,15 @@ def __init__(self, interface. :param ZoneIdentity zone: The zone this virtual server instance will reside in. + :param InstanceAvailabilityPrototype availability_policy: (optional) The + availability policy to use for this virtual server instance. + :param InstanceDefaultTrustedProfilePrototype default_trusted_profile: + (optional) The default trusted profile configuration to use for this + virtual server instance This property's value is used when provisioning + the virtual server instance, but not subsequently managed. Accordingly, it + is reflected as an [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. :param List[KeyIdentity] keys: (optional) The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the virtual server instance as cloud-init vendor data. For @@ -69577,6 +71075,8 @@ def __init__(self, [instance initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + :param InstanceMetadataServicePrototype metadata_service: (optional) + Configuration options for the instance metadata service. :param str name: (optional) The unique user-defined name for this virtual server instance (and default system hostname). If unspecified, the name will be a hyphenated list of randomly-selected words. @@ -69585,7 +71085,8 @@ def __init__(self, :param InstancePlacementTargetPrototype placement_target: (optional) The placement restrictions to use for the virtual server instance. :param InstanceProfileIdentity profile: (optional) The profile to use for - this virtual server instance. + this virtual server instance. If unspecified, `bx2-2x8` will be used, but + this default value is expected to change in the future. :param ResourceGroupIdentity resource_group: (optional) :param int total_volume_bandwidth: (optional) The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An @@ -69603,7 +71104,10 @@ def __init__(self, virtual server instance. """ # pylint: disable=super-init-not-called + self.availability_policy = availability_policy + self.default_trusted_profile = default_trusted_profile self.keys = keys + self.metadata_service = metadata_service self.name = name self.network_interfaces = network_interfaces self.placement_target = placement_target @@ -69622,8 +71126,14 @@ def __init__(self, def from_dict(cls, _dict: Dict) -> 'InstanceTemplatePrototypeInstanceByImage': """Initialize a InstanceTemplatePrototypeInstanceByImage object from a json dictionary.""" args = {} + if 'availability_policy' in _dict: + args['availability_policy'] = InstanceAvailabilityPrototype.from_dict(_dict.get('availability_policy')) + if 'default_trusted_profile' in _dict: + args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(_dict.get('default_trusted_profile')) if 'keys' in _dict: args['keys'] = _dict.get('keys') + if 'metadata_service' in _dict: + args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(_dict.get('metadata_service')) if 'name' in _dict: args['name'] = _dict.get('name') if 'network_interfaces' in _dict: @@ -69666,6 +71176,10 @@ def _from_dict(cls, _dict): def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'availability_policy') and self.availability_policy is not None: + _dict['availability_policy'] = self.availability_policy.to_dict() + if hasattr(self, 'default_trusted_profile') and self.default_trusted_profile is not None: + _dict['default_trusted_profile'] = self.default_trusted_profile.to_dict() if hasattr(self, 'keys') and self.keys is not None: keys_list = [] for x in self.keys: @@ -69674,6 +71188,8 @@ def to_dict(self) -> Dict: else: keys_list.append(x.to_dict()) _dict['keys'] = keys_list + if hasattr(self, 'metadata_service') and self.metadata_service is not None: + _dict['metadata_service'] = self.metadata_service.to_dict() if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'network_interfaces') and self.network_interfaces is not None: @@ -69742,6 +71258,15 @@ class InstanceTemplatePrototypeInstanceBySourceTemplate(InstanceTemplatePrototyp """ InstanceTemplatePrototypeInstanceBySourceTemplate. + :attr InstanceAvailabilityPrototype availability_policy: (optional) The + availability policy to use for this virtual server instance. + :attr InstanceDefaultTrustedProfilePrototype default_trusted_profile: (optional) + The default trusted profile configuration to use for this virtual server + instance This property's value is used when provisioning the virtual server + instance, but not subsequently managed. Accordingly, it is reflected as an + [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. :attr List[KeyIdentity] keys: (optional) The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the virtual server instance as cloud-init vendor data. For cloud-init enabled @@ -69756,6 +71281,8 @@ class InstanceTemplatePrototypeInstanceBySourceTemplate(InstanceTemplatePrototyp not subsequently managed. Accordingly, it is reflected as an [instance initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + :attr InstanceMetadataServicePrototype metadata_service: (optional) + Configuration options for the instance metadata service. :attr str name: (optional) The unique user-defined name for this virtual server instance (and default system hostname). If unspecified, the name will be a hyphenated list of randomly-selected words. @@ -69764,7 +71291,8 @@ class InstanceTemplatePrototypeInstanceBySourceTemplate(InstanceTemplatePrototyp :attr InstancePlacementTargetPrototype placement_target: (optional) The placement restrictions to use for the virtual server instance. :attr InstanceProfileIdentity profile: (optional) The profile to use for this - virtual server instance. + virtual server instance. If unspecified, `bx2-2x8` will be used, but this + default value is expected to change in the future. :attr ResourceGroupIdentity resource_group: (optional) :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An @@ -69792,7 +71320,10 @@ class InstanceTemplatePrototypeInstanceBySourceTemplate(InstanceTemplatePrototyp def __init__(self, source_template: 'InstanceTemplateIdentity', *, + availability_policy: 'InstanceAvailabilityPrototype' = None, + default_trusted_profile: 'InstanceDefaultTrustedProfilePrototype' = None, keys: List['KeyIdentity'] = None, + metadata_service: 'InstanceMetadataServicePrototype' = None, name: str = None, network_interfaces: List['NetworkInterfacePrototype'] = None, placement_target: 'InstancePlacementTargetPrototype' = None, @@ -69811,6 +71342,15 @@ def __init__(self, :param InstanceTemplateIdentity source_template: The template to create this virtual server instance from. + :param InstanceAvailabilityPrototype availability_policy: (optional) The + availability policy to use for this virtual server instance. + :param InstanceDefaultTrustedProfilePrototype default_trusted_profile: + (optional) The default trusted profile configuration to use for this + virtual server instance This property's value is used when provisioning + the virtual server instance, but not subsequently managed. Accordingly, it + is reflected as an [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. :param List[KeyIdentity] keys: (optional) The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the virtual server instance as cloud-init vendor data. For @@ -69827,6 +71367,8 @@ def __init__(self, [instance initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + :param InstanceMetadataServicePrototype metadata_service: (optional) + Configuration options for the instance metadata service. :param str name: (optional) The unique user-defined name for this virtual server instance (and default system hostname). If unspecified, the name will be a hyphenated list of randomly-selected words. @@ -69835,7 +71377,8 @@ def __init__(self, :param InstancePlacementTargetPrototype placement_target: (optional) The placement restrictions to use for the virtual server instance. :param InstanceProfileIdentity profile: (optional) The profile to use for - this virtual server instance. + this virtual server instance. If unspecified, `bx2-2x8` will be used, but + this default value is expected to change in the future. :param ResourceGroupIdentity resource_group: (optional) :param int total_volume_bandwidth: (optional) The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An @@ -69859,7 +71402,10 @@ def __init__(self, will reside in. """ # pylint: disable=super-init-not-called + self.availability_policy = availability_policy + self.default_trusted_profile = default_trusted_profile self.keys = keys + self.metadata_service = metadata_service self.name = name self.network_interfaces = network_interfaces self.placement_target = placement_target @@ -69879,8 +71425,14 @@ def __init__(self, def from_dict(cls, _dict: Dict) -> 'InstanceTemplatePrototypeInstanceBySourceTemplate': """Initialize a InstanceTemplatePrototypeInstanceBySourceTemplate object from a json dictionary.""" args = {} + if 'availability_policy' in _dict: + args['availability_policy'] = InstanceAvailabilityPrototype.from_dict(_dict.get('availability_policy')) + if 'default_trusted_profile' in _dict: + args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(_dict.get('default_trusted_profile')) if 'keys' in _dict: args['keys'] = _dict.get('keys') + if 'metadata_service' in _dict: + args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(_dict.get('metadata_service')) if 'name' in _dict: args['name'] = _dict.get('name') if 'network_interfaces' in _dict: @@ -69921,6 +71473,10 @@ def _from_dict(cls, _dict): def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'availability_policy') and self.availability_policy is not None: + _dict['availability_policy'] = self.availability_policy.to_dict() + if hasattr(self, 'default_trusted_profile') and self.default_trusted_profile is not None: + _dict['default_trusted_profile'] = self.default_trusted_profile.to_dict() if hasattr(self, 'keys') and self.keys is not None: keys_list = [] for x in self.keys: @@ -69929,6 +71485,8 @@ def to_dict(self) -> Dict: else: keys_list.append(x.to_dict()) _dict['keys'] = keys_list + if hasattr(self, 'metadata_service') and self.metadata_service is not None: + _dict['metadata_service'] = self.metadata_service.to_dict() if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'network_interfaces') and self.network_interfaces is not None: @@ -69998,10 +71556,24 @@ def __ne__(self, other: 'InstanceTemplatePrototypeInstanceBySourceTemplate') -> """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class InstanceTemplatePrototypeInstanceByVolume(InstanceTemplatePrototype): +class InstanceTemplateInstanceByImage(InstanceTemplate): """ - InstanceTemplatePrototypeInstanceByVolume. + InstanceTemplateInstanceByImage. + :attr InstanceAvailabilityPrototype availability_policy: (optional) The + availability policy to use for this virtual server instance. + :attr datetime created_at: The date and time that the instance template was + created. + :attr str crn: The CRN for this instance template. + :attr InstanceDefaultTrustedProfilePrototype default_trusted_profile: (optional) + The default trusted profile configuration to use for this virtual server + instance This property's value is used when provisioning the virtual server + instance, but not subsequently managed. Accordingly, it is reflected as an + [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. + :attr str href: The URL for this instance template. + :attr str id: The unique identifier for this instance template. :attr List[KeyIdentity] keys: (optional) The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the virtual server instance as cloud-init vendor data. For cloud-init enabled @@ -70016,16 +71588,18 @@ class InstanceTemplatePrototypeInstanceByVolume(InstanceTemplatePrototype): not subsequently managed. Accordingly, it is reflected as an [instance initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - :attr str name: (optional) The unique user-defined name for this virtual server - instance (and default system hostname). If unspecified, the name will be a - hyphenated list of randomly-selected words. + :attr InstanceMetadataServicePrototype metadata_service: (optional) + Configuration options for the instance metadata service. + :attr str name: The unique user-defined name for this instance template. :attr List[NetworkInterfacePrototype] network_interfaces: (optional) The additional network interfaces to create for the virtual server instance. :attr InstancePlacementTargetPrototype placement_target: (optional) The placement restrictions to use for the virtual server instance. :attr InstanceProfileIdentity profile: (optional) The profile to use for this - virtual server instance. - :attr ResourceGroupIdentity resource_group: (optional) + virtual server instance. If unspecified, `bx2-2x8` will be used, but this + default value is expected to change in the future. + :attr ResourceGroupReference resource_group: The resource group for this + instance template. :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in this value will result in a corresponding decrease to @@ -70037,38 +71611,64 @@ class InstanceTemplatePrototypeInstanceByVolume(InstanceTemplatePrototype): :attr VPCIdentity vpc: (optional) The VPC the virtual server instance is to be a part of. If specified, it must match the VPC referenced by the subnets of the instance's network interfaces. - :attr VolumeAttachmentPrototypeInstanceByVolumeContext boot_volume_attachment: - The boot volume attachment for the virtual server instance. + :attr VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment: + (optional) The boot volume attachment for the virtual server instance. + :attr ImageIdentity image: The image to use when provisioning the virtual server + instance. :attr NetworkInterfacePrototype primary_network_interface: Primary network interface. :attr ZoneIdentity zone: The zone this virtual server instance will reside in. """ def __init__(self, - boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceByVolumeContext', + created_at: datetime, + crn: str, + href: str, + id: str, + name: str, + resource_group: 'ResourceGroupReference', + image: 'ImageIdentity', primary_network_interface: 'NetworkInterfacePrototype', zone: 'ZoneIdentity', *, + availability_policy: 'InstanceAvailabilityPrototype' = None, + default_trusted_profile: 'InstanceDefaultTrustedProfilePrototype' = None, keys: List['KeyIdentity'] = None, - name: str = None, + metadata_service: 'InstanceMetadataServicePrototype' = None, network_interfaces: List['NetworkInterfacePrototype'] = None, placement_target: 'InstancePlacementTargetPrototype' = None, profile: 'InstanceProfileIdentity' = None, - resource_group: 'ResourceGroupIdentity' = None, total_volume_bandwidth: int = None, user_data: str = None, volume_attachments: List['VolumeAttachmentPrototypeInstanceContext'] = None, - vpc: 'VPCIdentity' = None) -> None: + vpc: 'VPCIdentity' = None, + boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceByImageContext' = None) -> None: """ - Initialize a InstanceTemplatePrototypeInstanceByVolume object. + Initialize a InstanceTemplateInstanceByImage object. - :param VolumeAttachmentPrototypeInstanceByVolumeContext - boot_volume_attachment: The boot volume attachment for the virtual server - instance. + :param datetime created_at: The date and time that the instance template + was created. + :param str crn: The CRN for this instance template. + :param str href: The URL for this instance template. + :param str id: The unique identifier for this instance template. + :param str name: The unique user-defined name for this instance template. + :param ResourceGroupReference resource_group: The resource group for this + instance template. + :param ImageIdentity image: The image to use when provisioning the virtual + server instance. :param NetworkInterfacePrototype primary_network_interface: Primary network interface. :param ZoneIdentity zone: The zone this virtual server instance will reside in. + :param InstanceAvailabilityPrototype availability_policy: (optional) The + availability policy to use for this virtual server instance. + :param InstanceDefaultTrustedProfilePrototype default_trusted_profile: + (optional) The default trusted profile configuration to use for this + virtual server instance This property's value is used when provisioning + the virtual server instance, but not subsequently managed. Accordingly, it + is reflected as an [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. :param List[KeyIdentity] keys: (optional) The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the virtual server instance as cloud-init vendor data. For @@ -70085,16 +71685,15 @@ def __init__(self, [instance initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. - :param str name: (optional) The unique user-defined name for this virtual - server instance (and default system hostname). If unspecified, the name - will be a hyphenated list of randomly-selected words. + :param InstanceMetadataServicePrototype metadata_service: (optional) + Configuration options for the instance metadata service. :param List[NetworkInterfacePrototype] network_interfaces: (optional) The additional network interfaces to create for the virtual server instance. :param InstancePlacementTargetPrototype placement_target: (optional) The placement restrictions to use for the virtual server instance. :param InstanceProfileIdentity profile: (optional) The profile to use for - this virtual server instance. - :param ResourceGroupIdentity resource_group: (optional) + this virtual server instance. If unspecified, `bx2-2x8` will be used, but + this default value is expected to change in the future. :param int total_volume_bandwidth: (optional) The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in this value will result in a corresponding decrease to @@ -70106,9 +71705,19 @@ def __init__(self, :param VPCIdentity vpc: (optional) The VPC the virtual server instance is to be a part of. If specified, it must match the VPC referenced by the subnets of the instance's network interfaces. + :param VolumeAttachmentPrototypeInstanceByImageContext + boot_volume_attachment: (optional) The boot volume attachment for the + virtual server instance. """ # pylint: disable=super-init-not-called + self.availability_policy = availability_policy + self.created_at = created_at + self.crn = crn + self.default_trusted_profile = default_trusted_profile + self.href = href + self.id = id self.keys = keys + self.metadata_service = metadata_service self.name = name self.network_interfaces = network_interfaces self.placement_target = placement_target @@ -70119,17 +71728,42 @@ def __init__(self, self.volume_attachments = volume_attachments self.vpc = vpc self.boot_volume_attachment = boot_volume_attachment + self.image = image self.primary_network_interface = primary_network_interface self.zone = zone @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceTemplatePrototypeInstanceByVolume': - """Initialize a InstanceTemplatePrototypeInstanceByVolume object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceTemplateInstanceByImage': + """Initialize a InstanceTemplateInstanceByImage object from a json dictionary.""" args = {} + if 'availability_policy' in _dict: + args['availability_policy'] = InstanceAvailabilityPrototype.from_dict(_dict.get('availability_policy')) + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) + else: + raise ValueError('Required property \'created_at\' not present in InstanceTemplateInstanceByImage JSON') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') + else: + raise ValueError('Required property \'crn\' not present in InstanceTemplateInstanceByImage JSON') + if 'default_trusted_profile' in _dict: + args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(_dict.get('default_trusted_profile')) + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in InstanceTemplateInstanceByImage JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in InstanceTemplateInstanceByImage JSON') if 'keys' in _dict: args['keys'] = _dict.get('keys') + if 'metadata_service' in _dict: + args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(_dict.get('metadata_service')) if 'name' in _dict: args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in InstanceTemplateInstanceByImage JSON') if 'network_interfaces' in _dict: args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(x) for x in _dict.get('network_interfaces')] if 'placement_target' in _dict: @@ -70137,7 +71771,9 @@ def from_dict(cls, _dict: Dict) -> 'InstanceTemplatePrototypeInstanceByVolume': if 'profile' in _dict: args['profile'] = _dict.get('profile') if 'resource_group' in _dict: - args['resource_group'] = _dict.get('resource_group') + args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) + else: + raise ValueError('Required property \'resource_group\' not present in InstanceTemplateInstanceByImage JSON') if 'total_volume_bandwidth' in _dict: args['total_volume_bandwidth'] = _dict.get('total_volume_bandwidth') if 'user_data' in _dict: @@ -70147,27 +71783,41 @@ def from_dict(cls, _dict: Dict) -> 'InstanceTemplatePrototypeInstanceByVolume': if 'vpc' in _dict: args['vpc'] = _dict.get('vpc') if 'boot_volume_attachment' in _dict: - args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByVolumeContext.from_dict(_dict.get('boot_volume_attachment')) + args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByImageContext.from_dict(_dict.get('boot_volume_attachment')) + if 'image' in _dict: + args['image'] = _dict.get('image') else: - raise ValueError('Required property \'boot_volume_attachment\' not present in InstanceTemplatePrototypeInstanceByVolume JSON') + raise ValueError('Required property \'image\' not present in InstanceTemplateInstanceByImage JSON') if 'primary_network_interface' in _dict: args['primary_network_interface'] = NetworkInterfacePrototype.from_dict(_dict.get('primary_network_interface')) else: - raise ValueError('Required property \'primary_network_interface\' not present in InstanceTemplatePrototypeInstanceByVolume JSON') + raise ValueError('Required property \'primary_network_interface\' not present in InstanceTemplateInstanceByImage JSON') if 'zone' in _dict: args['zone'] = _dict.get('zone') else: - raise ValueError('Required property \'zone\' not present in InstanceTemplatePrototypeInstanceByVolume JSON') + raise ValueError('Required property \'zone\' not present in InstanceTemplateInstanceByImage JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceTemplatePrototypeInstanceByVolume object from a json dictionary.""" + """Initialize a InstanceTemplateInstanceByImage object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'availability_policy') and self.availability_policy is not None: + _dict['availability_policy'] = self.availability_policy.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, 'default_trusted_profile') and self.default_trusted_profile is not None: + _dict['default_trusted_profile'] = self.default_trusted_profile.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, 'keys') and self.keys is not None: keys_list = [] for x in self.keys: @@ -70176,295 +71826,8 @@ def to_dict(self) -> Dict: else: keys_list.append(x.to_dict()) _dict['keys'] = keys_list - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'network_interfaces') and self.network_interfaces is not None: - _dict['network_interfaces'] = [x.to_dict() for x in self.network_interfaces] - if hasattr(self, 'placement_target') and self.placement_target is not None: - if isinstance(self.placement_target, dict): - _dict['placement_target'] = self.placement_target - else: - _dict['placement_target'] = self.placement_target.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, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None: - _dict['total_volume_bandwidth'] = self.total_volume_bandwidth - if hasattr(self, 'user_data') and self.user_data is not None: - _dict['user_data'] = self.user_data - if hasattr(self, 'volume_attachments') and self.volume_attachments is not None: - _dict['volume_attachments'] = [x.to_dict() for x in self.volume_attachments] - 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, 'boot_volume_attachment') and self.boot_volume_attachment is not None: - _dict['boot_volume_attachment'] = self.boot_volume_attachment.to_dict() - if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None: - _dict['primary_network_interface'] = self.primary_network_interface.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): - """Return a json dictionary representing this model.""" - return self.to_dict() - - def __str__(self) -> str: - """Return a `str` version of this InstanceTemplatePrototypeInstanceByVolume object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'InstanceTemplatePrototypeInstanceByVolume') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - - def __ne__(self, other: 'InstanceTemplatePrototypeInstanceByVolume') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - -class InstanceTemplateInstanceByImage(InstanceTemplate): - """ - InstanceTemplateInstanceByImage. - - :attr datetime created_at: The date and time that the instance template was - created. - :attr str crn: The CRN for this instance template. - :attr str href: The URL for this instance template. - :attr str id: The unique identifier for this instance template. - :attr List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Keys will be made available - to the virtual server instance 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 chosen - to encrypt [the administrator - password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). 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. - This property's value is used when provisioning the virtual server instance, but - not subsequently managed. Accordingly, it is reflected as an [instance - initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - property. - :attr str name: The unique user-defined name for this instance template. - :attr List[NetworkInterfacePrototype] network_interfaces: (optional) The - additional network interfaces to create for the virtual server instance. - :attr InstancePlacementTargetPrototype placement_target: (optional) The - placement restrictions to use for the virtual server instance. - :attr InstanceProfileIdentity profile: (optional) The profile to use for this - virtual server instance. - :attr ResourceGroupReference resource_group: The resource group for this - instance template. - :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in - megabits per second) allocated exclusively to instance storage volumes. An - increase in this value will result in a corresponding decrease to - `total_network_bandwidth`. - :attr str user_data: (optional) User data to be made available when setting up - the virtual server instance. - :attr List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: - (optional) The volume attachments for this virtual server instance. - :attr VPCIdentity vpc: (optional) The VPC the virtual server instance is to be a - part of. If specified, it must match the VPC referenced by the subnets of the - instance's network interfaces. - :attr VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment: - (optional) The boot volume attachment for the virtual server instance. - :attr ImageIdentity image: The image to use when provisioning the virtual server - instance. - :attr NetworkInterfacePrototype primary_network_interface: Primary network - interface. - :attr ZoneIdentity zone: The zone this virtual server instance will reside in. - """ - - def __init__(self, - created_at: datetime, - crn: str, - href: str, - id: str, - name: str, - resource_group: 'ResourceGroupReference', - image: 'ImageIdentity', - primary_network_interface: 'NetworkInterfacePrototype', - zone: 'ZoneIdentity', - *, - keys: List['KeyIdentity'] = None, - network_interfaces: List['NetworkInterfacePrototype'] = None, - placement_target: 'InstancePlacementTargetPrototype' = None, - profile: 'InstanceProfileIdentity' = None, - total_volume_bandwidth: int = None, - user_data: str = None, - volume_attachments: List['VolumeAttachmentPrototypeInstanceContext'] = None, - vpc: 'VPCIdentity' = None, - boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceByImageContext' = None) -> None: - """ - Initialize a InstanceTemplateInstanceByImage object. - - :param datetime created_at: The date and time that the instance template - was created. - :param str crn: The CRN for this instance template. - :param str href: The URL for this instance template. - :param str id: The unique identifier for this instance template. - :param str name: The unique user-defined name for this instance template. - :param ResourceGroupReference resource_group: The resource group for this - instance template. - :param ImageIdentity image: The image to use when provisioning the virtual - server instance. - :param NetworkInterfacePrototype primary_network_interface: Primary network - interface. - :param ZoneIdentity zone: The zone this virtual server instance will reside - in. - :param List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Keys will be made - available to the virtual server instance 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 - chosen to encrypt [the administrator - password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). - 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. - This property's value is used when provisioning the virtual server - instance, but not subsequently managed. Accordingly, it is reflected as an - [instance - initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - property. - :param List[NetworkInterfacePrototype] network_interfaces: (optional) The - additional network interfaces to create for the virtual server instance. - :param InstancePlacementTargetPrototype placement_target: (optional) The - placement restrictions to use for the virtual server instance. - :param InstanceProfileIdentity profile: (optional) The profile to use for - this virtual server instance. - :param int total_volume_bandwidth: (optional) The amount of bandwidth (in - megabits per second) allocated exclusively to instance storage volumes. An - increase in this value will result in a corresponding decrease to - `total_network_bandwidth`. - :param str user_data: (optional) User data to be made available when - setting up the virtual server instance. - :param List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: - (optional) The volume attachments for this virtual server instance. - :param VPCIdentity vpc: (optional) The VPC the virtual server instance is - to be a part of. If specified, it must match the VPC referenced by the - subnets of the instance's network interfaces. - :param VolumeAttachmentPrototypeInstanceByImageContext - boot_volume_attachment: (optional) The boot volume attachment for the - virtual server instance. - """ - # pylint: disable=super-init-not-called - self.created_at = created_at - self.crn = crn - self.href = href - self.id = id - self.keys = keys - self.name = name - self.network_interfaces = network_interfaces - self.placement_target = placement_target - self.profile = profile - self.resource_group = resource_group - self.total_volume_bandwidth = total_volume_bandwidth - self.user_data = user_data - self.volume_attachments = volume_attachments - self.vpc = vpc - self.boot_volume_attachment = boot_volume_attachment - self.image = image - self.primary_network_interface = primary_network_interface - self.zone = zone - - @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceTemplateInstanceByImage': - """Initialize a InstanceTemplateInstanceByImage object from a json dictionary.""" - args = {} - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) - else: - raise ValueError('Required property \'created_at\' not present in InstanceTemplateInstanceByImage JSON') - if 'crn' in _dict: - args['crn'] = _dict.get('crn') - else: - raise ValueError('Required property \'crn\' not present in InstanceTemplateInstanceByImage JSON') - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in InstanceTemplateInstanceByImage JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in InstanceTemplateInstanceByImage JSON') - if 'keys' in _dict: - args['keys'] = _dict.get('keys') - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in InstanceTemplateInstanceByImage JSON') - if 'network_interfaces' in _dict: - args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(x) for x in _dict.get('network_interfaces')] - if 'placement_target' in _dict: - args['placement_target'] = _dict.get('placement_target') - if 'profile' in _dict: - args['profile'] = _dict.get('profile') - if 'resource_group' in _dict: - args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) - else: - raise ValueError('Required property \'resource_group\' not present in InstanceTemplateInstanceByImage JSON') - if 'total_volume_bandwidth' in _dict: - args['total_volume_bandwidth'] = _dict.get('total_volume_bandwidth') - if 'user_data' in _dict: - args['user_data'] = _dict.get('user_data') - if 'volume_attachments' in _dict: - args['volume_attachments'] = [VolumeAttachmentPrototypeInstanceContext.from_dict(x) for x in _dict.get('volume_attachments')] - if 'vpc' in _dict: - args['vpc'] = _dict.get('vpc') - if 'boot_volume_attachment' in _dict: - args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByImageContext.from_dict(_dict.get('boot_volume_attachment')) - if 'image' in _dict: - args['image'] = _dict.get('image') - else: - raise ValueError('Required property \'image\' not present in InstanceTemplateInstanceByImage JSON') - if 'primary_network_interface' in _dict: - args['primary_network_interface'] = NetworkInterfacePrototype.from_dict(_dict.get('primary_network_interface')) - else: - raise ValueError('Required property \'primary_network_interface\' not present in InstanceTemplateInstanceByImage JSON') - if 'zone' in _dict: - args['zone'] = _dict.get('zone') - else: - raise ValueError('Required property \'zone\' not present in InstanceTemplateInstanceByImage JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a InstanceTemplateInstanceByImage object from 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, '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, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'keys') and self.keys is not None: - keys_list = [] - for x in self.keys: - if isinstance(x, dict): - keys_list.append(x) - else: - keys_list.append(x.to_dict()) - _dict['keys'] = keys_list + if hasattr(self, 'metadata_service') and self.metadata_service is not None: + _dict['metadata_service'] = self.metadata_service.to_dict() if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'network_interfaces') and self.network_interfaces is not None: @@ -70526,284 +71889,6 @@ def __ne__(self, other: 'InstanceTemplateInstanceByImage') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class InstanceTemplateInstanceByVolume(InstanceTemplate): - """ - InstanceTemplateInstanceByVolume. - - :attr datetime created_at: The date and time that the instance template was - created. - :attr str crn: The CRN for this instance template. - :attr str href: The URL for this instance template. - :attr str id: The unique identifier for this instance template. - :attr List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Keys will be made available - to the virtual server instance 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 chosen - to encrypt [the administrator - password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). 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. - This property's value is used when provisioning the virtual server instance, but - not subsequently managed. Accordingly, it is reflected as an [instance - initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - property. - :attr str name: The unique user-defined name for this instance template. - :attr List[NetworkInterfacePrototype] network_interfaces: (optional) The - additional network interfaces to create for the virtual server instance. - :attr InstancePlacementTargetPrototype placement_target: (optional) The - placement restrictions to use for the virtual server instance. - :attr InstanceProfileIdentity profile: (optional) The profile to use for this - virtual server instance. - :attr ResourceGroupReference resource_group: The resource group for this - instance template. - :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in - megabits per second) allocated exclusively to instance storage volumes. An - increase in this value will result in a corresponding decrease to - `total_network_bandwidth`. - :attr str user_data: (optional) User data to be made available when setting up - the virtual server instance. - :attr List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: - (optional) The volume attachments for this virtual server instance. - :attr VPCIdentity vpc: (optional) The VPC the virtual server instance is to be a - part of. If specified, it must match the VPC referenced by the subnets of the - instance's network interfaces. - :attr VolumeAttachmentPrototypeInstanceByVolumeContext boot_volume_attachment: - The boot volume attachment for the virtual server instance. - :attr NetworkInterfacePrototype primary_network_interface: Primary network - interface. - :attr ZoneIdentity zone: The zone this virtual server instance will reside in. - """ - - def __init__(self, - created_at: datetime, - crn: str, - href: str, - id: str, - name: str, - resource_group: 'ResourceGroupReference', - boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceByVolumeContext', - primary_network_interface: 'NetworkInterfacePrototype', - zone: 'ZoneIdentity', - *, - keys: List['KeyIdentity'] = None, - network_interfaces: List['NetworkInterfacePrototype'] = None, - placement_target: 'InstancePlacementTargetPrototype' = None, - profile: 'InstanceProfileIdentity' = None, - total_volume_bandwidth: int = None, - user_data: str = None, - volume_attachments: List['VolumeAttachmentPrototypeInstanceContext'] = None, - vpc: 'VPCIdentity' = None) -> None: - """ - Initialize a InstanceTemplateInstanceByVolume object. - - :param datetime created_at: The date and time that the instance template - was created. - :param str crn: The CRN for this instance template. - :param str href: The URL for this instance template. - :param str id: The unique identifier for this instance template. - :param str name: The unique user-defined name for this instance template. - :param ResourceGroupReference resource_group: The resource group for this - instance template. - :param VolumeAttachmentPrototypeInstanceByVolumeContext - boot_volume_attachment: The boot volume attachment for the virtual server - instance. - :param NetworkInterfacePrototype primary_network_interface: Primary network - interface. - :param ZoneIdentity zone: The zone this virtual server instance will reside - in. - :param List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Keys will be made - available to the virtual server instance 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 - chosen to encrypt [the administrator - password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). - 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. - This property's value is used when provisioning the virtual server - instance, but not subsequently managed. Accordingly, it is reflected as an - [instance - initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - property. - :param List[NetworkInterfacePrototype] network_interfaces: (optional) The - additional network interfaces to create for the virtual server instance. - :param InstancePlacementTargetPrototype placement_target: (optional) The - placement restrictions to use for the virtual server instance. - :param InstanceProfileIdentity profile: (optional) The profile to use for - this virtual server instance. - :param int total_volume_bandwidth: (optional) The amount of bandwidth (in - megabits per second) allocated exclusively to instance storage volumes. An - increase in this value will result in a corresponding decrease to - `total_network_bandwidth`. - :param str user_data: (optional) User data to be made available when - setting up the virtual server instance. - :param List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: - (optional) The volume attachments for this virtual server instance. - :param VPCIdentity vpc: (optional) The VPC the virtual server instance is - to be a part of. If specified, it must match the VPC referenced by the - subnets of the instance's network interfaces. - """ - # pylint: disable=super-init-not-called - self.created_at = created_at - self.crn = crn - self.href = href - self.id = id - self.keys = keys - self.name = name - self.network_interfaces = network_interfaces - self.placement_target = placement_target - self.profile = profile - self.resource_group = resource_group - self.total_volume_bandwidth = total_volume_bandwidth - self.user_data = user_data - self.volume_attachments = volume_attachments - self.vpc = vpc - self.boot_volume_attachment = boot_volume_attachment - self.primary_network_interface = primary_network_interface - self.zone = zone - - @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceTemplateInstanceByVolume': - """Initialize a InstanceTemplateInstanceByVolume object from a json dictionary.""" - args = {} - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) - else: - raise ValueError('Required property \'created_at\' not present in InstanceTemplateInstanceByVolume JSON') - if 'crn' in _dict: - args['crn'] = _dict.get('crn') - else: - raise ValueError('Required property \'crn\' not present in InstanceTemplateInstanceByVolume JSON') - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in InstanceTemplateInstanceByVolume JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in InstanceTemplateInstanceByVolume JSON') - if 'keys' in _dict: - args['keys'] = _dict.get('keys') - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in InstanceTemplateInstanceByVolume JSON') - if 'network_interfaces' in _dict: - args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(x) for x in _dict.get('network_interfaces')] - if 'placement_target' in _dict: - args['placement_target'] = _dict.get('placement_target') - if 'profile' in _dict: - args['profile'] = _dict.get('profile') - if 'resource_group' in _dict: - args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) - else: - raise ValueError('Required property \'resource_group\' not present in InstanceTemplateInstanceByVolume JSON') - if 'total_volume_bandwidth' in _dict: - args['total_volume_bandwidth'] = _dict.get('total_volume_bandwidth') - if 'user_data' in _dict: - args['user_data'] = _dict.get('user_data') - if 'volume_attachments' in _dict: - args['volume_attachments'] = [VolumeAttachmentPrototypeInstanceContext.from_dict(x) for x in _dict.get('volume_attachments')] - if 'vpc' in _dict: - args['vpc'] = _dict.get('vpc') - if 'boot_volume_attachment' in _dict: - args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByVolumeContext.from_dict(_dict.get('boot_volume_attachment')) - else: - raise ValueError('Required property \'boot_volume_attachment\' not present in InstanceTemplateInstanceByVolume JSON') - if 'primary_network_interface' in _dict: - args['primary_network_interface'] = NetworkInterfacePrototype.from_dict(_dict.get('primary_network_interface')) - else: - raise ValueError('Required property \'primary_network_interface\' not present in InstanceTemplateInstanceByVolume JSON') - if 'zone' in _dict: - args['zone'] = _dict.get('zone') - else: - raise ValueError('Required property \'zone\' not present in InstanceTemplateInstanceByVolume JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a InstanceTemplateInstanceByVolume object from 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, '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, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'keys') and self.keys is not None: - keys_list = [] - for x in self.keys: - if isinstance(x, dict): - keys_list.append(x) - else: - keys_list.append(x.to_dict()) - _dict['keys'] = keys_list - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'network_interfaces') and self.network_interfaces is not None: - _dict['network_interfaces'] = [x.to_dict() for x in self.network_interfaces] - if hasattr(self, 'placement_target') and self.placement_target is not None: - if isinstance(self.placement_target, dict): - _dict['placement_target'] = self.placement_target - else: - _dict['placement_target'] = self.placement_target.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: - _dict['resource_group'] = self.resource_group.to_dict() - if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None: - _dict['total_volume_bandwidth'] = self.total_volume_bandwidth - if hasattr(self, 'user_data') and self.user_data is not None: - _dict['user_data'] = self.user_data - if hasattr(self, 'volume_attachments') and self.volume_attachments is not None: - _dict['volume_attachments'] = [x.to_dict() for x in self.volume_attachments] - 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, 'boot_volume_attachment') and self.boot_volume_attachment is not None: - _dict['boot_volume_attachment'] = self.boot_volume_attachment.to_dict() - if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None: - _dict['primary_network_interface'] = self.primary_network_interface.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): - """Return a json dictionary representing this model.""" - return self.to_dict() - - def __str__(self) -> str: - """Return a `str` version of this InstanceTemplateInstanceByVolume object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'InstanceTemplateInstanceByVolume') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - - def __ne__(self, other: 'InstanceTemplateInstanceByVolume') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - class KeyIdentityByCRN(KeyIdentity): """ KeyIdentityByCRN. @@ -71035,6 +72120,64 @@ def __ne__(self, other: 'KeyIdentityById') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other +class LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName(LegacyCloudObjectStorageBucketIdentity): + """ + LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName. + + :attr str name: The globally unique name of this Cloud Object Storage bucket. + """ + + def __init__(self, + name: str) -> None: + """ + Initialize a LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName object. + + :param str name: The globally unique name of this Cloud Object Storage + bucket. + """ + # pylint: disable=super-init-not-called + self.name = name + + @classmethod + def from_dict(cls, _dict: Dict) -> 'LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName': + """Initialize a LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName object from a json dictionary.""" + args = {} + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName object from 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 LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + class LoadBalancerIdentityByCRN(LoadBalancerIdentity): """ LoadBalancerIdentityByCRN. @@ -72633,6 +73776,144 @@ class TypeEnum(str, Enum): FIXED = 'fixed' +class LoadBalancerProfileUDPSupportedDependent(LoadBalancerProfileUDPSupported): + """ + The UDP support for a load balancer with this profile depends on its configuration. + + :attr str type: The type for this profile field. + """ + + def __init__(self, + type: str) -> None: + """ + Initialize a LoadBalancerProfileUDPSupportedDependent 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) -> 'LoadBalancerProfileUDPSupportedDependent': + """Initialize a LoadBalancerProfileUDPSupportedDependent object from a json dictionary.""" + args = {} + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError('Required property \'type\' not present in LoadBalancerProfileUDPSupportedDependent JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a LoadBalancerProfileUDPSupportedDependent object from 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 LoadBalancerProfileUDPSupportedDependent object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'LoadBalancerProfileUDPSupportedDependent') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'LoadBalancerProfileUDPSupportedDependent') -> 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 LoadBalancerProfileUDPSupportedFixed(LoadBalancerProfileUDPSupported): + """ + The UDP support for a load balancer with this profile. + + :attr str type: The type for this profile field. + :attr bool value: The value for this profile field. + """ + + def __init__(self, + type: str, + value: bool) -> None: + """ + Initialize a LoadBalancerProfileUDPSupportedFixed object. + + :param str type: The type for this profile field. + :param bool value: The value for this profile field. + """ + # pylint: disable=super-init-not-called + self.type = type + self.value = value + + @classmethod + def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileUDPSupportedFixed': + """Initialize a LoadBalancerProfileUDPSupportedFixed object from a json dictionary.""" + args = {} + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError('Required property \'type\' not present in LoadBalancerProfileUDPSupportedFixed JSON') + if 'value' in _dict: + args['value'] = _dict.get('value') + else: + raise ValueError('Required property \'value\' not present in LoadBalancerProfileUDPSupportedFixed JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a LoadBalancerProfileUDPSupportedFixed object from 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 + 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 LoadBalancerProfileUDPSupportedFixed object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'LoadBalancerProfileUDPSupportedFixed') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'LoadBalancerProfileUDPSupportedFixed') -> 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 NetworkACLIdentityByCRN(NetworkACLIdentity): """ NetworkACLIdentityByCRN. @@ -75542,6 +76823,110 @@ class ProtocolEnum(str, Enum): UDP = 'udp' +class NetworkInterfaceIPPrototypeReservedIPIdentity(NetworkInterfaceIPPrototype): + """ + Identifies a reserved IP by a unique property. + + """ + + def __init__(self) -> None: + """ + Initialize a NetworkInterfaceIPPrototypeReservedIPIdentity object. + + """ + # pylint: disable=super-init-not-called + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityById', 'NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityByHref'])) + raise Exception(msg) + +class NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext(NetworkInterfaceIPPrototype): + """ + NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext. + + :attr 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. + :attr bool auto_delete: (optional) Indicates whether this reserved IP member + will be automatically deleted when either + `target` is deleted, or the reserved IP is unbound. + :attr str name: (optional) The user-defined name for this reserved IP. If + unspecified, the name will be a hyphenated list of randomly-selected words. + Names must be unique within the subnet the reserved IP resides in. Names + beginning with `ibm-` are reserved for provider-owned resources. + """ + + def __init__(self, + *, + address: str = None, + auto_delete: bool = None, + name: str = None) -> None: + """ + Initialize a NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext 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 reserved IP + member will be automatically deleted when either + `target` is deleted, or the reserved IP is unbound. + :param str name: (optional) The user-defined name for this reserved IP. If + unspecified, the name will be a hyphenated list of randomly-selected words. + Names must be unique within the subnet the reserved IP resides in. Names + beginning with `ibm-` are reserved for provider-owned resources. + """ + # pylint: disable=super-init-not-called + self.address = address + self.auto_delete = auto_delete + self.name = name + + @classmethod + def from_dict(cls, _dict: Dict) -> 'NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext': + """Initialize a NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext object from a json dictionary.""" + args = {} + if 'address' in _dict: + args['address'] = _dict.get('address') + if 'auto_delete' in _dict: + args['auto_delete'] = _dict.get('auto_delete') + if 'name' in _dict: + args['name'] = _dict.get('name') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext object from 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 NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + class OperatingSystemIdentityByHref(OperatingSystemIdentity): """ OperatingSystemIdentityByHref. @@ -76051,6 +77436,436 @@ class ResourceTypeEnum(str, Enum): ENDPOINT_GATEWAY = 'endpoint_gateway' +class ReservedIPTargetGenericResourceReference(ReservedIPTarget): + """ + Identifying information for a resource that is not native to the VPC API. + + :attr str crn: The CRN for the resource. + :attr GenericResourceReferenceDeleted deleted: (optional) If present, this + property indicates the referenced resource has been deleted and provides + some supplementary information. + :attr str resource_type: The resource type. + """ + + def __init__(self, + crn: str, + resource_type: str, + *, + deleted: 'GenericResourceReferenceDeleted' = None) -> None: + """ + Initialize a ReservedIPTargetGenericResourceReference object. + + :param str crn: The CRN for the resource. + :param str resource_type: The resource type. + :param GenericResourceReferenceDeleted 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.crn = crn + self.deleted = deleted + self.resource_type = resource_type + + @classmethod + def from_dict(cls, _dict: Dict) -> 'ReservedIPTargetGenericResourceReference': + """Initialize a ReservedIPTargetGenericResourceReference object from a json dictionary.""" + args = {} + if 'crn' in _dict: + args['crn'] = _dict.get('crn') + else: + raise ValueError('Required property \'crn\' not present in ReservedIPTargetGenericResourceReference JSON') + if 'deleted' in _dict: + args['deleted'] = GenericResourceReferenceDeleted.from_dict(_dict.get('deleted')) + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in ReservedIPTargetGenericResourceReference JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a ReservedIPTargetGenericResourceReference object from 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: + _dict['deleted'] = self.deleted.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): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this ReservedIPTargetGenericResourceReference object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ReservedIPTargetGenericResourceReference') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'ReservedIPTargetGenericResourceReference') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + CLOUD_RESOURCE = 'cloud_resource' + + +class ReservedIPTargetLoadBalancerReference(ReservedIPTarget): + """ + ReservedIPTargetLoadBalancerReference. + + :attr str crn: The load balancer's CRN. + :attr LoadBalancerReferenceDeleted deleted: (optional) If present, this property + indicates the referenced resource has been deleted and provides + some supplementary information. + :attr str href: The load balancer's canonical URL. + :attr str id: The unique identifier for this load balancer. + :attr str name: The unique user-defined name for this load balancer. + :attr str resource_type: The resource type. + """ + + def __init__(self, + crn: str, + href: str, + id: str, + name: str, + resource_type: str, + *, + deleted: 'LoadBalancerReferenceDeleted' = None) -> None: + """ + Initialize a ReservedIPTargetLoadBalancerReference object. + + :param str crn: The load balancer's CRN. + :param str href: The load balancer's canonical URL. + :param str id: The unique identifier for this load balancer. + :param str name: The unique user-defined name for this load balancer. + :param str resource_type: The resource type. + :param LoadBalancerReferenceDeleted 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.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) -> 'ReservedIPTargetLoadBalancerReference': + """Initialize a ReservedIPTargetLoadBalancerReference object from a json dictionary.""" + args = {} + if 'crn' in _dict: + args['crn'] = _dict.get('crn') + else: + raise ValueError('Required property \'crn\' not present in ReservedIPTargetLoadBalancerReference JSON') + if 'deleted' in _dict: + args['deleted'] = LoadBalancerReferenceDeleted.from_dict(_dict.get('deleted')) + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in ReservedIPTargetLoadBalancerReference JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in ReservedIPTargetLoadBalancerReference JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in ReservedIPTargetLoadBalancerReference JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in ReservedIPTargetLoadBalancerReference JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a ReservedIPTargetLoadBalancerReference object from 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: + _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 ReservedIPTargetLoadBalancerReference object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ReservedIPTargetLoadBalancerReference') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'ReservedIPTargetLoadBalancerReference') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + LOAD_BALANCER = 'load_balancer' + + +class ReservedIPTargetNetworkInterfaceReferenceTargetContext(ReservedIPTarget): + """ + ReservedIPTargetNetworkInterfaceReferenceTargetContext. + + :attr NetworkInterfaceReferenceTargetContextDeleted deleted: (optional) If + present, this property indicates the referenced resource has been deleted and + provides + some supplementary information. + :attr str href: The URL for this network interface. + :attr str id: The unique identifier for this network interface. + :attr str name: The user-defined name for this network interface. + :attr str resource_type: The resource type. + """ + + def __init__(self, + href: str, + id: str, + name: str, + resource_type: str, + *, + deleted: 'NetworkInterfaceReferenceTargetContextDeleted' = None) -> None: + """ + Initialize a ReservedIPTargetNetworkInterfaceReferenceTargetContext object. + + :param str href: The URL for this network interface. + :param str id: The unique identifier for this network interface. + :param str name: The user-defined name for this network interface. + :param str resource_type: The resource type. + :param NetworkInterfaceReferenceTargetContextDeleted 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) -> 'ReservedIPTargetNetworkInterfaceReferenceTargetContext': + """Initialize a ReservedIPTargetNetworkInterfaceReferenceTargetContext object from a json dictionary.""" + args = {} + if 'deleted' in _dict: + args['deleted'] = NetworkInterfaceReferenceTargetContextDeleted.from_dict(_dict.get('deleted')) + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in ReservedIPTargetNetworkInterfaceReferenceTargetContext JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in ReservedIPTargetNetworkInterfaceReferenceTargetContext JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in ReservedIPTargetNetworkInterfaceReferenceTargetContext JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in ReservedIPTargetNetworkInterfaceReferenceTargetContext JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a ReservedIPTargetNetworkInterfaceReferenceTargetContext object from 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: + _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 ReservedIPTargetNetworkInterfaceReferenceTargetContext object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ReservedIPTargetNetworkInterfaceReferenceTargetContext') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'ReservedIPTargetNetworkInterfaceReferenceTargetContext') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + NETWORK_INTERFACE = 'network_interface' + + +class ReservedIPTargetVPNGatewayReference(ReservedIPTarget): + """ + ReservedIPTargetVPNGatewayReference. + + :attr str crn: The VPN gateway's CRN. + :attr VPNGatewayReferenceDeleted deleted: (optional) If present, this property + indicates the referenced resource has been deleted and provides + some supplementary information. + :attr str href: The VPN gateway's canonical URL. + :attr str id: The unique identifier for this VPN gateway. + :attr str name: The user-defined name for this VPN gateway. + :attr str resource_type: The resource type. + """ + + def __init__(self, + crn: str, + href: str, + id: str, + name: str, + resource_type: str, + *, + deleted: 'VPNGatewayReferenceDeleted' = None) -> None: + """ + Initialize a ReservedIPTargetVPNGatewayReference object. + + :param str crn: The VPN gateway's CRN. + :param str href: The VPN gateway's canonical URL. + :param str id: The unique identifier for this VPN gateway. + :param str name: The user-defined name for this VPN gateway. + :param str resource_type: The resource type. + :param VPNGatewayReferenceDeleted 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.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) -> 'ReservedIPTargetVPNGatewayReference': + """Initialize a ReservedIPTargetVPNGatewayReference object from a json dictionary.""" + args = {} + if 'crn' in _dict: + args['crn'] = _dict.get('crn') + else: + raise ValueError('Required property \'crn\' not present in ReservedIPTargetVPNGatewayReference JSON') + if 'deleted' in _dict: + args['deleted'] = VPNGatewayReferenceDeleted.from_dict(_dict.get('deleted')) + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in ReservedIPTargetVPNGatewayReference JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in ReservedIPTargetVPNGatewayReference JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in ReservedIPTargetVPNGatewayReference JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in ReservedIPTargetVPNGatewayReference JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a ReservedIPTargetVPNGatewayReference object from 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: + _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 ReservedIPTargetVPNGatewayReference object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ReservedIPTargetVPNGatewayReference') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'ReservedIPTargetVPNGatewayReference') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + VPN_GATEWAY = 'vpn_gateway' + + class ResourceGroupIdentityById(ResourceGroupIdentity): """ ResourceGroupIdentityById. @@ -78227,6 +80042,7 @@ class SecurityGroupTargetReferenceLoadBalancerReference(SecurityGroupTargetRefer :attr str href: The load balancer's canonical URL. :attr str id: The unique identifier for this load balancer. :attr str name: The unique user-defined name for this load balancer. + :attr str resource_type: The resource type. """ def __init__(self, @@ -78234,6 +80050,7 @@ def __init__(self, href: str, id: str, name: str, + resource_type: str, *, deleted: 'LoadBalancerReferenceDeleted' = None) -> None: """ @@ -78243,6 +80060,7 @@ def __init__(self, :param str href: The load balancer's canonical URL. :param str id: The unique identifier for this load balancer. :param str name: The unique user-defined name for this load balancer. + :param str resource_type: The resource type. :param LoadBalancerReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted and provides some supplementary information. @@ -78253,6 +80071,7 @@ def __init__(self, self.href = href self.id = id self.name = name + self.resource_type = resource_type @classmethod def from_dict(cls, _dict: Dict) -> 'SecurityGroupTargetReferenceLoadBalancerReference': @@ -78276,6 +80095,10 @@ def from_dict(cls, _dict: Dict) -> 'SecurityGroupTargetReferenceLoadBalancerRefe args['name'] = _dict.get('name') else: raise ValueError('Required property \'name\' not present in SecurityGroupTargetReferenceLoadBalancerReference JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in SecurityGroupTargetReferenceLoadBalancerReference JSON') return cls(**args) @classmethod @@ -78296,6 +80119,8 @@ 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, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -78316,6 +80141,13 @@ def __ne__(self, other: 'SecurityGroupTargetReferenceLoadBalancerReference') -> """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + LOAD_BALANCER = 'load_balancer' + + class SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext(SecurityGroupTargetReference): """ SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext. @@ -78429,7 +80261,7 @@ class SnapshotIdentityByCRN(SnapshotIdentity): """ SnapshotIdentityByCRN. - :attr str crn: The CRN for this snapshot. + :attr str crn: The CRN of this snapshot. """ def __init__(self, @@ -78437,7 +80269,7 @@ def __init__(self, """ Initialize a SnapshotIdentityByCRN object. - :param str crn: The CRN for this snapshot. + :param str crn: The CRN of this snapshot. """ # pylint: disable=super-init-not-called self.crn = crn @@ -78596,6 +80428,100 @@ def __ne__(self, other: 'SnapshotIdentityById') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other +class SnapshotPrototypeSnapshotBySourceVolume(SnapshotPrototype): + """ + SnapshotPrototypeSnapshotBySourceVolume. + + :attr str name: (optional) The unique user-defined name for this snapshot. If + unspecified, the name will be a hyphenated list of randomly-selected words. + :attr ResourceGroupIdentity resource_group: (optional) + :attr List[str] user_tags: (optional) The user tags associated with this + snapshot. + :attr VolumeIdentity source_volume: The volume to create this snapshot from. + """ + + def __init__(self, + source_volume: 'VolumeIdentity', + *, + name: str = None, + resource_group: 'ResourceGroupIdentity' = None, + user_tags: List[str] = None) -> None: + """ + Initialize a SnapshotPrototypeSnapshotBySourceVolume object. + + :param VolumeIdentity source_volume: The volume to create this snapshot + from. + :param str name: (optional) The unique user-defined name for this snapshot. + If unspecified, the name will be a hyphenated list of randomly-selected + words. + :param ResourceGroupIdentity resource_group: (optional) + :param List[str] user_tags: (optional) The user tags associated with this + snapshot. + """ + # pylint: disable=super-init-not-called + self.name = name + self.resource_group = resource_group + self.user_tags = user_tags + self.source_volume = source_volume + + @classmethod + def from_dict(cls, _dict: Dict) -> 'SnapshotPrototypeSnapshotBySourceVolume': + """Initialize a SnapshotPrototypeSnapshotBySourceVolume object from a json dictionary.""" + args = {} + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'resource_group' in _dict: + args['resource_group'] = _dict.get('resource_group') + if 'user_tags' in _dict: + args['user_tags'] = _dict.get('user_tags') + if 'source_volume' in _dict: + args['source_volume'] = _dict.get('source_volume') + else: + raise ValueError('Required property \'source_volume\' not present in SnapshotPrototypeSnapshotBySourceVolume JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a SnapshotPrototypeSnapshotBySourceVolume object from 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, '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, 'user_tags') and self.user_tags is not None: + _dict['user_tags'] = self.user_tags + if hasattr(self, 'source_volume') and self.source_volume is not None: + if isinstance(self.source_volume, dict): + _dict['source_volume'] = self.source_volume + else: + _dict['source_volume'] = self.source_volume.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 SnapshotPrototypeSnapshotBySourceVolume object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'SnapshotPrototypeSnapshotBySourceVolume') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'SnapshotPrototypeSnapshotBySourceVolume') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + class SubnetIdentityByCRN(SubnetIdentity): """ SubnetIdentityByCRN. @@ -78789,10 +80715,10 @@ class SubnetPrototypeSubnetByCIDR(SubnetPrototype): :attr str ipv4_cidr_block: The IPv4 range of the subnet, expressed in CIDR format. The prefix length of the subnet's CIDR must be between `/9` (8,388,608 addresses) and `/29` (8 addresses). The IPv4 range of the subnet's CIDR must - fall within an existing address prefix in the VPC. The subnet will be created in - the zone of the address prefix that contains the IPv4 CIDR. If zone is - specified, it must match the zone of the address prefix that contains the - subnet's IPv4 CIDR. + fall within an existing address prefix in the VPC and must not overlap with any + existing subnet. The subnet will be created in the zone of the address prefix + that contains the IPv4 CIDR. If zone is specified, it must match the zone of the + address prefix that contains the subnet's IPv4 CIDR. :attr ZoneIdentity zone: (optional) The zone this subnet will reside in. """ @@ -78814,10 +80740,11 @@ def __init__(self, :param str ipv4_cidr_block: The IPv4 range of the subnet, expressed in CIDR format. The prefix length of the subnet's CIDR must be between `/9` (8,388,608 addresses) and `/29` (8 addresses). The IPv4 range of the - subnet's CIDR must fall within an existing address prefix in the VPC. The - subnet will be created in the zone of the address prefix that contains the - IPv4 CIDR. If zone is specified, it must match the zone of the address - prefix that contains the subnet's IPv4 CIDR. + subnet's CIDR must fall within an existing address prefix in the VPC and + must not overlap with any existing subnet. The subnet will be created in + the zone of the address prefix that contains the IPv4 CIDR. If zone is + specified, it must match the zone of the address prefix that contains the + subnet's IPv4 CIDR. :param str ip_version: (optional) The IP version(s) to support for this subnet. :param str name: (optional) The user-defined name for this subnet. Names @@ -79294,6 +81221,120 @@ def __ne__(self, other: 'SubnetPublicGatewayPatchPublicGatewayIdentityById') -> """Return `true` when self and other are not equal, false otherwise.""" return not self == other +class TrustedProfileIdentityTrustedProfileByCRN(TrustedProfileIdentity): + """ + TrustedProfileIdentityTrustedProfileByCRN. + + :attr str crn: The CRN for this trusted profile. + """ + + def __init__(self, + crn: str) -> None: + """ + Initialize a TrustedProfileIdentityTrustedProfileByCRN object. + + :param str crn: The CRN for this trusted profile. + """ + # pylint: disable=super-init-not-called + self.crn = crn + + @classmethod + def from_dict(cls, _dict: Dict) -> 'TrustedProfileIdentityTrustedProfileByCRN': + """Initialize a TrustedProfileIdentityTrustedProfileByCRN object from a json dictionary.""" + args = {} + if 'crn' in _dict: + args['crn'] = _dict.get('crn') + else: + raise ValueError('Required property \'crn\' not present in TrustedProfileIdentityTrustedProfileByCRN JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a TrustedProfileIdentityTrustedProfileByCRN object from 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): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this TrustedProfileIdentityTrustedProfileByCRN object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'TrustedProfileIdentityTrustedProfileByCRN') -> bool: + """Return `true` when 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: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + +class TrustedProfileIdentityTrustedProfileById(TrustedProfileIdentity): + """ + TrustedProfileIdentityTrustedProfileById. + + :attr str id: The unique identifier for this trusted profile. + """ + + def __init__(self, + id: str) -> None: + """ + Initialize a TrustedProfileIdentityTrustedProfileById object. + + :param str id: The unique identifier for this trusted profile. + """ + # pylint: disable=super-init-not-called + self.id = id + + @classmethod + def from_dict(cls, _dict: Dict) -> 'TrustedProfileIdentityTrustedProfileById': + """Initialize a TrustedProfileIdentityTrustedProfileById object from a json dictionary.""" + args = {} + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in TrustedProfileIdentityTrustedProfileById JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a TrustedProfileIdentityTrustedProfileById object from 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 TrustedProfileIdentityTrustedProfileById object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'TrustedProfileIdentityTrustedProfileById') -> bool: + """Return `true` when 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: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + class VPCIdentityByCRN(VPCIdentity): """ VPCIdentityByCRN. @@ -81460,132 +83501,6 @@ def __init__(self, ", ".join(['VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity', 'VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot'])) raise Exception(msg) -class VolumeAttachmentVolumePrototypeInstanceByVolumeContextVolumePrototypeInstanceByVolumeContext(VolumeAttachmentVolumePrototypeInstanceByVolumeContext): - """ - VolumeAttachmentVolumePrototypeInstanceByVolumeContextVolumePrototypeInstanceByVolumeContext. - - :attr int capacity: (optional) The capacity to use for the volume (in - gigabytes). The only allowed value is the source snapshot's `minimum_capacity`, - but the allowed values are expected to expand in the future. - If unspecified, the capacity will be the source snapshot's `minimum_capacity`. - :attr EncryptionKeyIdentity encryption_key: (optional) The root key to use to - wrap the data encryption key for the volume. - If unspecified, the snapshot's `encryption_key` will be used. - :attr int iops: (optional) The maximum I/O operations per second (IOPS) to use - for the volume. Applicable only to volumes using a profile `family` of `custom`. - :attr str name: (optional) The unique user-defined name for this volume. - :attr VolumeProfileIdentity profile: The profile to use for this volume. - :attr SnapshotIdentity source_snapshot: The snapshot from which to clone the - volume. - """ - - def __init__(self, - profile: 'VolumeProfileIdentity', - source_snapshot: 'SnapshotIdentity', - *, - capacity: int = None, - encryption_key: 'EncryptionKeyIdentity' = None, - iops: int = None, - name: str = None) -> None: - """ - Initialize a VolumeAttachmentVolumePrototypeInstanceByVolumeContextVolumePrototypeInstanceByVolumeContext object. - - :param VolumeProfileIdentity profile: The profile to use for this volume. - :param SnapshotIdentity source_snapshot: The snapshot from which to clone - the volume. - :param int capacity: (optional) The capacity to use for the volume (in - gigabytes). The only allowed value is the source snapshot's - `minimum_capacity`, but the allowed values are expected to expand in the - future. - If unspecified, the capacity will be the source snapshot's - `minimum_capacity`. - :param EncryptionKeyIdentity encryption_key: (optional) The root key to use - to wrap the data encryption key for the volume. - If unspecified, the snapshot's `encryption_key` will be used. - :param int iops: (optional) The maximum I/O operations per second (IOPS) to - use for the volume. Applicable only to volumes using a profile `family` of - `custom`. - :param str name: (optional) The unique user-defined name for this volume. - """ - # pylint: disable=super-init-not-called - self.capacity = capacity - self.encryption_key = encryption_key - self.iops = iops - self.name = name - self.profile = profile - self.source_snapshot = source_snapshot - - @classmethod - def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentVolumePrototypeInstanceByVolumeContextVolumePrototypeInstanceByVolumeContext': - """Initialize a VolumeAttachmentVolumePrototypeInstanceByVolumeContextVolumePrototypeInstanceByVolumeContext object from a json dictionary.""" - args = {} - if 'capacity' in _dict: - args['capacity'] = _dict.get('capacity') - if 'encryption_key' in _dict: - args['encryption_key'] = _dict.get('encryption_key') - if 'iops' in _dict: - args['iops'] = _dict.get('iops') - if 'name' in _dict: - args['name'] = _dict.get('name') - if 'profile' in _dict: - args['profile'] = _dict.get('profile') - else: - raise ValueError('Required property \'profile\' not present in VolumeAttachmentVolumePrototypeInstanceByVolumeContextVolumePrototypeInstanceByVolumeContext JSON') - if 'source_snapshot' in _dict: - args['source_snapshot'] = _dict.get('source_snapshot') - else: - raise ValueError('Required property \'source_snapshot\' not present in VolumeAttachmentVolumePrototypeInstanceByVolumeContextVolumePrototypeInstanceByVolumeContext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a VolumeAttachmentVolumePrototypeInstanceByVolumeContextVolumePrototypeInstanceByVolumeContext object from a json dictionary.""" - return cls.from_dict(_dict) - - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'capacity') and self.capacity is not None: - _dict['capacity'] = self.capacity - 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, 'iops') and self.iops is not None: - _dict['iops'] = self.iops - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - 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, 'source_snapshot') and self.source_snapshot is not None: - if isinstance(self.source_snapshot, dict): - _dict['source_snapshot'] = self.source_snapshot - else: - _dict['source_snapshot'] = self.source_snapshot.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 VolumeAttachmentVolumePrototypeInstanceByVolumeContextVolumePrototypeInstanceByVolumeContext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'VolumeAttachmentVolumePrototypeInstanceByVolumeContextVolumePrototypeInstanceByVolumeContext') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - - def __ne__(self, other: 'VolumeAttachmentVolumePrototypeInstanceByVolumeContextVolumePrototypeInstanceByVolumeContext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - class VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentity(VolumeAttachmentVolumePrototypeInstanceContext): """ Identifies a volume by a unique property. @@ -81925,6 +83840,7 @@ class VolumePrototypeVolumeByCapacity(VolumePrototype): :attr str name: (optional) The unique user-defined name for this volume. :attr VolumeProfileIdentity profile: The profile to use for this volume. :attr ResourceGroupIdentity resource_group: (optional) + :attr List[str] user_tags: (optional) Tags for this resource. :attr ZoneIdentity zone: The zone this volume will reside in. :attr int capacity: The capacity to use for the volume (in gigabytes). The specified minimum and maximum capacity values for creating or updating volumes @@ -81942,6 +83858,7 @@ def __init__(self, iops: int = None, name: str = None, resource_group: 'ResourceGroupIdentity' = None, + user_tags: List[str] = None, encryption_key: 'EncryptionKeyIdentity' = None) -> None: """ Initialize a VolumePrototypeVolumeByCapacity object. @@ -81956,6 +83873,7 @@ def __init__(self, `custom`. :param str name: (optional) The unique user-defined name for this volume. :param ResourceGroupIdentity resource_group: (optional) + :param List[str] user_tags: (optional) Tags for this resource. :param EncryptionKeyIdentity encryption_key: (optional) The root key to use to wrap the data encryption key for the volume. If unspecified, the `encryption` type for the volume will be @@ -81966,6 +83884,7 @@ def __init__(self, self.name = name self.profile = profile self.resource_group = resource_group + self.user_tags = user_tags self.zone = zone self.capacity = capacity self.encryption_key = encryption_key @@ -81984,6 +83903,8 @@ def from_dict(cls, _dict: Dict) -> 'VolumePrototypeVolumeByCapacity': raise ValueError('Required property \'profile\' not present in VolumePrototypeVolumeByCapacity JSON') if 'resource_group' in _dict: args['resource_group'] = _dict.get('resource_group') + if 'user_tags' in _dict: + args['user_tags'] = _dict.get('user_tags') if 'zone' in _dict: args['zone'] = _dict.get('zone') else: @@ -82018,6 +83939,8 @@ def to_dict(self) -> Dict: _dict['resource_group'] = self.resource_group else: _dict['resource_group'] = self.resource_group.to_dict() + if hasattr(self, 'user_tags') and self.user_tags is not None: + _dict['user_tags'] = self.user_tags if hasattr(self, 'zone') and self.zone is not None: if isinstance(self.zone, dict): _dict['zone'] = self.zone @@ -83625,10 +85548,10 @@ class InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHre """ InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref. - :attr int max_membership_count: (optional) The maximum number of members the - instance group should have at the scheduled time. - :attr int min_membership_count: (optional) The minimum number of members the - instance group should have at the scheduled time. + :attr int max_membership_count: (optional) The desired maximum number of + instance group members at the scheduled time. + :attr int min_membership_count: (optional) The desired minimum number of + instance group members at the scheduled time. :attr str href: The URL for this instance group manager. """ @@ -83641,10 +85564,10 @@ def __init__(self, Initialize a InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref object. :param str href: The URL for this instance group manager. - :param int max_membership_count: (optional) The maximum number of members - the instance group should have at the scheduled time. - :param int min_membership_count: (optional) The minimum number of members - the instance group should have at the scheduled time. + :param int max_membership_count: (optional) The desired maximum number of + instance group members at the scheduled time. + :param int min_membership_count: (optional) The desired minimum number of + instance group members at the scheduled time. """ # pylint: disable=super-init-not-called self.max_membership_count = max_membership_count @@ -83703,10 +85626,10 @@ class InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById( """ InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById. - :attr int max_membership_count: (optional) The maximum number of members the - instance group should have at the scheduled time. - :attr int min_membership_count: (optional) The minimum number of members the - instance group should have at the scheduled time. + :attr int max_membership_count: (optional) The desired maximum number of + instance group members at the scheduled time. + :attr int min_membership_count: (optional) The desired minimum number of + instance group members at the scheduled time. :attr str id: The unique identifier for this instance group manager. """ @@ -83719,10 +85642,10 @@ def __init__(self, Initialize a InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById object. :param str id: The unique identifier for this instance group manager. - :param int max_membership_count: (optional) The maximum number of members - the instance group should have at the scheduled time. - :param int min_membership_count: (optional) The minimum number of members - the instance group should have at the scheduled time. + :param int max_membership_count: (optional) The desired maximum number of + instance group members at the scheduled time. + :param int min_membership_count: (optional) The desired minimum number of + instance group members at the scheduled time. """ # pylint: disable=super-init-not-called self.max_membership_count = max_membership_count @@ -85031,6 +86954,120 @@ def __ne__(self, other: 'LoadBalancerPoolMemberTargetPrototypeInstanceIdentityIn """Return `true` when self and other are not equal, false otherwise.""" return not self == other +class NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityByHref(NetworkInterfaceIPPrototypeReservedIPIdentity): + """ + NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityByHref. + + :attr str href: The URL for this reserved IP. + """ + + def __init__(self, + href: str) -> None: + """ + Initialize a NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityByHref object. + + :param str href: The URL for this reserved IP. + """ + # pylint: disable=super-init-not-called + self.href = href + + @classmethod + def from_dict(cls, _dict: Dict) -> 'NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityByHref': + """Initialize a NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityByHref object from a json dictionary.""" + args = {} + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityByHref JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityByHref object from 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 NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityByHref object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityByHref') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityByHref') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + +class NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityById(NetworkInterfaceIPPrototypeReservedIPIdentity): + """ + NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityById. + + :attr str id: The unique identifier for this reserved IP. + """ + + def __init__(self, + id: str) -> None: + """ + Initialize a NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityById object. + + :param str id: The unique identifier for this reserved IP. + """ + # pylint: disable=super-init-not-called + self.id = id + + @classmethod + def from_dict(cls, _dict: Dict) -> 'NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityById': + """Initialize a NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityById object from a json dictionary.""" + args = {} + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityById JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityById object from 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 NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityById object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityById') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityById') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + class PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByAddress(PublicGatewayFloatingIPPrototypeFloatingIPIdentity): """ PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByAddress. @@ -86176,8 +88213,8 @@ class VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototy :attr str name: (optional) The unique user-defined name for this volume. :attr VolumeProfileIdentity profile: The profile to use for this volume. :attr int capacity: (optional) The capacity to use for the volume (in - gigabytes). The only allowed value is the source snapshot's `minimum_capacity`, - but the allowed values are expected to expand in the future. + gigabytes). Must be at least the snapshot's + `minimum_capacity`. The maximum value may increase in the future. If unspecified, the capacity will be the source snapshot's `minimum_capacity`. :attr EncryptionKeyIdentity encryption_key: (optional) The root key to use to wrap the data encryption key for the volume. @@ -86205,9 +88242,8 @@ def __init__(self, `custom`. :param str name: (optional) The unique user-defined name for this volume. :param int capacity: (optional) The capacity to use for the volume (in - gigabytes). The only allowed value is the source snapshot's - `minimum_capacity`, but the allowed values are expected to expand in the - future. + gigabytes). Must be at least the snapshot's + `minimum_capacity`. The maximum value may increase in the future. If unspecified, the capacity will be the source snapshot's `minimum_capacity`. :param EncryptionKeyIdentity encryption_key: (optional) The root key to use @@ -86583,8 +88619,8 @@ class VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceConte :attr str name: (optional) The unique user-defined name for this volume. :attr VolumeProfileIdentity profile: The profile to use for this volume. :attr int capacity: (optional) The capacity to use for the volume (in - gigabytes). The only allowed value is the source snapshot's `minimum_capacity`, - but the allowed values are expected to expand in the future. + gigabytes). Must be at least the snapshot's + `minimum_capacity`. The maximum value may increase in the future. If unspecified, the capacity will be the source snapshot's `minimum_capacity`. :attr EncryptionKeyIdentity encryption_key: (optional) The root key to use to wrap the data encryption key for the volume. @@ -86612,9 +88648,8 @@ def __init__(self, `custom`. :param str name: (optional) The unique user-defined name for this volume. :param int capacity: (optional) The capacity to use for the volume (in - gigabytes). The only allowed value is the source snapshot's - `minimum_capacity`, but the allowed values are expected to expand in the - future. + gigabytes). Must be at least the snapshot's + `minimum_capacity`. The maximum value may increase in the future. If unspecified, the capacity will be the source snapshot's `minimum_capacity`. :param EncryptionKeyIdentity encryption_key: (optional) The root key to use diff --git a/requirements.txt b/requirements.txt index be10031..170254d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ python_dateutil>=2.5.3,<3.0.0 -ibm_cloud_sdk_core>=3.14.0 +ibm_cloud_sdk_core>=3.15.1 diff --git a/test/integration/test_gen2.py b/test/integration/test_gen2.py index 878dcc0..f962e14 100644 --- a/test/integration/test_gen2.py +++ b/test/integration/test_gen2.py @@ -1,6 +1,6 @@ # coding: utf-8 -# (C) Copyright IBM Corp. 2020. +# (C) Copyright IBM Corp. 2020, 2021, 2022. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -379,11 +379,6 @@ def test_delete_endpoint_gateway(self, createGen2Service): createGen2Service, store['created_eg_id']) assertDeleteResponse(vpc) - def test_delete_subnet_reserved_ip(self, createGen2Service): - vpc = delete_subnet_reserved_ip( - createGen2Service, store['created_subnet'], store['created_subnet_reserved_ip']) - assertDeleteResponse(vpc) - class TestPublicGateways(): def test_create_pgw(self, createGen2Service): @@ -540,6 +535,18 @@ def test_get_bare_metal_server_nic_fip(self, createGen2Service): createGen2Service, store['created_bare_metal_server_id'], store['bms_nic_id'], store['created_fip_id']) assertGetPatchResponse(fips) + def test_list_bare_metal_server_network_interface_ips(self, createGen2Service): + pytest.skip("no env") + ips = list_bare_metal_server_network_interface_ips( + createGen2Service, store['created_bare_metal_server_id'], store['bms_nic_id']) + assertListResponse(ips, 'ips') + + def test_get_bare_metal_server_network_interface_ip(self, createGen2Service): + pytest.skip("no env") + ips = get_bare_metal_server_network_interface_ip( + createGen2Service, store['created_bare_metal_server_id'], store['bms_nic_id'], store['created_subnet_reserved_ip']) + assertGetPatchResponse(ips) + def test_delete_bare_metal_server_nic_fip(self, createGen2Service): fips = remove_bare_metal_server_network_interface_floating_ip( createGen2Service, store['created_bare_metal_server_id'], store['bms_nic_id'], store['created_fip_id']) @@ -667,6 +674,21 @@ def test_delete_instance_nic_fip(self, createGen2Service): createGen2Service, store['created_instance_id'], store['nic_id'], store['created_fip_id']) assertDeleteResponse(fips) + def test_list_instance_network_interface_ips(self, createGen2Service): + ips = list_instance_network_interface_ips( + createGen2Service, store['created_instance_id'], store['nic_id']) + assertListResponse(ips, 'ips') + + def test_get_instance_network_interface_ip(self, createGen2Service): + fips = get_instance_network_interface_ip( + createGen2Service, store['created_instance_id'], store['nic_id'], store['created_subnet_reserved_ip']) + assertGetPatchResponse(fips) + + def test_delete_subnet_reserved_ip(self, createGen2Service): + vpc = delete_subnet_reserved_ip( + createGen2Service, store['created_subnet'], store['created_subnet_reserved_ip']) + assertDeleteResponse(vpc) + def test_delete_instance_network_interface(self, createGen2Service): nics = delete_instance_network_interface( createGen2Service, store['created_instance_id'], store['created_nic']) @@ -717,28 +739,6 @@ def test_get_sg(self, createGen2Service): sg = get_security_group(createGen2Service, store['created_sg_id']) assertGetPatchResponse(sg) - def test_update_sg_network_interface(self, createGen2Service): - sg_network_interface = add_security_group_network_interface( - createGen2Service, store['created_sg_id'], store['network_interface_id']) - assertCreateResponse(sg_network_interface) - store['created_sg_network_interface_id'] = sg_network_interface.get_result()[ - 'id'] - - def test_list_sg_network_interface(self, createGen2Service): - sg_network_interface = list_security_group_network_interfaces( - createGen2Service, store['created_sg_id']) - assert sg_network_interface.status_code == 200 - - def test_get_sg_network_interface(self, createGen2Service): - sg_network_interface = get_security_group_network_interface( - createGen2Service, store['created_sg_id'], store['created_sg_network_interface_id']) - assertGetPatchResponse(sg_network_interface) - - def test_delete_sg_network_interface(self, createGen2Service): - sg_network_interface = remove_security_group_network_interface( - createGen2Service, store['created_sg_id'], store['created_sg_network_interface_id']) - assert sg_network_interface.status_code == 204 - def test_create_sg_rule(self, createGen2Service): sg_rule = create_security_group_rule( createGen2Service, store['created_sg_id']) @@ -989,7 +989,8 @@ def test_list_load_balancer_profiles(self, createGen2Service): profiles = list_load_balancer_profiles(createGen2Service) assertListResponse(profiles, 'profiles') - def test_get_load_balancer(self, createGen2Service): + def test_get_load_balancer_profile(self, createGen2Service): + pytest.skip("no env") profile = get_load_balancer_profile(createGen2Service) assertGetPatchResponse(profile) @@ -1212,7 +1213,7 @@ def test_create_instance_template(self, createGen2Service): def test_list_instance_templates(self, createGen2Service): its = list_instance_templates(createGen2Service) - assertListResponse(its, 'instance_templates') + assertListResponse(its, 'templates') def test_get_instance_template(self, createGen2Service): it = get_instance_template(createGen2Service, store['created_it']) @@ -1747,6 +1748,22 @@ def add_bare_metal_server_network_interface_floating_ip(service, bare_metal_serv ) return add_bare_metal_server_network_interface_floating_ip_response +def list_bare_metal_server_network_interface_ips(service, bare_metal_server_id, network_interface_id): + list_bare_metal_server_network_interface_floating_ip_response = service.list_bare_metal_server_network_interface_ips( + bare_metal_server_id, + network_interface_id + ) + return list_bare_metal_server_network_interface_floating_ip_response + + +def get_bare_metal_server_network_interface_ip(service, bare_metal_server_id, network_interface_id, id): + get_bare_metal_server_network_interface_ip_response = service.get_bare_metal_server_network_interface_ip( + bare_metal_server_id, + network_interface_id, + id + ) + return get_bare_metal_server_network_interface_ip_response + def remove_bare_metal_server_network_interface_floating_ip(service, bare_metal_server_id, network_interface_id, id): remove_bare_metal_server_network_interface_floating_ip_response = service.remove_bare_metal_server_network_interface_floating_ip( @@ -2195,6 +2212,26 @@ def add_instance_network_interface_floating_ip(service, instance_id, network_int instance_id, network_interface_id, id) return response +# -------------------------------------------------------- +# list_instance_network_interface_ips() +# -------------------------------------------------------- + + +def list_instance_network_interface_ips(service, instance_id, network_interface_id): + response = service.list_instance_network_interface_ips( + instance_id, network_interface_id) + return response + +# -------------------------------------------------------- +# get_instance_network_interface_ip() +# -------------------------------------------------------- + + +def get_instance_network_interface_ip(service, instance_id, network_interface_id, id): + response = service.get_instance_network_interface_ip( + instance_id, network_interface_id, id) + return response + # -------------------------------------------------------- # list_instance_volume_attachments() # -------------------------------------------------------- @@ -2273,7 +2310,7 @@ def list_load_balancer_profiles(service): def get_load_balancer_profile(service): - name = 'network-small' + name = 'network-fixed' response = service.get_load_balancer_profile(name) return response # -------------------------------------------------------- diff --git a/test/unit/test_vpc_v1.py b/test/unit/test_vpc_v1.py index 45338bf..b2b4e33 100644 --- a/test/unit/test_vpc_v1.py +++ b/test/unit/test_vpc_v1.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# (C) Copyright IBM Corp. 2021, 2022. +# (C) Copyright IBM Corp. 2022. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -4014,7 +4014,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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway: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/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "total_count": 132}' + 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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway: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/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -4062,7 +4062,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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway: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/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "total_count": 132}' + 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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway: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/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -4098,7 +4098,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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway: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/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "total_count": 132}' + 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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway: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/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -4139,7 +4139,7 @@ def test_create_subnet_reserved_ip_all_params(self): """ # Set up mock url = preprocess_url('/subnets/testString/reserved_ips') - 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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway: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/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}' + 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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway: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/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}' responses.add(responses.POST, url, body=mock_response, @@ -4152,6 +4152,7 @@ def test_create_subnet_reserved_ip_all_params(self): # Set up parameter values subnet_id = 'testString' + address = '192.168.3.4' auto_delete = False name = 'my-reserved-ip' target = reserved_ip_target_prototype_model @@ -4159,6 +4160,7 @@ def test_create_subnet_reserved_ip_all_params(self): # Invoke method response = _service.create_subnet_reserved_ip( subnet_id, + address=address, auto_delete=auto_delete, name=name, target=target, @@ -4170,6 +4172,7 @@ def test_create_subnet_reserved_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['address'] == '192.168.3.4' assert req_body['auto_delete'] == False assert req_body['name'] == 'my-reserved-ip' assert req_body['target'] == reserved_ip_target_prototype_model @@ -4190,7 +4193,7 @@ def test_create_subnet_reserved_ip_value_error(self): """ # Set up mock url = preprocess_url('/subnets/testString/reserved_ips') - 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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway: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/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}' + 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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway: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/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}' responses.add(responses.POST, url, body=mock_response, @@ -4203,6 +4206,7 @@ def test_create_subnet_reserved_ip_value_error(self): # Set up parameter values subnet_id = 'testString' + address = '192.168.3.4' auto_delete = False name = 'my-reserved-ip' target = reserved_ip_target_prototype_model @@ -4313,7 +4317,7 @@ def test_get_subnet_reserved_ip_all_params(self): """ # Set up mock url = preprocess_url('/subnets/testString/reserved_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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway: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/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}' + 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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway: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/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}' responses.add(responses.GET, url, body=mock_response, @@ -4351,7 +4355,7 @@ def test_get_subnet_reserved_ip_value_error(self): """ # Set up mock url = preprocess_url('/subnets/testString/reserved_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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway: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/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}' + 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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway: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/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}' responses.add(responses.GET, url, body=mock_response, @@ -4394,7 +4398,7 @@ def test_update_subnet_reserved_ip_all_params(self): """ # Set up mock url = preprocess_url('/subnets/testString/reserved_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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway: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/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}' + 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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway: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/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}' responses.add(responses.PATCH, url, body=mock_response, @@ -4442,7 +4446,7 @@ def test_update_subnet_reserved_ip_value_error(self): """ # Set up mock url = preprocess_url('/subnets/testString/reserved_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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway: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/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}' + 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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway: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/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}' responses.add(responses.PATCH, url, body=mock_response, @@ -5783,7 +5787,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}, "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/bc1-4x16", "memory": {"type": "fixed", "value": 16}, "name": "bc1-4x16", "os_architecture": {"default": "default", "type": "enum", "values": ["amd64"]}, "port_speed": {"type": "fixed", "value": 1000}, "total_volume_bandwidth": {"type": "fixed", "value": 20000}, "vcpu_architecture": {"default": "default", "type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}}]}' + mock_response = '{"profiles": [{"bandwidth": {"type": "fixed", "value": 20000}, "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", "os_architecture": {"default": "default", "type": "enum", "values": ["amd64"]}, "port_speed": {"type": "fixed", "value": 1000}, "total_volume_bandwidth": {"type": "fixed", "value": 20000}, "vcpu_architecture": {"default": "default", "type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}}]}' responses.add(responses.GET, url, body=mock_response, @@ -5814,7 +5818,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}, "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/bc1-4x16", "memory": {"type": "fixed", "value": 16}, "name": "bc1-4x16", "os_architecture": {"default": "default", "type": "enum", "values": ["amd64"]}, "port_speed": {"type": "fixed", "value": 1000}, "total_volume_bandwidth": {"type": "fixed", "value": 20000}, "vcpu_architecture": {"default": "default", "type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}}]}' + mock_response = '{"profiles": [{"bandwidth": {"type": "fixed", "value": 20000}, "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", "os_architecture": {"default": "default", "type": "enum", "values": ["amd64"]}, "port_speed": {"type": "fixed", "value": 1000}, "total_volume_bandwidth": {"type": "fixed", "value": 20000}, "vcpu_architecture": {"default": "default", "type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}}]}' responses.add(responses.GET, url, body=mock_response, @@ -5851,7 +5855,7 @@ def test_get_instance_profile_all_params(self): """ # Set up mock url = preprocess_url('/instance/profiles/testString') - mock_response = '{"bandwidth": {"type": "fixed", "value": 20000}, "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/bc1-4x16", "memory": {"type": "fixed", "value": 16}, "name": "bc1-4x16", "os_architecture": {"default": "default", "type": "enum", "values": ["amd64"]}, "port_speed": {"type": "fixed", "value": 1000}, "total_volume_bandwidth": {"type": "fixed", "value": 20000}, "vcpu_architecture": {"default": "default", "type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}}' + mock_response = '{"bandwidth": {"type": "fixed", "value": 20000}, "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", "os_architecture": {"default": "default", "type": "enum", "values": ["amd64"]}, "port_speed": {"type": "fixed", "value": 1000}, "total_volume_bandwidth": {"type": "fixed", "value": 20000}, "vcpu_architecture": {"default": "default", "type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}}' responses.add(responses.GET, url, body=mock_response, @@ -5887,7 +5891,7 @@ def test_get_instance_profile_value_error(self): """ # Set up mock url = preprocess_url('/instance/profiles/testString') - mock_response = '{"bandwidth": {"type": "fixed", "value": 20000}, "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/bc1-4x16", "memory": {"type": "fixed", "value": 16}, "name": "bc1-4x16", "os_architecture": {"default": "default", "type": "enum", "values": ["amd64"]}, "port_speed": {"type": "fixed", "value": 1000}, "total_volume_bandwidth": {"type": "fixed", "value": 20000}, "vcpu_architecture": {"default": "default", "type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}}' + mock_response = '{"bandwidth": {"type": "fixed", "value": 20000}, "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", "os_architecture": {"default": "default", "type": "enum", "values": ["amd64"]}, "port_speed": {"type": "fixed", "value": 1000}, "total_volume_bandwidth": {"type": "fixed", "value": 20000}, "vcpu_architecture": {"default": "default", "type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}}' responses.add(responses.GET, url, body=mock_response, @@ -5928,7 +5932,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": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "name": "my-instance-template", "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bc1-4x16"}, "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": true, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 8, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}], "total_count": 132}' + 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"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "default_trusted_profile": {"auto_link": false, "target": {"id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5"}}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "metadata_service": {"enabled": false}, "name": "my-instance-template", "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ip": {"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bx2-4x16"}, "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": true, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 250, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ip": {"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}], "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -5959,7 +5963,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": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "name": "my-instance-template", "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bc1-4x16"}, "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": true, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 8, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}], "total_count": 132}' + 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"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "default_trusted_profile": {"auto_link": false, "target": {"id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5"}}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "metadata_service": {"enabled": false}, "name": "my-instance-template", "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ip": {"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bx2-4x16"}, "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": true, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 250, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ip": {"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}], "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -5996,17 +6000,40 @@ def test_create_instance_template_all_params(self): """ # Set up mock url = preprocess_url('/instance/templates') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "name": "my-instance-template", "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bc1-4x16"}, "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": true, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 8, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}' + mock_response = '{"availability_policy": {"host_failure": "restart"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "default_trusted_profile": {"auto_link": false, "target": {"id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5"}}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "metadata_service": {"enabled": false}, "name": "my-instance-template", "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ip": {"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bx2-4x16"}, "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": true, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 250, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ip": {"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}' responses.add(responses.POST, url, body=mock_response, content_type='application/json', status=201) + # Construct a dict representation of a InstanceAvailabilityPrototype model + instance_availability_prototype_model = {} + instance_availability_prototype_model['host_failure'] = 'restart' + + # Construct a dict representation of a TrustedProfileIdentityTrustedProfileById model + trusted_profile_identity_model = {} + trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5' + + # Construct a dict representation of a InstanceDefaultTrustedProfilePrototype model + instance_default_trusted_profile_prototype_model = {} + instance_default_trusted_profile_prototype_model['auto_link'] = False + instance_default_trusted_profile_prototype_model['target'] = trusted_profile_identity_model + # Construct a dict representation of a KeyIdentityById model key_identity_model = {} key_identity_model['id'] = '363f6d70-0000-0001-0000-00000013b96c' + # Construct a dict representation of a InstanceMetadataServicePrototype model + instance_metadata_service_prototype_model = {} + instance_metadata_service_prototype_model['enabled'] = True + + # Construct a dict representation of a NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext model + network_interface_ip_prototype_model = {} + 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' + # Construct a dict representation of a SecurityGroupIdentityById model security_group_identity_model = {} security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' @@ -6019,7 +6046,7 @@ def test_create_instance_template_all_params(self): network_interface_prototype_model = {} network_interface_prototype_model['allow_ip_spoofing'] = True network_interface_prototype_model['name'] = 'my-network-interface' - network_interface_prototype_model['primary_ipv4_address'] = '10.0.0.5' + network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model network_interface_prototype_model['security_groups'] = [security_group_identity_model] network_interface_prototype_model['subnet'] = subnet_identity_model @@ -6059,7 +6086,7 @@ def test_create_instance_template_all_params(self): # Construct a dict representation of a VolumePrototypeInstanceByImageContext model volume_prototype_instance_by_image_context_model = {} - volume_prototype_instance_by_image_context_model['capacity'] = 38 + volume_prototype_instance_by_image_context_model['capacity'] = 250 volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model volume_prototype_instance_by_image_context_model['iops'] = 10000 volume_prototype_instance_by_image_context_model['name'] = 'my-volume' @@ -6081,7 +6108,10 @@ def test_create_instance_template_all_params(self): # Construct a dict representation of a InstanceTemplatePrototypeInstanceByImage model instance_template_prototype_model = {} + instance_template_prototype_model['availability_policy'] = instance_availability_prototype_model + instance_template_prototype_model['default_trusted_profile'] = instance_default_trusted_profile_prototype_model instance_template_prototype_model['keys'] = [key_identity_model] + instance_template_prototype_model['metadata_service'] = instance_metadata_service_prototype_model instance_template_prototype_model['name'] = 'my-instance-template' instance_template_prototype_model['network_interfaces'] = [network_interface_prototype_model] instance_template_prototype_model['placement_target'] = instance_placement_target_prototype_model @@ -6128,17 +6158,40 @@ def test_create_instance_template_value_error(self): """ # Set up mock url = preprocess_url('/instance/templates') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "name": "my-instance-template", "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bc1-4x16"}, "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": true, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 8, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}' + mock_response = '{"availability_policy": {"host_failure": "restart"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "default_trusted_profile": {"auto_link": false, "target": {"id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5"}}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "metadata_service": {"enabled": false}, "name": "my-instance-template", "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ip": {"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bx2-4x16"}, "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": true, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 250, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ip": {"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}' responses.add(responses.POST, url, body=mock_response, content_type='application/json', status=201) + # Construct a dict representation of a InstanceAvailabilityPrototype model + instance_availability_prototype_model = {} + instance_availability_prototype_model['host_failure'] = 'restart' + + # Construct a dict representation of a TrustedProfileIdentityTrustedProfileById model + trusted_profile_identity_model = {} + trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5' + + # Construct a dict representation of a InstanceDefaultTrustedProfilePrototype model + instance_default_trusted_profile_prototype_model = {} + instance_default_trusted_profile_prototype_model['auto_link'] = False + instance_default_trusted_profile_prototype_model['target'] = trusted_profile_identity_model + # Construct a dict representation of a KeyIdentityById model key_identity_model = {} key_identity_model['id'] = '363f6d70-0000-0001-0000-00000013b96c' + # Construct a dict representation of a InstanceMetadataServicePrototype model + instance_metadata_service_prototype_model = {} + instance_metadata_service_prototype_model['enabled'] = True + + # Construct a dict representation of a NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext model + network_interface_ip_prototype_model = {} + 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' + # Construct a dict representation of a SecurityGroupIdentityById model security_group_identity_model = {} security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' @@ -6151,7 +6204,7 @@ def test_create_instance_template_value_error(self): network_interface_prototype_model = {} network_interface_prototype_model['allow_ip_spoofing'] = True network_interface_prototype_model['name'] = 'my-network-interface' - network_interface_prototype_model['primary_ipv4_address'] = '10.0.0.5' + network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model network_interface_prototype_model['security_groups'] = [security_group_identity_model] network_interface_prototype_model['subnet'] = subnet_identity_model @@ -6191,7 +6244,7 @@ def test_create_instance_template_value_error(self): # Construct a dict representation of a VolumePrototypeInstanceByImageContext model volume_prototype_instance_by_image_context_model = {} - volume_prototype_instance_by_image_context_model['capacity'] = 38 + volume_prototype_instance_by_image_context_model['capacity'] = 250 volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model volume_prototype_instance_by_image_context_model['iops'] = 10000 volume_prototype_instance_by_image_context_model['name'] = 'my-volume' @@ -6213,7 +6266,10 @@ def test_create_instance_template_value_error(self): # Construct a dict representation of a InstanceTemplatePrototypeInstanceByImage model instance_template_prototype_model = {} + instance_template_prototype_model['availability_policy'] = instance_availability_prototype_model + instance_template_prototype_model['default_trusted_profile'] = instance_default_trusted_profile_prototype_model instance_template_prototype_model['keys'] = [key_identity_model] + instance_template_prototype_model['metadata_service'] = instance_metadata_service_prototype_model instance_template_prototype_model['name'] = 'my-instance-template' instance_template_prototype_model['network_interfaces'] = [network_interface_prototype_model] instance_template_prototype_model['placement_target'] = instance_placement_target_prototype_model @@ -6333,7 +6389,7 @@ def test_get_instance_template_all_params(self): """ # Set up mock url = preprocess_url('/instance/templates/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "name": "my-instance-template", "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bc1-4x16"}, "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": true, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 8, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}' + mock_response = '{"availability_policy": {"host_failure": "restart"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "default_trusted_profile": {"auto_link": false, "target": {"id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5"}}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "metadata_service": {"enabled": false}, "name": "my-instance-template", "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ip": {"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bx2-4x16"}, "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": true, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 250, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ip": {"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}' responses.add(responses.GET, url, body=mock_response, @@ -6369,7 +6425,7 @@ def test_get_instance_template_value_error(self): """ # Set up mock url = preprocess_url('/instance/templates/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "name": "my-instance-template", "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bc1-4x16"}, "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": true, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 8, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}' + mock_response = '{"availability_policy": {"host_failure": "restart"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "default_trusted_profile": {"auto_link": false, "target": {"id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5"}}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "metadata_service": {"enabled": false}, "name": "my-instance-template", "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ip": {"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bx2-4x16"}, "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": true, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 250, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ip": {"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}' responses.add(responses.GET, url, body=mock_response, @@ -6410,7 +6466,7 @@ def test_update_instance_template_all_params(self): """ # Set up mock url = preprocess_url('/instance/templates/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "name": "my-instance-template", "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bc1-4x16"}, "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": true, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 8, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}' + mock_response = '{"availability_policy": {"host_failure": "restart"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "default_trusted_profile": {"auto_link": false, "target": {"id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5"}}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "metadata_service": {"enabled": false}, "name": "my-instance-template", "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ip": {"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bx2-4x16"}, "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": true, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 250, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ip": {"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}' responses.add(responses.PATCH, url, body=mock_response, @@ -6455,7 +6511,7 @@ def test_update_instance_template_value_error(self): """ # Set up mock url = preprocess_url('/instance/templates/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "name": "my-instance-template", "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bc1-4x16"}, "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": true, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 8, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}' + mock_response = '{"availability_policy": {"host_failure": "restart"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "default_trusted_profile": {"auto_link": false, "target": {"id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5"}}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "metadata_service": {"enabled": false}, "name": "my-instance-template", "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ip": {"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bx2-4x16"}, "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": true, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 250, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ip": {"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}' responses.add(responses.PATCH, url, body=mock_response, @@ -6502,7 +6558,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": [{"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/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "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}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "name": "my-instance", "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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::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_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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "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}, "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/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-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": "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/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "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}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "metadata_service": {"enabled": false}, "name": "my-instance", "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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::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_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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "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}, "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/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-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}' responses.add(responses.GET, url, body=mock_response, @@ -6578,7 +6634,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": [{"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/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "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}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "name": "my-instance", "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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::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_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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "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}, "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/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-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": "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/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "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}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "metadata_service": {"enabled": false}, "name": "my-instance", "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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::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_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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "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}, "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/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-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}' responses.add(responses.GET, url, body=mock_response, @@ -6609,7 +6665,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": [{"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/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "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}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "name": "my-instance", "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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::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_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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "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}, "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/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-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": "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/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "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}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "metadata_service": {"enabled": false}, "name": "my-instance", "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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::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_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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "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}, "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/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-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}' responses.add(responses.GET, url, body=mock_response, @@ -6646,17 +6702,40 @@ def test_create_instance_all_params(self): """ # Set up mock url = preprocess_url('/instances') - mock_response = '{"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/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "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}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "name": "my-instance", "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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::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_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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "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}, "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/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-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": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "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}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "metadata_service": {"enabled": false}, "name": "my-instance", "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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::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_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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "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}, "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/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-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, body=mock_response, content_type='application/json', status=201) + # Construct a dict representation of a InstanceAvailabilityPrototype model + instance_availability_prototype_model = {} + instance_availability_prototype_model['host_failure'] = 'restart' + + # Construct a dict representation of a TrustedProfileIdentityTrustedProfileById model + trusted_profile_identity_model = {} + trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5' + + # Construct a dict representation of a InstanceDefaultTrustedProfilePrototype model + instance_default_trusted_profile_prototype_model = {} + instance_default_trusted_profile_prototype_model['auto_link'] = False + instance_default_trusted_profile_prototype_model['target'] = trusted_profile_identity_model + # Construct a dict representation of a KeyIdentityById model key_identity_model = {} key_identity_model['id'] = '363f6d70-0000-0001-0000-00000013b96c' + # Construct a dict representation of a InstanceMetadataServicePrototype model + instance_metadata_service_prototype_model = {} + instance_metadata_service_prototype_model['enabled'] = True + + # Construct a dict representation of a NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext model + network_interface_ip_prototype_model = {} + 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' + # Construct a dict representation of a SecurityGroupIdentityById model security_group_identity_model = {} security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' @@ -6669,7 +6748,7 @@ def test_create_instance_all_params(self): network_interface_prototype_model = {} network_interface_prototype_model['allow_ip_spoofing'] = True network_interface_prototype_model['name'] = 'my-network-interface' - network_interface_prototype_model['primary_ipv4_address'] = '10.0.0.5' + network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model network_interface_prototype_model['security_groups'] = [security_group_identity_model] network_interface_prototype_model['subnet'] = subnet_identity_model @@ -6713,7 +6792,7 @@ def test_create_instance_all_params(self): # Construct a dict representation of a VolumePrototypeInstanceByImageContext model volume_prototype_instance_by_image_context_model = {} - volume_prototype_instance_by_image_context_model['capacity'] = 38 + volume_prototype_instance_by_image_context_model['capacity'] = 250 volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model volume_prototype_instance_by_image_context_model['iops'] = 10000 volume_prototype_instance_by_image_context_model['name'] = 'my-boot-volume' @@ -6735,7 +6814,10 @@ def test_create_instance_all_params(self): # Construct a dict representation of a InstancePrototypeInstanceByImage model instance_prototype_model = {} + instance_prototype_model['availability_policy'] = instance_availability_prototype_model + instance_prototype_model['default_trusted_profile'] = instance_default_trusted_profile_prototype_model instance_prototype_model['keys'] = [key_identity_model] + instance_prototype_model['metadata_service'] = instance_metadata_service_prototype_model instance_prototype_model['name'] = 'my-instance' instance_prototype_model['network_interfaces'] = [network_interface_prototype_model] instance_prototype_model['placement_target'] = instance_placement_target_prototype_model @@ -6782,17 +6864,40 @@ def test_create_instance_value_error(self): """ # Set up mock url = preprocess_url('/instances') - mock_response = '{"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/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "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}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "name": "my-instance", "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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::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_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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "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}, "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/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-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": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "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}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "metadata_service": {"enabled": false}, "name": "my-instance", "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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::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_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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "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}, "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/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-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, body=mock_response, content_type='application/json', status=201) + # Construct a dict representation of a InstanceAvailabilityPrototype model + instance_availability_prototype_model = {} + instance_availability_prototype_model['host_failure'] = 'restart' + + # Construct a dict representation of a TrustedProfileIdentityTrustedProfileById model + trusted_profile_identity_model = {} + trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5' + + # Construct a dict representation of a InstanceDefaultTrustedProfilePrototype model + instance_default_trusted_profile_prototype_model = {} + instance_default_trusted_profile_prototype_model['auto_link'] = False + instance_default_trusted_profile_prototype_model['target'] = trusted_profile_identity_model + # Construct a dict representation of a KeyIdentityById model key_identity_model = {} key_identity_model['id'] = '363f6d70-0000-0001-0000-00000013b96c' + # Construct a dict representation of a InstanceMetadataServicePrototype model + instance_metadata_service_prototype_model = {} + instance_metadata_service_prototype_model['enabled'] = True + + # Construct a dict representation of a NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext model + network_interface_ip_prototype_model = {} + 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' + # Construct a dict representation of a SecurityGroupIdentityById model security_group_identity_model = {} security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' @@ -6805,7 +6910,7 @@ def test_create_instance_value_error(self): network_interface_prototype_model = {} network_interface_prototype_model['allow_ip_spoofing'] = True network_interface_prototype_model['name'] = 'my-network-interface' - network_interface_prototype_model['primary_ipv4_address'] = '10.0.0.5' + network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model network_interface_prototype_model['security_groups'] = [security_group_identity_model] network_interface_prototype_model['subnet'] = subnet_identity_model @@ -6849,7 +6954,7 @@ def test_create_instance_value_error(self): # Construct a dict representation of a VolumePrototypeInstanceByImageContext model volume_prototype_instance_by_image_context_model = {} - volume_prototype_instance_by_image_context_model['capacity'] = 38 + volume_prototype_instance_by_image_context_model['capacity'] = 250 volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model volume_prototype_instance_by_image_context_model['iops'] = 10000 volume_prototype_instance_by_image_context_model['name'] = 'my-boot-volume' @@ -6871,7 +6976,10 @@ def test_create_instance_value_error(self): # Construct a dict representation of a InstancePrototypeInstanceByImage model instance_prototype_model = {} + instance_prototype_model['availability_policy'] = instance_availability_prototype_model + instance_prototype_model['default_trusted_profile'] = instance_default_trusted_profile_prototype_model instance_prototype_model['keys'] = [key_identity_model] + instance_prototype_model['metadata_service'] = instance_metadata_service_prototype_model instance_prototype_model['name'] = 'my-instance' instance_prototype_model['network_interfaces'] = [network_interface_prototype_model] instance_prototype_model['placement_target'] = instance_placement_target_prototype_model @@ -6991,7 +7099,7 @@ def test_get_instance_all_params(self): """ # Set up mock url = preprocess_url('/instances/testString') - mock_response = '{"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/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "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}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "name": "my-instance", "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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::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_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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "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}, "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/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-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": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "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}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "metadata_service": {"enabled": false}, "name": "my-instance", "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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::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_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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "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}, "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/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-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, @@ -7027,7 +7135,7 @@ def test_get_instance_value_error(self): """ # Set up mock url = preprocess_url('/instances/testString') - mock_response = '{"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/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "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}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "name": "my-instance", "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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::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_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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "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}, "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/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-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": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "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}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "metadata_service": {"enabled": false}, "name": "my-instance", "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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::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_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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "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}, "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/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-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, @@ -7068,23 +7176,33 @@ def test_update_instance_all_params(self): """ # Set up mock url = preprocess_url('/instances/testString') - mock_response = '{"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/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "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}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "name": "my-instance", "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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::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_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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "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}, "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/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-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": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "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}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "metadata_service": {"enabled": false}, "name": "my-instance", "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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::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_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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "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}, "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/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-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 InstanceAvailabilityPolicyPatch model + instance_availability_policy_patch_model = {} + instance_availability_policy_patch_model['host_failure'] = 'restart' + + # Construct a dict representation of a InstanceMetadataServicePatch model + instance_metadata_service_patch_model = {} + instance_metadata_service_patch_model['enabled'] = True + # Construct a dict representation of a InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById model instance_placement_target_patch_model = {} instance_placement_target_patch_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' # Construct a dict representation of a InstancePatchProfileInstanceProfileIdentityByName model instance_patch_profile_model = {} - instance_patch_profile_model['name'] = 'bc1-4x16' + instance_patch_profile_model['name'] = 'bx2-4x16' # Construct a dict representation of a InstancePatch model instance_patch_model = {} + instance_patch_model['availability_policy'] = instance_availability_policy_patch_model + instance_patch_model['metadata_service'] = instance_metadata_service_patch_model instance_patch_model['name'] = 'my-instance' instance_patch_model['placement_target'] = instance_placement_target_patch_model instance_patch_model['profile'] = instance_patch_profile_model @@ -7124,23 +7242,33 @@ def test_update_instance_value_error(self): """ # Set up mock url = preprocess_url('/instances/testString') - mock_response = '{"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/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "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}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "name": "my-instance", "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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::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_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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "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}, "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/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-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": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "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}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "metadata_service": {"enabled": false}, "name": "my-instance", "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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::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_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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "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}, "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/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-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 InstanceAvailabilityPolicyPatch model + instance_availability_policy_patch_model = {} + instance_availability_policy_patch_model['host_failure'] = 'restart' + + # Construct a dict representation of a InstanceMetadataServicePatch model + instance_metadata_service_patch_model = {} + instance_metadata_service_patch_model['enabled'] = True + # Construct a dict representation of a InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById model instance_placement_target_patch_model = {} instance_placement_target_patch_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' # Construct a dict representation of a InstancePatchProfileInstanceProfileIdentityByName model instance_patch_profile_model = {} - instance_patch_profile_model['name'] = 'bc1-4x16' + instance_patch_profile_model['name'] = 'bx2-4x16' # Construct a dict representation of a InstancePatch model instance_patch_model = {} + instance_patch_model['availability_policy'] = instance_availability_policy_patch_model + instance_patch_model['metadata_service'] = instance_metadata_service_patch_model instance_patch_model['name'] = 'my-instance' instance_patch_model['placement_target'] = instance_placement_target_patch_model instance_patch_model['profile'] = instance_patch_profile_model @@ -7182,7 +7310,7 @@ def test_get_instance_initialization_all_params(self): """ # Set up mock url = preprocess_url('/instances/testString/initialization') - mock_response = '{"keys": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "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/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-key"}], "password": {"encrypted_password": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "encryption_key": {"fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY"}}}' + mock_response = '{"default_trusted_profile": {"auto_link": true, "target": {"crn": "crn:v1:bluemix:public:iam-identity::a/123456::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/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "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/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-key"}], "password": {"encrypted_password": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "encryption_key": {"fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY"}}}' responses.add(responses.GET, url, body=mock_response, @@ -7218,7 +7346,7 @@ def test_get_instance_initialization_value_error(self): """ # Set up mock url = preprocess_url('/instances/testString/initialization') - mock_response = '{"keys": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "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/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-key"}], "password": {"encrypted_password": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "encryption_key": {"fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY"}}}' + mock_response = '{"default_trusted_profile": {"auto_link": true, "target": {"crn": "crn:v1:bluemix:public:iam-identity::a/123456::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/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "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/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-key"}], "password": {"encrypted_password": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "encryption_key": {"fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY"}}}' responses.add(responses.GET, url, body=mock_response, @@ -7689,7 +7817,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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary"}]}' responses.add(responses.GET, url, body=mock_response, @@ -7725,7 +7853,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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary"}]}' responses.add(responses.GET, url, body=mock_response, @@ -7766,7 +7894,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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary"}' responses.add(responses.POST, url, body=mock_response, @@ -7777,6 +7905,12 @@ def test_create_instance_network_interface_all_params(self): subnet_identity_model = {} subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + # Construct a dict representation of a NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext model + network_interface_ip_prototype_model = {} + 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' + # Construct a dict representation of a SecurityGroupIdentityById model security_group_identity_model = {} security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' @@ -7786,7 +7920,7 @@ def test_create_instance_network_interface_all_params(self): subnet = subnet_identity_model allow_ip_spoofing = True name = 'my-network-interface' - primary_ipv4_address = '10.0.0.5' + primary_ip = network_interface_ip_prototype_model security_groups = [security_group_identity_model] # Invoke method @@ -7795,7 +7929,7 @@ def test_create_instance_network_interface_all_params(self): subnet, allow_ip_spoofing=allow_ip_spoofing, name=name, - primary_ipv4_address=primary_ipv4_address, + primary_ip=primary_ip, security_groups=security_groups, headers={} ) @@ -7808,7 +7942,7 @@ def test_create_instance_network_interface_all_params(self): assert req_body['subnet'] == subnet_identity_model assert req_body['allow_ip_spoofing'] == True assert req_body['name'] == 'my-network-interface' - assert req_body['primary_ipv4_address'] == '10.0.0.5' + assert req_body['primary_ip'] == network_interface_ip_prototype_model assert req_body['security_groups'] == [security_group_identity_model] def test_create_instance_network_interface_all_params_with_retries(self): @@ -7827,7 +7961,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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary"}' responses.add(responses.POST, url, body=mock_response, @@ -7838,6 +7972,12 @@ def test_create_instance_network_interface_value_error(self): subnet_identity_model = {} subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + # Construct a dict representation of a NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext model + network_interface_ip_prototype_model = {} + 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' + # Construct a dict representation of a SecurityGroupIdentityById model security_group_identity_model = {} security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' @@ -7847,7 +7987,7 @@ def test_create_instance_network_interface_value_error(self): subnet = subnet_identity_model allow_ip_spoofing = True name = 'my-network-interface' - primary_ipv4_address = '10.0.0.5' + primary_ip = network_interface_ip_prototype_model security_groups = [security_group_identity_model] # Pass in all but one required param and check for a ValueError @@ -7957,7 +8097,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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary"}' responses.add(responses.GET, url, body=mock_response, @@ -7995,7 +8135,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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary"}' responses.add(responses.GET, url, body=mock_response, @@ -8038,7 +8178,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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary"}' responses.add(responses.PATCH, url, body=mock_response, @@ -8086,7 +8226,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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary"}' responses.add(responses.PATCH, url, body=mock_response, @@ -8136,7 +8276,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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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_response, @@ -8174,7 +8314,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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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_response, @@ -8296,7 +8436,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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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_response, @@ -8336,7 +8476,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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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_response, @@ -8381,7 +8521,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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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, body=mock_response, @@ -8421,7 +8561,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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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, body=mock_response, @@ -8454,6 +8594,219 @@ def test_add_instance_network_interface_floating_ip_value_error_with_retries(sel _service.disable_retries() self.test_add_instance_network_interface_floating_ip_value_error() +class TestListInstanceNetworkInterfaceIps(): + """ + Test Class for list_instance_network_interface_ips + """ + + @responses.activate + def test_list_instance_network_interface_ips_all_params(self): + """ + list_instance_network_interface_ips() + """ + # 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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway: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/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "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}' + responses.add(responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200) + + # Set up parameter values + instance_id = 'testString' + network_interface_id = 'testString' + start = 'testString' + limit = 1 + + # Invoke method + response = _service.list_instance_network_interface_ips( + instance_id, + network_interface_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_network_interface_ips_all_params_with_retries(self): + # Enable retries and run test_list_instance_network_interface_ips_all_params. + _service.enable_retries() + self.test_list_instance_network_interface_ips_all_params() + + # Disable retries and run test_list_instance_network_interface_ips_all_params. + _service.disable_retries() + self.test_list_instance_network_interface_ips_all_params() + + @responses.activate + def test_list_instance_network_interface_ips_required_params(self): + """ + test_list_instance_network_interface_ips_required_params() + """ + # 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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway: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/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "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}' + responses.add(responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200) + + # Set up parameter values + instance_id = 'testString' + network_interface_id = 'testString' + + # Invoke method + response = _service.list_instance_network_interface_ips( + instance_id, + network_interface_id, + headers={} + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + def test_list_instance_network_interface_ips_required_params_with_retries(self): + # Enable retries and run test_list_instance_network_interface_ips_required_params. + _service.enable_retries() + self.test_list_instance_network_interface_ips_required_params() + + # Disable retries and run test_list_instance_network_interface_ips_required_params. + _service.disable_retries() + self.test_list_instance_network_interface_ips_required_params() + + @responses.activate + def test_list_instance_network_interface_ips_value_error(self): + """ + test_list_instance_network_interface_ips_value_error() + """ + # 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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway: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/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "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}' + responses.add(responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200) + + # Set up parameter values + instance_id = 'testString' + network_interface_id = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "instance_id": instance_id, + "network_interface_id": network_interface_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_network_interface_ips(**req_copy) + + + def test_list_instance_network_interface_ips_value_error_with_retries(self): + # Enable retries and run test_list_instance_network_interface_ips_value_error. + _service.enable_retries() + self.test_list_instance_network_interface_ips_value_error() + + # Disable retries and run test_list_instance_network_interface_ips_value_error. + _service.disable_retries() + self.test_list_instance_network_interface_ips_value_error() + +class TestGetInstanceNetworkInterfaceIp(): + """ + Test Class for get_instance_network_interface_ip + """ + + @responses.activate + def test_get_instance_network_interface_ip_all_params(self): + """ + get_instance_network_interface_ip() + """ + # Set up mock + url = preprocess_url('/instances/testString/network_interfaces/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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway: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/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}' + responses.add(responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200) + + # Set up parameter values + instance_id = 'testString' + network_interface_id = 'testString' + id = 'testString' + + # Invoke method + response = _service.get_instance_network_interface_ip( + instance_id, + network_interface_id, + id, + headers={} + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + def test_get_instance_network_interface_ip_all_params_with_retries(self): + # Enable retries and run test_get_instance_network_interface_ip_all_params. + _service.enable_retries() + self.test_get_instance_network_interface_ip_all_params() + + # Disable retries and run test_get_instance_network_interface_ip_all_params. + _service.disable_retries() + self.test_get_instance_network_interface_ip_all_params() + + @responses.activate + def test_get_instance_network_interface_ip_value_error(self): + """ + test_get_instance_network_interface_ip_value_error() + """ + # Set up mock + url = preprocess_url('/instances/testString/network_interfaces/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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway: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/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}' + responses.add(responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200) + + # Set up parameter values + instance_id = 'testString' + network_interface_id = 'testString' + id = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "instance_id": instance_id, + "network_interface_id": network_interface_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_network_interface_ip(**req_copy) + + + def test_get_instance_network_interface_ip_value_error_with_retries(self): + # Enable retries and run test_get_instance_network_interface_ip_value_error. + _service.enable_retries() + self.test_get_instance_network_interface_ip_value_error() + + # Disable retries and run test_get_instance_network_interface_ip_value_error. + _service.disable_retries() + self.test_get_instance_network_interface_ip_value_error() + class TestListInstanceVolumeAttachments(): """ Test Class for list_instance_volume_attachments @@ -11577,7 +11930,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": "mx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "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/bc1-4x16", "name": "bc1-4x16"}], "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": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups?limit=20"}, "groups": [{"class": "mx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "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"}], "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}' responses.add(responses.GET, url, body=mock_response, @@ -11629,7 +11982,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": "mx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "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/bc1-4x16", "name": "bc1-4x16"}], "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": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups?limit=20"}, "groups": [{"class": "mx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "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"}], "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}' responses.add(responses.GET, url, body=mock_response, @@ -11660,7 +12013,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": "mx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "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/bc1-4x16", "name": "bc1-4x16"}], "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": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups?limit=20"}, "groups": [{"class": "mx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "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"}], "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}' responses.add(responses.GET, url, body=mock_response, @@ -11697,7 +12050,7 @@ def test_create_dedicated_host_group_all_params(self): """ # Set up mock url = preprocess_url('/dedicated_host/groups') - mock_response = '{"class": "mx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "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/bc1-4x16", "name": "bc1-4x16"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"class": "mx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "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"}], "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, body=mock_response, @@ -11756,7 +12109,7 @@ def test_create_dedicated_host_group_required_params(self): """ # Set up mock url = preprocess_url('/dedicated_host/groups') - mock_response = '{"class": "mx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "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/bc1-4x16", "name": "bc1-4x16"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"class": "mx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "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"}], "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, body=mock_response, @@ -11787,7 +12140,7 @@ def test_create_dedicated_host_group_value_error(self): """ # Set up mock url = preprocess_url('/dedicated_host/groups') - mock_response = '{"class": "mx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "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/bc1-4x16", "name": "bc1-4x16"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"class": "mx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "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"}], "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, body=mock_response, @@ -11895,7 +12248,7 @@ def test_get_dedicated_host_group_all_params(self): """ # Set up mock url = preprocess_url('/dedicated_host/groups/testString') - mock_response = '{"class": "mx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "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/bc1-4x16", "name": "bc1-4x16"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"class": "mx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "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"}], "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, @@ -11931,7 +12284,7 @@ def test_get_dedicated_host_group_value_error(self): """ # Set up mock url = preprocess_url('/dedicated_host/groups/testString') - mock_response = '{"class": "mx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "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/bc1-4x16", "name": "bc1-4x16"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"class": "mx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "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"}], "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, @@ -11972,7 +12325,7 @@ def test_update_dedicated_host_group_all_params(self): """ # Set up mock url = preprocess_url('/dedicated_host/groups/testString') - mock_response = '{"class": "mx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "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/bc1-4x16", "name": "bc1-4x16"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"class": "mx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "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"}], "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, @@ -12017,7 +12370,7 @@ def test_update_dedicated_host_group_value_error(self): """ # Set up mock url = preprocess_url('/dedicated_host/groups/testString') - mock_response = '{"class": "mx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "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/bc1-4x16", "name": "bc1-4x16"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"class": "mx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "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"}], "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, @@ -12064,7 +12417,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": "mx2", "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/1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": {"type": "fixed", "value": 16}, "name": "mx2-host-152x1216", "socket_count": {"type": "fixed", "value": 2}, "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "vcpu_architecture": {"type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}}], "total_count": 132}' + 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": "mx2", "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/1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": {"type": "fixed", "value": 16}, "name": "mx2-host-152x1216", "socket_count": {"type": "fixed", "value": 2}, "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}], "vcpu_architecture": {"type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}}], "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -12107,7 +12460,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": "mx2", "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/1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": {"type": "fixed", "value": 16}, "name": "mx2-host-152x1216", "socket_count": {"type": "fixed", "value": 2}, "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "vcpu_architecture": {"type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}}], "total_count": 132}' + 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": "mx2", "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/1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": {"type": "fixed", "value": 16}, "name": "mx2-host-152x1216", "socket_count": {"type": "fixed", "value": 2}, "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}], "vcpu_architecture": {"type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}}], "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -12138,7 +12491,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": "mx2", "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/1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": {"type": "fixed", "value": 16}, "name": "mx2-host-152x1216", "socket_count": {"type": "fixed", "value": 2}, "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "vcpu_architecture": {"type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}}], "total_count": 132}' + 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": "mx2", "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/1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": {"type": "fixed", "value": 16}, "name": "mx2-host-152x1216", "socket_count": {"type": "fixed", "value": 2}, "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}], "vcpu_architecture": {"type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}}], "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -12175,7 +12528,7 @@ def test_get_dedicated_host_profile_all_params(self): """ # Set up mock url = preprocess_url('/dedicated_host/profiles/testString') - mock_response = '{"class": "mx2", "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/1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": {"type": "fixed", "value": 16}, "name": "mx2-host-152x1216", "socket_count": {"type": "fixed", "value": 2}, "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "vcpu_architecture": {"type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}}' + mock_response = '{"class": "mx2", "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/1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": {"type": "fixed", "value": 16}, "name": "mx2-host-152x1216", "socket_count": {"type": "fixed", "value": 2}, "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}], "vcpu_architecture": {"type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}}' responses.add(responses.GET, url, body=mock_response, @@ -12211,7 +12564,7 @@ def test_get_dedicated_host_profile_value_error(self): """ # Set up mock url = preprocess_url('/dedicated_host/profiles/testString') - mock_response = '{"class": "mx2", "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/1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": {"type": "fixed", "value": 16}, "name": "mx2-host-152x1216", "socket_count": {"type": "fixed", "value": 2}, "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "vcpu_architecture": {"type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}}' + mock_response = '{"class": "mx2", "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/1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": {"type": "fixed", "value": 16}, "name": "mx2-host-152x1216", "socket_count": {"type": "fixed", "value": 2}, "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}], "vcpu_architecture": {"type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}}' responses.add(responses.GET, url, body=mock_response, @@ -12252,7 +12605,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}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/123456::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/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance: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/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/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/bc1-4x16", "name": "bc1-4x16"}], "vcpu": {"architecture": "amd64", "count": 4}, "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}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/123456::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/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance: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/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/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"}], "vcpu": {"architecture": "amd64", "count": 4}, "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}' responses.add(responses.GET, url, body=mock_response, @@ -12307,7 +12660,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}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/123456::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/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance: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/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/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/bc1-4x16", "name": "bc1-4x16"}], "vcpu": {"architecture": "amd64", "count": 4}, "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}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/123456::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/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance: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/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/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"}], "vcpu": {"architecture": "amd64", "count": 4}, "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}' responses.add(responses.GET, url, body=mock_response, @@ -12338,7 +12691,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}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/123456::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/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance: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/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/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/bc1-4x16", "name": "bc1-4x16"}], "vcpu": {"architecture": "amd64", "count": 4}, "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}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/123456::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/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance: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/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/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"}], "vcpu": {"architecture": "amd64", "count": 4}, "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}' responses.add(responses.GET, url, body=mock_response, @@ -12375,7 +12728,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}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/123456::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/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance: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/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/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/bc1-4x16", "name": "bc1-4x16"}], "vcpu": {"architecture": "amd64", "count": 4}, "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}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/123456::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/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance: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/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/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"}], "vcpu": {"architecture": "amd64", "count": 4}, "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, body=mock_response, @@ -12434,7 +12787,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}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/123456::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/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance: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/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/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/bc1-4x16", "name": "bc1-4x16"}], "vcpu": {"architecture": "amd64", "count": 4}, "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}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/123456::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/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance: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/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/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"}], "vcpu": {"architecture": "amd64", "count": 4}, "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, body=mock_response, @@ -12820,7 +13173,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}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/123456::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/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance: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/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/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/bc1-4x16", "name": "bc1-4x16"}], "vcpu": {"architecture": "amd64", "count": 4}, "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}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/123456::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/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance: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/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/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"}], "vcpu": {"architecture": "amd64", "count": 4}, "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, @@ -12856,7 +13209,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}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/123456::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/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance: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/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/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/bc1-4x16", "name": "bc1-4x16"}], "vcpu": {"architecture": "amd64", "count": 4}, "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}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/123456::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/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance: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/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/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"}], "vcpu": {"architecture": "amd64", "count": 4}, "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, @@ -12897,7 +13250,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}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/123456::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/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance: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/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/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/bc1-4x16", "name": "bc1-4x16"}], "vcpu": {"architecture": "amd64", "count": 4}, "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}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/123456::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/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance: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/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/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"}], "vcpu": {"architecture": "amd64", "count": 4}, "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, @@ -12943,7 +13296,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}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/123456::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/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance: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/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/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/bc1-4x16", "name": "bc1-4x16"}], "vcpu": {"architecture": "amd64", "count": 4}, "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}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/123456::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/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance: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/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/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"}], "vcpu": {"architecture": "amd64", "count": 4}, "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, @@ -13734,7 +14087,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-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/123456::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": "nvme", "name": "my-bare-metal-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": 1536, "name": "my-bare-metal-server", "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-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "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-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-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": "failed", "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": "tpm_2"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-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/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-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/123456::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": "nvme", "name": "my-bare-metal-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": 1536, "name": "my-bare-metal-server", "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-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "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-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-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": "failed", "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": "tpm_2"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-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}' responses.add(responses.GET, url, body=mock_response, @@ -13804,7 +14157,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-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/123456::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": "nvme", "name": "my-bare-metal-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": 1536, "name": "my-bare-metal-server", "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-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "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-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-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": "failed", "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": "tpm_2"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-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/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-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/123456::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": "nvme", "name": "my-bare-metal-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": 1536, "name": "my-bare-metal-server", "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-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "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-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-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": "failed", "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": "tpm_2"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-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}' responses.add(responses.GET, url, body=mock_response, @@ -13835,7 +14188,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-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/123456::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": "nvme", "name": "my-bare-metal-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": 1536, "name": "my-bare-metal-server", "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-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "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-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-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": "failed", "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": "tpm_2"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-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/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-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/123456::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": "nvme", "name": "my-bare-metal-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": 1536, "name": "my-bare-metal-server", "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-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "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-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-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": "failed", "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": "tpm_2"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-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}' responses.add(responses.GET, url, body=mock_response, @@ -13872,7 +14225,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-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/123456::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": "nvme", "name": "my-bare-metal-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": 1536, "name": "my-bare-metal-server", "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-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "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-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-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": "failed", "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": "tpm_2"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-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/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-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/123456::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": "nvme", "name": "my-bare-metal-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": 1536, "name": "my-bare-metal-server", "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-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "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-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-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": "failed", "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": "tpm_2"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-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, body=mock_response, @@ -13893,6 +14246,12 @@ def test_create_bare_metal_server_all_params(self): bare_metal_server_initialization_prototype_model['keys'] = [key_identity_model] bare_metal_server_initialization_prototype_model['user_data'] = 'testString' + # Construct a dict representation of a NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext model + network_interface_ip_prototype_model = {} + 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' + # Construct a dict representation of a SecurityGroupIdentityById model security_group_identity_model = {} security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' @@ -13908,7 +14267,7 @@ def test_create_bare_metal_server_all_params(self): bare_metal_server_primary_network_interface_prototype_model['enable_infrastructure_nat'] = True bare_metal_server_primary_network_interface_prototype_model['interface_type'] = 'pci' bare_metal_server_primary_network_interface_prototype_model['name'] = 'my-network-interface' - bare_metal_server_primary_network_interface_prototype_model['primary_ipv4_address'] = '10.0.0.5' + bare_metal_server_primary_network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model bare_metal_server_primary_network_interface_prototype_model['security_groups'] = [security_group_identity_model] bare_metal_server_primary_network_interface_prototype_model['subnet'] = subnet_identity_model @@ -13926,7 +14285,7 @@ def test_create_bare_metal_server_all_params(self): bare_metal_server_network_interface_prototype_model['enable_infrastructure_nat'] = True bare_metal_server_network_interface_prototype_model['interface_type'] = 'vlan' bare_metal_server_network_interface_prototype_model['name'] = 'my-network-interface' - bare_metal_server_network_interface_prototype_model['primary_ipv4_address'] = '10.0.0.5' + bare_metal_server_network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model bare_metal_server_network_interface_prototype_model['security_groups'] = [security_group_identity_model] bare_metal_server_network_interface_prototype_model['subnet'] = subnet_identity_model bare_metal_server_network_interface_prototype_model['allow_interface_to_float'] = False @@ -13993,7 +14352,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-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/123456::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": "nvme", "name": "my-bare-metal-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": 1536, "name": "my-bare-metal-server", "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-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "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-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-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": "failed", "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": "tpm_2"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-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/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-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/123456::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": "nvme", "name": "my-bare-metal-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": 1536, "name": "my-bare-metal-server", "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-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "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-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-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": "failed", "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": "tpm_2"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-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, body=mock_response, @@ -14014,6 +14373,12 @@ def test_create_bare_metal_server_value_error(self): bare_metal_server_initialization_prototype_model['keys'] = [key_identity_model] bare_metal_server_initialization_prototype_model['user_data'] = 'testString' + # Construct a dict representation of a NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext model + network_interface_ip_prototype_model = {} + 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' + # Construct a dict representation of a SecurityGroupIdentityById model security_group_identity_model = {} security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' @@ -14029,7 +14394,7 @@ def test_create_bare_metal_server_value_error(self): bare_metal_server_primary_network_interface_prototype_model['enable_infrastructure_nat'] = True bare_metal_server_primary_network_interface_prototype_model['interface_type'] = 'pci' bare_metal_server_primary_network_interface_prototype_model['name'] = 'my-network-interface' - bare_metal_server_primary_network_interface_prototype_model['primary_ipv4_address'] = '10.0.0.5' + bare_metal_server_primary_network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model bare_metal_server_primary_network_interface_prototype_model['security_groups'] = [security_group_identity_model] bare_metal_server_primary_network_interface_prototype_model['subnet'] = subnet_identity_model @@ -14047,7 +14412,7 @@ def test_create_bare_metal_server_value_error(self): bare_metal_server_network_interface_prototype_model['enable_infrastructure_nat'] = True bare_metal_server_network_interface_prototype_model['interface_type'] = 'vlan' bare_metal_server_network_interface_prototype_model['name'] = 'my-network-interface' - bare_metal_server_network_interface_prototype_model['primary_ipv4_address'] = '10.0.0.5' + bare_metal_server_network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model bare_metal_server_network_interface_prototype_model['security_groups'] = [security_group_identity_model] bare_metal_server_network_interface_prototype_model['subnet'] = subnet_identity_model bare_metal_server_network_interface_prototype_model['allow_interface_to_float'] = False @@ -14447,7 +14812,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/123456::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", "interface_type": "pci", "mac_address": "02:00:0a:00:23:94", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary", "allowed_vlans": [4]}], "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": "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/123456::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", "interface_type": "pci", "mac_address": "02:00:0a:00:23:94", "name": "my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary", "allowed_vlans": [4]}], "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}' responses.add(responses.GET, url, body=mock_response, @@ -14492,7 +14857,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/123456::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", "interface_type": "pci", "mac_address": "02:00:0a:00:23:94", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary", "allowed_vlans": [4]}], "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": "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/123456::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", "interface_type": "pci", "mac_address": "02:00:0a:00:23:94", "name": "my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary", "allowed_vlans": [4]}], "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}' responses.add(responses.GET, url, body=mock_response, @@ -14528,7 +14893,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/123456::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", "interface_type": "pci", "mac_address": "02:00:0a:00:23:94", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary", "allowed_vlans": [4]}], "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": "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/123456::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", "interface_type": "pci", "mac_address": "02:00:0a:00:23:94", "name": "my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary", "allowed_vlans": [4]}], "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}' responses.add(responses.GET, url, body=mock_response, @@ -14569,13 +14934,19 @@ 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/123456::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", "interface_type": "pci", "mac_address": "02:00:0a:00:23:94", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary", "allowed_vlans": [4]}' + 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/123456::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", "interface_type": "pci", "mac_address": "02:00:0a:00:23:94", "name": "my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary", "allowed_vlans": [4]}' responses.add(responses.POST, url, body=mock_response, content_type='application/json', status=201) + # Construct a dict representation of a NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext model + network_interface_ip_prototype_model = {} + 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' + # Construct a dict representation of a SecurityGroupIdentityById model security_group_identity_model = {} security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' @@ -14590,7 +14961,7 @@ def test_create_bare_metal_server_network_interface_all_params(self): bare_metal_server_network_interface_prototype_model['enable_infrastructure_nat'] = True bare_metal_server_network_interface_prototype_model['interface_type'] = 'vlan' bare_metal_server_network_interface_prototype_model['name'] = 'my-network-interface' - bare_metal_server_network_interface_prototype_model['primary_ipv4_address'] = '10.0.0.5' + bare_metal_server_network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model bare_metal_server_network_interface_prototype_model['security_groups'] = [security_group_identity_model] bare_metal_server_network_interface_prototype_model['subnet'] = subnet_identity_model bare_metal_server_network_interface_prototype_model['allow_interface_to_float'] = False @@ -14630,13 +15001,19 @@ 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/123456::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", "interface_type": "pci", "mac_address": "02:00:0a:00:23:94", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary", "allowed_vlans": [4]}' + 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/123456::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", "interface_type": "pci", "mac_address": "02:00:0a:00:23:94", "name": "my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary", "allowed_vlans": [4]}' responses.add(responses.POST, url, body=mock_response, content_type='application/json', status=201) + # Construct a dict representation of a NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext model + network_interface_ip_prototype_model = {} + 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' + # Construct a dict representation of a SecurityGroupIdentityById model security_group_identity_model = {} security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' @@ -14651,7 +15028,7 @@ def test_create_bare_metal_server_network_interface_value_error(self): bare_metal_server_network_interface_prototype_model['enable_infrastructure_nat'] = True bare_metal_server_network_interface_prototype_model['interface_type'] = 'vlan' bare_metal_server_network_interface_prototype_model['name'] = 'my-network-interface' - bare_metal_server_network_interface_prototype_model['primary_ipv4_address'] = '10.0.0.5' + bare_metal_server_network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model bare_metal_server_network_interface_prototype_model['security_groups'] = [security_group_identity_model] bare_metal_server_network_interface_prototype_model['subnet'] = subnet_identity_model bare_metal_server_network_interface_prototype_model['allow_interface_to_float'] = False @@ -14768,7 +15145,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/123456::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", "interface_type": "pci", "mac_address": "02:00:0a:00:23:94", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary", "allowed_vlans": [4]}' + 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/123456::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", "interface_type": "pci", "mac_address": "02:00:0a:00:23:94", "name": "my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary", "allowed_vlans": [4]}' responses.add(responses.GET, url, body=mock_response, @@ -14806,7 +15183,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/123456::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", "interface_type": "pci", "mac_address": "02:00:0a:00:23:94", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary", "allowed_vlans": [4]}' + 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/123456::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", "interface_type": "pci", "mac_address": "02:00:0a:00:23:94", "name": "my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary", "allowed_vlans": [4]}' responses.add(responses.GET, url, body=mock_response, @@ -14849,7 +15226,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/123456::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", "interface_type": "pci", "mac_address": "02:00:0a:00:23:94", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary", "allowed_vlans": [4]}' + 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/123456::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", "interface_type": "pci", "mac_address": "02:00:0a:00:23:94", "name": "my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary", "allowed_vlans": [4]}' responses.add(responses.PATCH, url, body=mock_response, @@ -14899,7 +15276,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/123456::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", "interface_type": "pci", "mac_address": "02:00:0a:00:23:94", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary", "allowed_vlans": [4]}' + 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/123456::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", "interface_type": "pci", "mac_address": "02:00:0a:00:23:94", "name": "my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary", "allowed_vlans": [4]}' responses.add(responses.PATCH, url, body=mock_response, @@ -14951,7 +15328,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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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_response, @@ -14989,7 +15366,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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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_response, @@ -15111,7 +15488,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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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_response, @@ -15151,7 +15528,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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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_response, @@ -15196,7 +15573,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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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, body=mock_response, @@ -15236,7 +15613,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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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, body=mock_response, @@ -15269,6 +15646,172 @@ def test_add_bare_metal_server_network_interface_floating_ip_value_error_with_re _service.disable_retries() self.test_add_bare_metal_server_network_interface_floating_ip_value_error() +class TestListBareMetalServerNetworkInterfaceIps(): + """ + Test Class for list_bare_metal_server_network_interface_ips + """ + + @responses.activate + def test_list_bare_metal_server_network_interface_ips_all_params(self): + """ + list_bare_metal_server_network_interface_ips() + """ + # 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/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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway: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/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "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}' + responses.add(responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200) + + # Set up parameter values + bare_metal_server_id = 'testString' + network_interface_id = 'testString' + + # Invoke method + response = _service.list_bare_metal_server_network_interface_ips( + bare_metal_server_id, + network_interface_id, + headers={} + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + def test_list_bare_metal_server_network_interface_ips_all_params_with_retries(self): + # Enable retries and run test_list_bare_metal_server_network_interface_ips_all_params. + _service.enable_retries() + self.test_list_bare_metal_server_network_interface_ips_all_params() + + # Disable retries and run test_list_bare_metal_server_network_interface_ips_all_params. + _service.disable_retries() + self.test_list_bare_metal_server_network_interface_ips_all_params() + + @responses.activate + def test_list_bare_metal_server_network_interface_ips_value_error(self): + """ + test_list_bare_metal_server_network_interface_ips_value_error() + """ + # 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/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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway: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/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "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}' + responses.add(responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200) + + # Set up parameter values + bare_metal_server_id = 'testString' + network_interface_id = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "bare_metal_server_id": bare_metal_server_id, + "network_interface_id": network_interface_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_bare_metal_server_network_interface_ips(**req_copy) + + + def test_list_bare_metal_server_network_interface_ips_value_error_with_retries(self): + # Enable retries and run test_list_bare_metal_server_network_interface_ips_value_error. + _service.enable_retries() + self.test_list_bare_metal_server_network_interface_ips_value_error() + + # Disable retries and run test_list_bare_metal_server_network_interface_ips_value_error. + _service.disable_retries() + self.test_list_bare_metal_server_network_interface_ips_value_error() + +class TestGetBareMetalServerNetworkInterfaceIp(): + """ + Test Class for get_bare_metal_server_network_interface_ip + """ + + @responses.activate + def test_get_bare_metal_server_network_interface_ip_all_params(self): + """ + get_bare_metal_server_network_interface_ip() + """ + # Set up mock + url = preprocess_url('/bare_metal_servers/testString/network_interfaces/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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway: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/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}' + responses.add(responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200) + + # Set up parameter values + bare_metal_server_id = 'testString' + network_interface_id = 'testString' + id = 'testString' + + # Invoke method + response = _service.get_bare_metal_server_network_interface_ip( + bare_metal_server_id, + network_interface_id, + id, + headers={} + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + def test_get_bare_metal_server_network_interface_ip_all_params_with_retries(self): + # Enable retries and run test_get_bare_metal_server_network_interface_ip_all_params. + _service.enable_retries() + self.test_get_bare_metal_server_network_interface_ip_all_params() + + # Disable retries and run test_get_bare_metal_server_network_interface_ip_all_params. + _service.disable_retries() + self.test_get_bare_metal_server_network_interface_ip_all_params() + + @responses.activate + def test_get_bare_metal_server_network_interface_ip_value_error(self): + """ + test_get_bare_metal_server_network_interface_ip_value_error() + """ + # Set up mock + url = preprocess_url('/bare_metal_servers/testString/network_interfaces/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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway: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/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}' + responses.add(responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200) + + # Set up parameter values + bare_metal_server_id = 'testString' + network_interface_id = 'testString' + id = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "bare_metal_server_id": bare_metal_server_id, + "network_interface_id": network_interface_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_bare_metal_server_network_interface_ip(**req_copy) + + + def test_get_bare_metal_server_network_interface_ip_value_error_with_retries(self): + # Enable retries and run test_get_bare_metal_server_network_interface_ip_value_error. + _service.enable_retries() + self.test_get_bare_metal_server_network_interface_ip_value_error() + + # Disable retries and run test_get_bare_metal_server_network_interface_ip_value_error. + _service.disable_retries() + self.test_get_bare_metal_server_network_interface_ip_value_error() + class TestDeleteBareMetalServer(): """ Test Class for delete_bare_metal_server @@ -15352,7 +15895,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-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/123456::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": "nvme", "name": "my-bare-metal-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": 1536, "name": "my-bare-metal-server", "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-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "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-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-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": "failed", "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": "tpm_2"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-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/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-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/123456::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": "nvme", "name": "my-bare-metal-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": 1536, "name": "my-bare-metal-server", "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-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "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-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-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": "failed", "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": "tpm_2"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-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, @@ -15388,7 +15931,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-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/123456::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": "nvme", "name": "my-bare-metal-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": 1536, "name": "my-bare-metal-server", "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-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "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-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-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": "failed", "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": "tpm_2"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-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/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-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/123456::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": "nvme", "name": "my-bare-metal-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": 1536, "name": "my-bare-metal-server", "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-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "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-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-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": "failed", "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": "tpm_2"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-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, @@ -15429,7 +15972,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-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/123456::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": "nvme", "name": "my-bare-metal-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": 1536, "name": "my-bare-metal-server", "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-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "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-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-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": "failed", "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": "tpm_2"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-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/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-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/123456::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": "nvme", "name": "my-bare-metal-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": 1536, "name": "my-bare-metal-server", "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-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "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-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-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": "failed", "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": "tpm_2"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-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, @@ -15474,7 +16017,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-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/123456::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": "nvme", "name": "my-bare-metal-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": 1536, "name": "my-bare-metal-server", "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-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "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-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-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": "failed", "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": "tpm_2"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-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/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-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/123456::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": "nvme", "name": "my-bare-metal-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": 1536, "name": "my-bare-metal-server", "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-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "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-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-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": "failed", "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": "tpm_2"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-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, @@ -16060,7 +16603,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"}, "volumes": [{"active": true, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "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"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::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", "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"}], "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/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance: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/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-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": "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"}, "volumes": [{"active": true, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "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"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::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", "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/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance: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/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-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"}}]}' responses.add(responses.GET, url, body=mock_response, @@ -16109,7 +16652,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"}, "volumes": [{"active": true, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "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"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::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", "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"}], "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/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance: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/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-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": "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"}, "volumes": [{"active": true, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "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"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::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", "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/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance: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/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-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"}}]}' responses.add(responses.GET, url, body=mock_response, @@ -16140,7 +16683,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"}, "volumes": [{"active": true, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "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"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::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", "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"}], "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/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance: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/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-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": "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"}, "volumes": [{"active": true, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "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"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::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", "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/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance: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/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-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"}}]}' responses.add(responses.GET, url, body=mock_response, @@ -16177,7 +16720,7 @@ def test_create_volume_all_params(self): """ # Set up mock url = preprocess_url('/volumes') - mock_response = '{"active": true, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "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"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::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", "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"}], "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/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance: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/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-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, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "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"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::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", "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/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance: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/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-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"}}' responses.add(responses.POST, url, body=mock_response, @@ -16206,6 +16749,7 @@ def test_create_volume_all_params(self): volume_prototype_model['name'] = 'my-volume' volume_prototype_model['profile'] = volume_profile_identity_model volume_prototype_model['resource_group'] = resource_group_identity_model + volume_prototype_model['user_tags'] = ['testString'] volume_prototype_model['zone'] = zone_identity_model volume_prototype_model['capacity'] = 100 volume_prototype_model['encryption_key'] = encryption_key_identity_model @@ -16242,7 +16786,7 @@ def test_create_volume_value_error(self): """ # Set up mock url = preprocess_url('/volumes') - mock_response = '{"active": true, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "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"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::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", "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"}], "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/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance: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/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-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, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "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"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::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", "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/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance: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/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-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"}}' responses.add(responses.POST, url, body=mock_response, @@ -16271,6 +16815,7 @@ def test_create_volume_value_error(self): volume_prototype_model['name'] = 'my-volume' volume_prototype_model['profile'] = volume_profile_identity_model volume_prototype_model['resource_group'] = resource_group_identity_model + volume_prototype_model['user_tags'] = ['testString'] volume_prototype_model['zone'] = zone_identity_model volume_prototype_model['capacity'] = 100 volume_prototype_model['encryption_key'] = encryption_key_identity_model @@ -16315,10 +16860,12 @@ def test_delete_volume_all_params(self): # Set up parameter values id = 'testString' + if_match = '96d225c4-56bd-43d9-98fc-d7148e5c5028' # Invoke method response = _service.delete_volume( id, + if_match=if_match, headers={} ) @@ -16335,6 +16882,39 @@ def test_delete_volume_all_params_with_retries(self): _service.disable_retries() self.test_delete_volume_all_params() + @responses.activate + def test_delete_volume_required_params(self): + """ + test_delete_volume_required_params() + """ + # Set up mock + url = preprocess_url('/volumes/testString') + responses.add(responses.DELETE, + url, + status=204) + + # Set up parameter values + id = 'testString' + + # Invoke method + response = _service.delete_volume( + id, + headers={} + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 204 + + def test_delete_volume_required_params_with_retries(self): + # Enable retries and run test_delete_volume_required_params. + _service.enable_retries() + self.test_delete_volume_required_params() + + # Disable retries and run test_delete_volume_required_params. + _service.disable_retries() + self.test_delete_volume_required_params() + @responses.activate def test_delete_volume_value_error(self): """ @@ -16380,7 +16960,7 @@ def test_get_volume_all_params(self): """ # Set up mock url = preprocess_url('/volumes/testString') - mock_response = '{"active": true, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "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"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::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", "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"}], "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/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance: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/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-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, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "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"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::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", "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/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance: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/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-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"}}' responses.add(responses.GET, url, body=mock_response, @@ -16416,7 +16996,7 @@ def test_get_volume_value_error(self): """ # Set up mock url = preprocess_url('/volumes/testString') - mock_response = '{"active": true, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "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"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::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", "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"}], "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/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance: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/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-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, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "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"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::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", "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/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance: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/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-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"}}' responses.add(responses.GET, url, body=mock_response, @@ -16457,7 +17037,7 @@ def test_update_volume_all_params(self): """ # Set up mock url = preprocess_url('/volumes/testString') - mock_response = '{"active": true, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "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"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::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", "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"}], "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/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance: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/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-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, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "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"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::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", "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/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance: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/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-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"}}' responses.add(responses.PATCH, url, body=mock_response, @@ -16474,15 +17054,18 @@ def test_update_volume_all_params(self): volume_patch_model['iops'] = 10000 volume_patch_model['name'] = 'my-volume' volume_patch_model['profile'] = volume_profile_identity_model + volume_patch_model['user_tags'] = ['testString'] # Set up parameter values id = 'testString' volume_patch = volume_patch_model + if_match = '96d225c4-56bd-43d9-98fc-d7148e5c5028' # Invoke method response = _service.update_volume( id, volume_patch, + if_match=if_match, headers={} ) @@ -16502,6 +17085,59 @@ def test_update_volume_all_params_with_retries(self): _service.disable_retries() self.test_update_volume_all_params() + @responses.activate + def test_update_volume_required_params(self): + """ + test_update_volume_required_params() + """ + # Set up mock + url = preprocess_url('/volumes/testString') + mock_response = '{"active": true, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "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"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::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", "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/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance: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/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-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"}}' + responses.add(responses.PATCH, + url, + body=mock_response, + content_type='application/json', + status=200) + + # Construct a dict representation of a VolumeProfileIdentityByName model + volume_profile_identity_model = {} + volume_profile_identity_model['name'] = 'general-purpose' + + # Construct a dict representation of a VolumePatch model + volume_patch_model = {} + volume_patch_model['capacity'] = 100 + volume_patch_model['iops'] = 10000 + volume_patch_model['name'] = 'my-volume' + volume_patch_model['profile'] = volume_profile_identity_model + volume_patch_model['user_tags'] = ['testString'] + + # Set up parameter values + id = 'testString' + volume_patch = volume_patch_model + + # Invoke method + response = _service.update_volume( + id, + volume_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 == volume_patch + + def test_update_volume_required_params_with_retries(self): + # Enable retries and run test_update_volume_required_params. + _service.enable_retries() + self.test_update_volume_required_params() + + # Disable retries and run test_update_volume_required_params. + _service.disable_retries() + self.test_update_volume_required_params() + @responses.activate def test_update_volume_value_error(self): """ @@ -16509,7 +17145,7 @@ def test_update_volume_value_error(self): """ # Set up mock url = preprocess_url('/volumes/testString') - mock_response = '{"active": true, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "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"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::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", "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"}], "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/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance: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/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-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, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "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"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::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", "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/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance: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/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-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"}}' responses.add(responses.PATCH, url, body=mock_response, @@ -16526,6 +17162,7 @@ def test_update_volume_value_error(self): volume_patch_model['iops'] = 10000 volume_patch_model['name'] = 'my-volume' volume_patch_model['profile'] = volume_profile_identity_model + volume_patch_model['user_tags'] = ['testString'] # Set up parameter values id = 'testString' @@ -16692,7 +17329,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": [{"bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87: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": {"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-16-amd64", "name": "ubuntu-16-amd64", "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", "size": 1, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "total_count": 132}' + 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": [{"bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87: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": {"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-16-amd64", "name": "ubuntu-16-amd64", "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, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}, "user_tags": ["user_tags"]}], "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -16756,7 +17393,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": [{"bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87: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": {"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-16-amd64", "name": "ubuntu-16-amd64", "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", "size": 1, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "total_count": 132}' + 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": [{"bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87: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": {"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-16-amd64", "name": "ubuntu-16-amd64", "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, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}, "user_tags": ["user_tags"]}], "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -16787,7 +17424,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": [{"bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87: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": {"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-16-amd64", "name": "ubuntu-16-amd64", "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", "size": 1, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "total_count": 132}' + 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": [{"bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87: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": {"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-16-amd64", "name": "ubuntu-16-amd64", "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, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}, "user_tags": ["user_tags"]}], "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -16824,31 +17461,34 @@ def test_create_snapshot_all_params(self): """ # Set up mock url = preprocess_url('/snapshots') - mock_response = '{"bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87: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": {"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-16-amd64", "name": "ubuntu-16-amd64", "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", "size": 1, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}' + mock_response = '{"bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87: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": {"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-16-amd64", "name": "ubuntu-16-amd64", "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, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}, "user_tags": ["user_tags"]}' 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 VolumeIdentityById model volume_identity_model = {} volume_identity_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5' - # Construct a dict representation of a ResourceGroupIdentityById model - resource_group_identity_model = {} - resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + # Construct a dict representation of a SnapshotPrototypeSnapshotBySourceVolume model + snapshot_prototype_model = {} + snapshot_prototype_model['name'] = 'my-snapshot' + snapshot_prototype_model['resource_group'] = resource_group_identity_model + snapshot_prototype_model['user_tags'] = ['testString'] + snapshot_prototype_model['source_volume'] = volume_identity_model # Set up parameter values - source_volume = volume_identity_model - name = 'my-snapshot' - resource_group = resource_group_identity_model + snapshot_prototype = snapshot_prototype_model # Invoke method response = _service.create_snapshot( - source_volume, - name=name, - resource_group=resource_group, + snapshot_prototype, headers={} ) @@ -16857,9 +17497,7 @@ def test_create_snapshot_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['source_volume'] == volume_identity_model - assert req_body['name'] == 'my-snapshot' - assert req_body['resource_group'] == resource_group_identity_model + assert req_body == snapshot_prototype def test_create_snapshot_all_params_with_retries(self): # Enable retries and run test_create_snapshot_all_params. @@ -16877,29 +17515,34 @@ def test_create_snapshot_value_error(self): """ # Set up mock url = preprocess_url('/snapshots') - mock_response = '{"bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87: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": {"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-16-amd64", "name": "ubuntu-16-amd64", "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", "size": 1, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}' + mock_response = '{"bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87: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": {"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-16-amd64", "name": "ubuntu-16-amd64", "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, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}, "user_tags": ["user_tags"]}' 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 VolumeIdentityById model volume_identity_model = {} volume_identity_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5' - # Construct a dict representation of a ResourceGroupIdentityById model - resource_group_identity_model = {} - resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + # Construct a dict representation of a SnapshotPrototypeSnapshotBySourceVolume model + snapshot_prototype_model = {} + snapshot_prototype_model['name'] = 'my-snapshot' + snapshot_prototype_model['resource_group'] = resource_group_identity_model + snapshot_prototype_model['user_tags'] = ['testString'] + snapshot_prototype_model['source_volume'] = volume_identity_model # Set up parameter values - source_volume = volume_identity_model - name = 'my-snapshot' - resource_group = resource_group_identity_model + snapshot_prototype = snapshot_prototype_model # Pass in all but one required param and check for a ValueError req_param_dict = { - "source_volume": source_volume, + "snapshot_prototype": snapshot_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()} @@ -16934,10 +17577,12 @@ def test_delete_snapshot_all_params(self): # Set up parameter values id = 'testString' + if_match = '96d225c4-56bd-43d9-98fc-d7148e5c5028' # Invoke method response = _service.delete_snapshot( id, + if_match=if_match, headers={} ) @@ -16954,6 +17599,39 @@ def test_delete_snapshot_all_params_with_retries(self): _service.disable_retries() self.test_delete_snapshot_all_params() + @responses.activate + def test_delete_snapshot_required_params(self): + """ + test_delete_snapshot_required_params() + """ + # Set up mock + url = preprocess_url('/snapshots/testString') + responses.add(responses.DELETE, + url, + status=204) + + # Set up parameter values + id = 'testString' + + # Invoke method + response = _service.delete_snapshot( + id, + headers={} + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 204 + + def test_delete_snapshot_required_params_with_retries(self): + # Enable retries and run test_delete_snapshot_required_params. + _service.enable_retries() + self.test_delete_snapshot_required_params() + + # Disable retries and run test_delete_snapshot_required_params. + _service.disable_retries() + self.test_delete_snapshot_required_params() + @responses.activate def test_delete_snapshot_value_error(self): """ @@ -16999,7 +17677,7 @@ def test_get_snapshot_all_params(self): """ # Set up mock url = preprocess_url('/snapshots/testString') - mock_response = '{"bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87: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": {"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-16-amd64", "name": "ubuntu-16-amd64", "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", "size": 1, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}' + mock_response = '{"bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87: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": {"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-16-amd64", "name": "ubuntu-16-amd64", "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, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}, "user_tags": ["user_tags"]}' responses.add(responses.GET, url, body=mock_response, @@ -17035,7 +17713,7 @@ def test_get_snapshot_value_error(self): """ # Set up mock url = preprocess_url('/snapshots/testString') - mock_response = '{"bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87: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": {"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-16-amd64", "name": "ubuntu-16-amd64", "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", "size": 1, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}' + mock_response = '{"bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87: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": {"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-16-amd64", "name": "ubuntu-16-amd64", "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, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}, "user_tags": ["user_tags"]}' responses.add(responses.GET, url, body=mock_response, @@ -17076,7 +17754,7 @@ def test_update_snapshot_all_params(self): """ # Set up mock url = preprocess_url('/snapshots/testString') - mock_response = '{"bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87: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": {"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-16-amd64", "name": "ubuntu-16-amd64", "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", "size": 1, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}' + mock_response = '{"bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87: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": {"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-16-amd64", "name": "ubuntu-16-amd64", "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, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}, "user_tags": ["user_tags"]}' responses.add(responses.PATCH, url, body=mock_response, @@ -17086,15 +17764,18 @@ def test_update_snapshot_all_params(self): # Construct a dict representation of a SnapshotPatch model snapshot_patch_model = {} snapshot_patch_model['name'] = 'my-snapshot' + snapshot_patch_model['user_tags'] = ['testString'] # Set up parameter values id = 'testString' snapshot_patch = snapshot_patch_model + if_match = '96d225c4-56bd-43d9-98fc-d7148e5c5028' # Invoke method response = _service.update_snapshot( id, snapshot_patch, + if_match=if_match, headers={} ) @@ -17114,6 +17795,52 @@ def test_update_snapshot_all_params_with_retries(self): _service.disable_retries() self.test_update_snapshot_all_params() + @responses.activate + def test_update_snapshot_required_params(self): + """ + test_update_snapshot_required_params() + """ + # Set up mock + url = preprocess_url('/snapshots/testString') + mock_response = '{"bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87: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": {"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-16-amd64", "name": "ubuntu-16-amd64", "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, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}, "user_tags": ["user_tags"]}' + responses.add(responses.PATCH, + url, + body=mock_response, + content_type='application/json', + status=200) + + # Construct a dict representation of a SnapshotPatch model + snapshot_patch_model = {} + snapshot_patch_model['name'] = 'my-snapshot' + snapshot_patch_model['user_tags'] = ['testString'] + + # Set up parameter values + id = 'testString' + snapshot_patch = snapshot_patch_model + + # Invoke method + response = _service.update_snapshot( + id, + snapshot_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 == snapshot_patch + + def test_update_snapshot_required_params_with_retries(self): + # Enable retries and run test_update_snapshot_required_params. + _service.enable_retries() + self.test_update_snapshot_required_params() + + # Disable retries and run test_update_snapshot_required_params. + _service.disable_retries() + self.test_update_snapshot_required_params() + @responses.activate def test_update_snapshot_value_error(self): """ @@ -17121,7 +17848,7 @@ def test_update_snapshot_value_error(self): """ # Set up mock url = preprocess_url('/snapshots/testString') - mock_response = '{"bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87: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": {"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-16-amd64", "name": "ubuntu-16-amd64", "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", "size": 1, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}' + mock_response = '{"bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87: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": {"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-16-amd64", "name": "ubuntu-16-amd64", "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, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}, "user_tags": ["user_tags"]}' responses.add(responses.PATCH, url, body=mock_response, @@ -17131,6 +17858,7 @@ def test_update_snapshot_value_error(self): # Construct a dict representation of a SnapshotPatch model snapshot_patch_model = {} snapshot_patch_model['name'] = 'my-snapshot' + snapshot_patch_model['user_tags'] = ['testString'] # Set up parameter values id = 'testString' @@ -18116,7 +18844,7 @@ def test_list_floating_ips_all_params(self): """ # 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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "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}' + 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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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}' responses.add(responses.GET, url, body=mock_response, @@ -18127,12 +18855,14 @@ def test_list_floating_ips_all_params(self): start = 'testString' limit = 1 resource_group_id = 'testString' + sort = 'name' # Invoke method response = _service.list_floating_ips( start=start, limit=limit, resource_group_id=resource_group_id, + sort=sort, headers={} ) @@ -18145,6 +18875,7 @@ def test_list_floating_ips_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 'sort={}'.format(sort) in query_string def test_list_floating_ips_all_params_with_retries(self): # Enable retries and run test_list_floating_ips_all_params. @@ -18162,7 +18893,7 @@ def test_list_floating_ips_required_params(self): """ # 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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "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}' + 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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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}' responses.add(responses.GET, url, body=mock_response, @@ -18193,7 +18924,7 @@ def test_list_floating_ips_value_error(self): """ # 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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "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}' + 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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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}' responses.add(responses.GET, url, body=mock_response, @@ -18230,7 +18961,7 @@ def test_create_floating_ip_all_params(self): """ # 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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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, body=mock_response, @@ -18283,7 +19014,7 @@ def test_create_floating_ip_value_error(self): """ # 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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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, body=mock_response, @@ -18409,7 +19140,7 @@ def test_get_floating_ip_all_params(self): """ # 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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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_response, @@ -18445,7 +19176,7 @@ def test_get_floating_ip_value_error(self): """ # 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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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_response, @@ -18486,7 +19217,7 @@ def test_update_floating_ip_all_params(self): """ # 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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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, body=mock_response, @@ -18536,7 +19267,7 @@ def test_update_floating_ip_value_error(self): """ # 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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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, body=mock_response, @@ -19708,7 +20439,7 @@ def test_list_security_groups_all_params(self): """ # 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/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}], "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", "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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}], "total_count": 132}' + 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/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "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", "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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}], "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -19763,7 +20494,7 @@ def test_list_security_groups_required_params(self): """ # 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/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}], "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", "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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}], "total_count": 132}' + 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/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "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", "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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}], "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -19794,7 +20525,7 @@ def test_list_security_groups_value_error(self): """ # 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/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}], "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", "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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}], "total_count": 132}' + 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/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "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", "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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}], "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -19831,7 +20562,7 @@ def test_create_security_group_all_params(self): """ # 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/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}], "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", "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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "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", "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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' responses.add(responses.POST, url, body=mock_response, @@ -19900,7 +20631,7 @@ def test_create_security_group_value_error(self): """ # 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/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}], "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", "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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "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", "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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' responses.add(responses.POST, url, body=mock_response, @@ -20036,7 +20767,7 @@ def test_get_security_group_all_params(self): """ # 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/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}], "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", "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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "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", "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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' responses.add(responses.GET, url, body=mock_response, @@ -20072,7 +20803,7 @@ def test_get_security_group_value_error(self): """ # 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/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}], "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", "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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "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", "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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' responses.add(responses.GET, url, body=mock_response, @@ -20113,7 +20844,7 @@ def test_update_security_group_all_params(self): """ # 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/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}], "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", "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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "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", "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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' responses.add(responses.PATCH, url, body=mock_response, @@ -20158,7 +20889,7 @@ def test_update_security_group_value_error(self): """ # 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/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}], "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", "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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "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", "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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}' responses.add(responses.PATCH, url, body=mock_response, @@ -20193,365 +20924,6 @@ def test_update_security_group_value_error_with_retries(self): _service.disable_retries() self.test_update_security_group_value_error() -class TestListSecurityGroupNetworkInterfaces(): - """ - Test Class for list_security_group_network_interfaces - """ - - @responses.activate - def test_list_security_group_network_interfaces_all_params(self): - """ - list_security_group_network_interfaces() - """ - # Set up mock - url = preprocess_url('/security_groups/testString/network_interfaces') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/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", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary"}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20"}, "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 = 1 - - # Invoke method - response = _service.list_security_group_network_interfaces( - 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_network_interfaces_all_params_with_retries(self): - # Enable retries and run test_list_security_group_network_interfaces_all_params. - _service.enable_retries() - self.test_list_security_group_network_interfaces_all_params() - - # Disable retries and run test_list_security_group_network_interfaces_all_params. - _service.disable_retries() - self.test_list_security_group_network_interfaces_all_params() - - @responses.activate - def test_list_security_group_network_interfaces_required_params(self): - """ - test_list_security_group_network_interfaces_required_params() - """ - # Set up mock - url = preprocess_url('/security_groups/testString/network_interfaces') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/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", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary"}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20"}, "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_network_interfaces( - security_group_id, - headers={} - ) - - # Check for correct operation - assert len(responses.calls) == 1 - assert response.status_code == 200 - - def test_list_security_group_network_interfaces_required_params_with_retries(self): - # Enable retries and run test_list_security_group_network_interfaces_required_params. - _service.enable_retries() - self.test_list_security_group_network_interfaces_required_params() - - # Disable retries and run test_list_security_group_network_interfaces_required_params. - _service.disable_retries() - self.test_list_security_group_network_interfaces_required_params() - - @responses.activate - def test_list_security_group_network_interfaces_value_error(self): - """ - test_list_security_group_network_interfaces_value_error() - """ - # Set up mock - url = preprocess_url('/security_groups/testString/network_interfaces') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/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", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary"}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20"}, "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' - - # 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_network_interfaces(**req_copy) - - - def test_list_security_group_network_interfaces_value_error_with_retries(self): - # Enable retries and run test_list_security_group_network_interfaces_value_error. - _service.enable_retries() - self.test_list_security_group_network_interfaces_value_error() - - # Disable retries and run test_list_security_group_network_interfaces_value_error. - _service.disable_retries() - self.test_list_security_group_network_interfaces_value_error() - -class TestRemoveSecurityGroupNetworkInterface(): - """ - Test Class for remove_security_group_network_interface - """ - - @responses.activate - def test_remove_security_group_network_interface_all_params(self): - """ - remove_security_group_network_interface() - """ - # Set up mock - url = preprocess_url('/security_groups/testString/network_interfaces/testString') - responses.add(responses.DELETE, - url, - status=204) - - # Set up parameter values - security_group_id = 'testString' - id = 'testString' - - # Invoke method - response = _service.remove_security_group_network_interface( - security_group_id, - id, - headers={} - ) - - # Check for correct operation - assert len(responses.calls) == 1 - assert response.status_code == 204 - - def test_remove_security_group_network_interface_all_params_with_retries(self): - # Enable retries and run test_remove_security_group_network_interface_all_params. - _service.enable_retries() - self.test_remove_security_group_network_interface_all_params() - - # Disable retries and run test_remove_security_group_network_interface_all_params. - _service.disable_retries() - self.test_remove_security_group_network_interface_all_params() - - @responses.activate - def test_remove_security_group_network_interface_value_error(self): - """ - test_remove_security_group_network_interface_value_error() - """ - # Set up mock - url = preprocess_url('/security_groups/testString/network_interfaces/testString') - responses.add(responses.DELETE, - url, - 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.remove_security_group_network_interface(**req_copy) - - - def test_remove_security_group_network_interface_value_error_with_retries(self): - # Enable retries and run test_remove_security_group_network_interface_value_error. - _service.enable_retries() - self.test_remove_security_group_network_interface_value_error() - - # Disable retries and run test_remove_security_group_network_interface_value_error. - _service.disable_retries() - self.test_remove_security_group_network_interface_value_error() - -class TestGetSecurityGroupNetworkInterface(): - """ - Test Class for get_security_group_network_interface - """ - - @responses.activate - def test_get_security_group_network_interface_all_params(self): - """ - get_security_group_network_interface() - """ - # Set up mock - url = preprocess_url('/security_groups/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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary"}' - responses.add(responses.GET, - url, - body=mock_response, - content_type='application/json', - status=200) - - # Set up parameter values - security_group_id = 'testString' - id = 'testString' - - # Invoke method - response = _service.get_security_group_network_interface( - security_group_id, - id, - headers={} - ) - - # Check for correct operation - assert len(responses.calls) == 1 - assert response.status_code == 200 - - def test_get_security_group_network_interface_all_params_with_retries(self): - # Enable retries and run test_get_security_group_network_interface_all_params. - _service.enable_retries() - self.test_get_security_group_network_interface_all_params() - - # Disable retries and run test_get_security_group_network_interface_all_params. - _service.disable_retries() - self.test_get_security_group_network_interface_all_params() - - @responses.activate - def test_get_security_group_network_interface_value_error(self): - """ - test_get_security_group_network_interface_value_error() - """ - # Set up mock - url = preprocess_url('/security_groups/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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary"}' - responses.add(responses.GET, - url, - 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.get_security_group_network_interface(**req_copy) - - - def test_get_security_group_network_interface_value_error_with_retries(self): - # Enable retries and run test_get_security_group_network_interface_value_error. - _service.enable_retries() - self.test_get_security_group_network_interface_value_error() - - # Disable retries and run test_get_security_group_network_interface_value_error. - _service.disable_retries() - self.test_get_security_group_network_interface_value_error() - -class TestAddSecurityGroupNetworkInterface(): - """ - Test Class for add_security_group_network_interface - """ - - @responses.activate - def test_add_security_group_network_interface_all_params(self): - """ - add_security_group_network_interface() - """ - # Set up mock - url = preprocess_url('/security_groups/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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary"}' - responses.add(responses.PUT, - url, - body=mock_response, - content_type='application/json', - status=201) - - # Set up parameter values - security_group_id = 'testString' - id = 'testString' - - # Invoke method - response = _service.add_security_group_network_interface( - security_group_id, - id, - headers={} - ) - - # Check for correct operation - assert len(responses.calls) == 1 - assert response.status_code == 201 - - def test_add_security_group_network_interface_all_params_with_retries(self): - # Enable retries and run test_add_security_group_network_interface_all_params. - _service.enable_retries() - self.test_add_security_group_network_interface_all_params() - - # Disable retries and run test_add_security_group_network_interface_all_params. - _service.disable_retries() - self.test_add_security_group_network_interface_all_params() - - @responses.activate - def test_add_security_group_network_interface_value_error(self): - """ - test_add_security_group_network_interface_value_error() - """ - # Set up mock - url = preprocess_url('/security_groups/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/123456::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/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary"}' - responses.add(responses.PUT, - url, - body=mock_response, - content_type='application/json', - status=201) - - # 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.add_security_group_network_interface(**req_copy) - - - def test_add_security_group_network_interface_value_error_with_retries(self): - # Enable retries and run test_add_security_group_network_interface_value_error. - _service.enable_retries() - self.test_add_security_group_network_interface_value_error() - - # Disable retries and run test_add_security_group_network_interface_value_error. - _service.disable_retries() - self.test_add_security_group_network_interface_value_error() - class TestListSecurityGroupRules(): """ Test Class for list_security_group_rules @@ -24263,7 +24635,7 @@ def test_list_load_balancer_profiles_all_params(self): """ # 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": [{"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "logging_supported": {"type": "fixed", "value": ["datapath"]}, "name": "network-fixed", "route_mode_supported": {"type": "fixed", "value": true}, "security_groups_supported": {"type": "fixed", "value": true}}], "total_count": 132}' + 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": [{"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "logging_supported": {"type": "fixed", "value": ["datapath"]}, "name": "network-fixed", "route_mode_supported": {"type": "fixed", "value": true}, "security_groups_supported": {"type": "fixed", "value": true}, "udp_supported": {"type": "fixed", "value": true}}], "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -24306,7 +24678,7 @@ def test_list_load_balancer_profiles_required_params(self): """ # 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": [{"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "logging_supported": {"type": "fixed", "value": ["datapath"]}, "name": "network-fixed", "route_mode_supported": {"type": "fixed", "value": true}, "security_groups_supported": {"type": "fixed", "value": true}}], "total_count": 132}' + 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": [{"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "logging_supported": {"type": "fixed", "value": ["datapath"]}, "name": "network-fixed", "route_mode_supported": {"type": "fixed", "value": true}, "security_groups_supported": {"type": "fixed", "value": true}, "udp_supported": {"type": "fixed", "value": true}}], "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -24337,7 +24709,7 @@ def test_list_load_balancer_profiles_value_error(self): """ # 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": [{"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "logging_supported": {"type": "fixed", "value": ["datapath"]}, "name": "network-fixed", "route_mode_supported": {"type": "fixed", "value": true}, "security_groups_supported": {"type": "fixed", "value": true}}], "total_count": 132}' + 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": [{"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "logging_supported": {"type": "fixed", "value": ["datapath"]}, "name": "network-fixed", "route_mode_supported": {"type": "fixed", "value": true}, "security_groups_supported": {"type": "fixed", "value": true}, "udp_supported": {"type": "fixed", "value": true}}], "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -24374,7 +24746,7 @@ def test_get_load_balancer_profile_all_params(self): """ # Set up mock url = preprocess_url('/load_balancer/profiles/testString') - mock_response = '{"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "logging_supported": {"type": "fixed", "value": ["datapath"]}, "name": "network-fixed", "route_mode_supported": {"type": "fixed", "value": true}, "security_groups_supported": {"type": "fixed", "value": true}}' + mock_response = '{"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "logging_supported": {"type": "fixed", "value": ["datapath"]}, "name": "network-fixed", "route_mode_supported": {"type": "fixed", "value": true}, "security_groups_supported": {"type": "fixed", "value": true}, "udp_supported": {"type": "fixed", "value": true}}' responses.add(responses.GET, url, body=mock_response, @@ -24410,7 +24782,7 @@ def test_get_load_balancer_profile_value_error(self): """ # Set up mock url = preprocess_url('/load_balancer/profiles/testString') - mock_response = '{"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "logging_supported": {"type": "fixed", "value": ["datapath"]}, "name": "network-fixed", "route_mode_supported": {"type": "fixed", "value": true}, "security_groups_supported": {"type": "fixed", "value": true}}' + mock_response = '{"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "logging_supported": {"type": "fixed", "value": ["datapath"]}, "name": "network-fixed", "route_mode_supported": {"type": "fixed", "value": true}, "security_groups_supported": {"type": "fixed", "value": true}, "udp_supported": {"type": "fixed", "value": true}}' responses.add(responses.GET, url, body=mock_response, @@ -24451,7 +24823,7 @@ def test_list_load_balancers_all_params(self): """ # 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": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "hostname": "my-load-balancer-123456-us-south-1.lb.bluemix.net", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "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"}], "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"}, "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers?limit=20"}, "limit": 20, "load_balancers": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "hostname": "my-load-balancer-123456-us-south-1.lb.bluemix.net", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "udp_supported": true}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -24494,7 +24866,7 @@ def test_list_load_balancers_required_params(self): """ # 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": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "hostname": "my-load-balancer-123456-us-south-1.lb.bluemix.net", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "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"}], "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"}, "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers?limit=20"}, "limit": 20, "load_balancers": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "hostname": "my-load-balancer-123456-us-south-1.lb.bluemix.net", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "udp_supported": true}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -24525,7 +24897,7 @@ def test_list_load_balancers_value_error(self): """ # 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": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "hostname": "my-load-balancer-123456-us-south-1.lb.bluemix.net", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "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"}], "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"}, "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers?limit=20"}, "limit": 20, "load_balancers": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "hostname": "my-load-balancer-123456-us-south-1.lb.bluemix.net", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "udp_supported": true}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -24562,7 +24934,7 @@ def test_create_load_balancer_all_params(self): """ # Set up mock url = preprocess_url('/load_balancers') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "hostname": "my-load-balancer-123456-us-south-1.lb.bluemix.net", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "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"}], "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"}, "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "hostname": "my-load-balancer-123456-us-south-1.lb.bluemix.net", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "udp_supported": true}' responses.add(responses.POST, url, body=mock_response, @@ -24700,7 +25072,7 @@ def test_create_load_balancer_value_error(self): """ # Set up mock url = preprocess_url('/load_balancers') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "hostname": "my-load-balancer-123456-us-south-1.lb.bluemix.net", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "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"}], "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"}, "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "hostname": "my-load-balancer-123456-us-south-1.lb.bluemix.net", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "udp_supported": true}' responses.add(responses.POST, url, body=mock_response, @@ -24894,7 +25266,7 @@ def test_get_load_balancer_all_params(self): """ # Set up mock url = preprocess_url('/load_balancers/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "hostname": "my-load-balancer-123456-us-south-1.lb.bluemix.net", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "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"}], "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"}, "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "hostname": "my-load-balancer-123456-us-south-1.lb.bluemix.net", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "udp_supported": true}' responses.add(responses.GET, url, body=mock_response, @@ -24930,7 +25302,7 @@ def test_get_load_balancer_value_error(self): """ # Set up mock url = preprocess_url('/load_balancers/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "hostname": "my-load-balancer-123456-us-south-1.lb.bluemix.net", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "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"}], "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"}, "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "hostname": "my-load-balancer-123456-us-south-1.lb.bluemix.net", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "udp_supported": true}' responses.add(responses.GET, url, body=mock_response, @@ -24971,7 +25343,7 @@ def test_update_load_balancer_all_params(self): """ # Set up mock url = preprocess_url('/load_balancers/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "hostname": "my-load-balancer-123456-us-south-1.lb.bluemix.net", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "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"}], "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"}, "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "hostname": "my-load-balancer-123456-us-south-1.lb.bluemix.net", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "udp_supported": true}' responses.add(responses.PATCH, url, body=mock_response, @@ -25025,7 +25397,7 @@ def test_update_load_balancer_value_error(self): """ # Set up mock url = preprocess_url('/load_balancers/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "hostname": "my-load-balancer-123456-us-south-1.lb.bluemix.net", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "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"}], "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"}, "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "hostname": "my-load-balancer-123456-us-south-1.lb.bluemix.net", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "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/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "udp_supported": true}' responses.add(responses.PATCH, url, body=mock_response, @@ -25158,7 +25530,7 @@ def test_list_load_balancer_listeners_all_params(self): """ # Set up mock url = preprocess_url('/load_balancers/testString/listeners') - mock_response = '{"listeners": [{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758"}, "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", "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"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}]}' + mock_response = '{"listeners": [{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/123456: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", "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"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}]}' responses.add(responses.GET, url, body=mock_response, @@ -25194,7 +25566,7 @@ def test_list_load_balancer_listeners_value_error(self): """ # Set up mock url = preprocess_url('/load_balancers/testString/listeners') - mock_response = '{"listeners": [{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758"}, "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", "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"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}]}' + mock_response = '{"listeners": [{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/123456: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", "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"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}]}' responses.add(responses.GET, url, body=mock_response, @@ -25235,7 +25607,7 @@ def test_create_load_balancer_listener_all_params(self): """ # Set up mock url = preprocess_url('/load_balancers/testString/listeners') - mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758"}, "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", "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"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}' + mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/123456: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", "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"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}' responses.add(responses.POST, url, body=mock_response, @@ -25244,7 +25616,7 @@ def test_create_load_balancer_listener_all_params(self): # Construct a dict representation of a CertificateInstanceIdentityByCRN model certificate_instance_identity_model = {} - certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758' + certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5' # Construct a dict representation of a LoadBalancerPoolIdentityById model load_balancer_pool_identity_model = {} @@ -25340,7 +25712,7 @@ def test_create_load_balancer_listener_value_error(self): """ # Set up mock url = preprocess_url('/load_balancers/testString/listeners') - mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758"}, "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", "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"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}' + mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/123456: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", "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"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}' responses.add(responses.POST, url, body=mock_response, @@ -25349,7 +25721,7 @@ def test_create_load_balancer_listener_value_error(self): # Construct a dict representation of a CertificateInstanceIdentityByCRN model certificate_instance_identity_model = {} - certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758' + certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5' # Construct a dict representation of a LoadBalancerPoolIdentityById model load_balancer_pool_identity_model = {} @@ -25504,7 +25876,7 @@ def test_get_load_balancer_listener_all_params(self): """ # Set up mock url = preprocess_url('/load_balancers/testString/listeners/testString') - mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758"}, "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", "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"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}' + mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/123456: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", "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"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}' responses.add(responses.GET, url, body=mock_response, @@ -25542,7 +25914,7 @@ def test_get_load_balancer_listener_value_error(self): """ # Set up mock url = preprocess_url('/load_balancers/testString/listeners/testString') - mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758"}, "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", "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"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}' + mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/123456: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", "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"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}' responses.add(responses.GET, url, body=mock_response, @@ -25585,7 +25957,7 @@ def test_update_load_balancer_listener_all_params(self): """ # Set up mock url = preprocess_url('/load_balancers/testString/listeners/testString') - mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758"}, "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", "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"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}' + mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/123456: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", "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"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}' responses.add(responses.PATCH, url, body=mock_response, @@ -25594,7 +25966,7 @@ def test_update_load_balancer_listener_all_params(self): # Construct a dict representation of a CertificateInstanceIdentityByCRN model certificate_instance_identity_model = {} - certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758' + certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5' # Construct a dict representation of a LoadBalancerPoolIdentityById model load_balancer_pool_identity_model = {} @@ -25658,7 +26030,7 @@ def test_update_load_balancer_listener_value_error(self): """ # Set up mock url = preprocess_url('/load_balancers/testString/listeners/testString') - mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758"}, "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", "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"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}' + mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/123456: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", "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"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}' responses.add(responses.PATCH, url, body=mock_response, @@ -25667,7 +26039,7 @@ def test_update_load_balancer_listener_value_error(self): # Construct a dict representation of a CertificateInstanceIdentityByCRN model certificate_instance_identity_model = {} - certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758' + certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5' # Construct a dict representation of a LoadBalancerPoolIdentityById model load_balancer_pool_identity_model = {} @@ -28099,7 +28471,7 @@ def test_list_endpoint_gateway_ips_all_params(self): """ # 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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway: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/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "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}' + 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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway: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/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "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}' responses.add(responses.GET, url, body=mock_response, @@ -28147,7 +28519,7 @@ def test_list_endpoint_gateway_ips_required_params(self): """ # 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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway: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/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "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}' + 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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway: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/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "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}' responses.add(responses.GET, url, body=mock_response, @@ -28183,7 +28555,7 @@ def test_list_endpoint_gateway_ips_value_error(self): """ # 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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway: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/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "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}' + 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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway: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/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "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}' responses.add(responses.GET, url, body=mock_response, @@ -28299,7 +28671,7 @@ def test_get_endpoint_gateway_ip_all_params(self): """ # 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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway: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/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}' + 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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway: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/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}' responses.add(responses.GET, url, body=mock_response, @@ -28337,7 +28709,7 @@ def test_get_endpoint_gateway_ip_value_error(self): """ # 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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway: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/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}' + 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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway: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/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}' responses.add(responses.GET, url, body=mock_response, @@ -28380,7 +28752,7 @@ def test_add_endpoint_gateway_ip_all_params(self): """ # 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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway: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/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}' + 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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway: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/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}' responses.add(responses.PUT, url, body=mock_response, @@ -28418,7 +28790,7 @@ def test_add_endpoint_gateway_ip_value_error(self): """ # 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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway: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/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}' + 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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway: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/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}' responses.add(responses.PUT, url, body=mock_response, @@ -28887,9 +29259,9 @@ def test_create_flow_log_collector_all_params(self): content_type='application/json', status=201) - # Construct a dict representation of a CloudObjectStorageBucketIdentityByName model - cloud_object_storage_bucket_identity_model = {} - cloud_object_storage_bucket_identity_model['name'] = 'bucket-27200-lwx4cfvcue' + # 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 FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityById model flow_log_collector_target_prototype_model = {} @@ -28900,7 +29272,7 @@ def test_create_flow_log_collector_all_params(self): resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' # Set up parameter values - storage_bucket = cloud_object_storage_bucket_identity_model + storage_bucket = legacy_cloud_object_storage_bucket_identity_model target = flow_log_collector_target_prototype_model active = False name = 'my-flow-log-collector' @@ -28921,7 +29293,7 @@ def test_create_flow_log_collector_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['storage_bucket'] == cloud_object_storage_bucket_identity_model + 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' @@ -28950,9 +29322,9 @@ def test_create_flow_log_collector_value_error(self): content_type='application/json', status=201) - # Construct a dict representation of a CloudObjectStorageBucketIdentityByName model - cloud_object_storage_bucket_identity_model = {} - cloud_object_storage_bucket_identity_model['name'] = 'bucket-27200-lwx4cfvcue' + # 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 FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityById model flow_log_collector_target_prototype_model = {} @@ -28963,7 +29335,7 @@ def test_create_flow_log_collector_value_error(self): resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' # Set up parameter values - storage_bucket = cloud_object_storage_bucket_identity_model + storage_bucket = legacy_cloud_object_storage_bucket_identity_model target = flow_log_collector_target_prototype_model active = False name = 'my-flow-log-collector' @@ -29466,6 +29838,17 @@ def test_bare_metal_server_serialization(self): network_interface_bare_metal_server_context_reference_deleted_model = {} # NetworkInterfaceBareMetalServerContextReferenceDeleted network_interface_bare_metal_server_context_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted + reserved_ip_reference_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['deleted'] = reserved_ip_reference_deleted_model + reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model['name'] = 'my-reserved-ip' + reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip' + subnet_reference_deleted_model = {} # SubnetReferenceDeleted subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' @@ -29481,7 +29864,7 @@ def test_bare_metal_server_serialization(self): network_interface_bare_metal_server_context_reference_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' network_interface_bare_metal_server_context_reference_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' network_interface_bare_metal_server_context_reference_model['name'] = 'my-network-interface' - network_interface_bare_metal_server_context_reference_model['primary_ipv4_address'] = '192.168.3.4' + 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 @@ -29629,6 +30012,17 @@ def test_bare_metal_server_collection_serialization(self): network_interface_bare_metal_server_context_reference_deleted_model = {} # NetworkInterfaceBareMetalServerContextReferenceDeleted network_interface_bare_metal_server_context_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted + reserved_ip_reference_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['deleted'] = reserved_ip_reference_deleted_model + reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model['name'] = 'my-reserved-ip' + reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip' + subnet_reference_deleted_model = {} # SubnetReferenceDeleted subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' @@ -29644,7 +30038,7 @@ def test_bare_metal_server_collection_serialization(self): network_interface_bare_metal_server_context_reference_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' network_interface_bare_metal_server_context_reference_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' network_interface_bare_metal_server_context_reference_model['name'] = 'my-network-interface' - network_interface_bare_metal_server_context_reference_model['primary_ipv4_address'] = '192.168.3.4' + 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 @@ -30083,6 +30477,17 @@ def test_bare_metal_server_network_interface_collection_serialization(self): floating_ip_reference_model['id'] = '39300233-9995-4806-89a5-3c1b6eb88689' floating_ip_reference_model['name'] = 'my-floating-ip' + reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted + reserved_ip_reference_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['deleted'] = reserved_ip_reference_deleted_model + reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model['id'] = '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_deleted_model = {} # SecurityGroupReferenceDeleted security_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' @@ -30114,7 +30519,7 @@ def test_bare_metal_server_network_interface_collection_serialization(self): bare_metal_server_network_interface_model['mac_address'] = '02:00:0a:00:23:94' bare_metal_server_network_interface_model['name'] = 'my-network-interface' bare_metal_server_network_interface_model['port_speed'] = 1000 - bare_metal_server_network_interface_model['primary_ipv4_address'] = '192.168.3.4' + 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' @@ -30279,6 +30684,11 @@ def test_bare_metal_server_primary_network_interface_prototype_serialization(sel # 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' + security_group_identity_model = {} # SecurityGroupIdentityById security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' @@ -30292,7 +30702,7 @@ def test_bare_metal_server_primary_network_interface_prototype_serialization(sel 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-network-interface' - bare_metal_server_primary_network_interface_prototype_model_json['primary_ipv4_address'] = '10.0.0.5' + 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 @@ -30835,7 +31245,7 @@ def test_certificate_instance_reference_serialization(self): # Construct a json representation of a CertificateInstanceReference model certificate_instance_reference_model_json = {} - certificate_instance_reference_model_json['crn'] = 'crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758' + certificate_instance_reference_model_json['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5' # 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) @@ -30852,35 +31262,6 @@ def test_certificate_instance_reference_serialization(self): certificate_instance_reference_model_json2 = certificate_instance_reference_model.to_dict() assert certificate_instance_reference_model_json2 == certificate_instance_reference_model_json -class TestModel_CloudObjectStorageBucketReference(): - """ - Test Class for CloudObjectStorageBucketReference - """ - - def test_cloud_object_storage_bucket_reference_serialization(self): - """ - Test serialization/deserialization for CloudObjectStorageBucketReference - """ - - # Construct a json representation of a CloudObjectStorageBucketReference model - cloud_object_storage_bucket_reference_model_json = {} - cloud_object_storage_bucket_reference_model_json['name'] = 'bucket-27200-lwx4cfvcue' - - # 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 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 cloud_object_storage_bucket_reference_model == cloud_object_storage_bucket_reference_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 - class TestModel_DedicatedHost(): """ Test Class for DedicatedHost @@ -30952,8 +31333,8 @@ def test_dedicated_host_serialization(self): resource_group_reference_model['name'] = 'my-resource-group' instance_profile_reference_model = {} # InstanceProfileReference - instance_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16' - instance_profile_reference_model['name'] = 'bc1-4x16' + instance_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16' + instance_profile_reference_model['name'] = 'bx2-4x16' zone_reference_model = {} # ZoneReference zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' @@ -31070,8 +31451,8 @@ def test_dedicated_host_collection_serialization(self): resource_group_reference_model['name'] = 'my-resource-group' instance_profile_reference_model = {} # InstanceProfileReference - instance_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16' - instance_profile_reference_model['name'] = 'bc1-4x16' + instance_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16' + instance_profile_reference_model['name'] = 'bx2-4x16' zone_reference_model = {} # ZoneReference zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' @@ -31353,8 +31734,8 @@ def test_dedicated_host_group_serialization(self): resource_group_reference_model['name'] = 'my-resource-group' instance_profile_reference_model = {} # InstanceProfileReference - instance_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16' - instance_profile_reference_model['name'] = 'bc1-4x16' + instance_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16' + instance_profile_reference_model['name'] = 'bx2-4x16' zone_reference_model = {} # ZoneReference zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' @@ -31422,8 +31803,8 @@ def test_dedicated_host_group_collection_serialization(self): resource_group_reference_model['name'] = 'my-resource-group' instance_profile_reference_model = {} # InstanceProfileReference - instance_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16' - instance_profile_reference_model['name'] = 'bc1-4x16' + instance_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16' + instance_profile_reference_model['name'] = 'bx2-4x16' zone_reference_model = {} # ZoneReference zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' @@ -31732,8 +32113,8 @@ def test_dedicated_host_profile_serialization(self): dedicated_host_profile_socket_model['value'] = 2 instance_profile_reference_model = {} # InstanceProfileReference - instance_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16' - instance_profile_reference_model['name'] = 'bc1-4x16' + instance_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16' + instance_profile_reference_model['name'] = 'bx2-4x16' dedicated_host_profile_vcpu_architecture_model = {} # DedicatedHostProfileVCPUArchitecture dedicated_host_profile_vcpu_architecture_model['type'] = 'fixed' @@ -31820,8 +32201,8 @@ def test_dedicated_host_profile_collection_serialization(self): dedicated_host_profile_socket_model['value'] = 2 instance_profile_reference_model = {} # InstanceProfileReference - instance_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16' - instance_profile_reference_model['name'] = 'bc1-4x16' + instance_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16' + instance_profile_reference_model['name'] = 'bx2-4x16' dedicated_host_profile_vcpu_architecture_model = {} # DedicatedHostProfileVCPUArchitecture dedicated_host_profile_vcpu_architecture_model['type'] = 'fixed' @@ -32783,12 +33164,23 @@ def test_floating_ip_serialization(self): network_interface_reference_deleted_model = {} # NetworkInterfaceReferenceDeleted network_interface_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted + reserved_ip_reference_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['deleted'] = reserved_ip_reference_deleted_model + reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model['id'] = '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 floating_ip_target_model['deleted'] = network_interface_reference_deleted_model floating_ip_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' floating_ip_target_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' floating_ip_target_model['name'] = 'my-network-interface' - floating_ip_target_model['primary_ipv4_address'] = '192.168.3.4' + floating_ip_target_model['primary_ip'] = reserved_ip_reference_model floating_ip_target_model['resource_type'] = 'network_interface' zone_reference_model = {} # ZoneReference @@ -32846,12 +33238,23 @@ def test_floating_ip_collection_serialization(self): network_interface_reference_deleted_model = {} # NetworkInterfaceReferenceDeleted network_interface_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted + reserved_ip_reference_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['deleted'] = reserved_ip_reference_deleted_model + reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model['id'] = '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 floating_ip_target_model['deleted'] = network_interface_reference_deleted_model floating_ip_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' floating_ip_target_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' floating_ip_target_model['name'] = 'my-network-interface' - floating_ip_target_model['primary_ipv4_address'] = '192.168.3.4' + floating_ip_target_model['primary_ip'] = reserved_ip_reference_model floating_ip_target_model['resource_type'] = 'network_interface' zone_reference_model = {} # ZoneReference @@ -33077,12 +33480,23 @@ def test_floating_ip_unpaginated_collection_serialization(self): network_interface_reference_deleted_model = {} # NetworkInterfaceReferenceDeleted network_interface_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted + reserved_ip_reference_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['deleted'] = reserved_ip_reference_deleted_model + reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model['id'] = '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 floating_ip_target_model['deleted'] = network_interface_reference_deleted_model floating_ip_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' floating_ip_target_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' floating_ip_target_model['name'] = 'my-network-interface' - floating_ip_target_model['primary_ipv4_address'] = '192.168.3.4' + floating_ip_target_model['primary_ip'] = reserved_ip_reference_model floating_ip_target_model['resource_type'] = 'network_interface' zone_reference_model = {} # ZoneReference @@ -33137,8 +33551,8 @@ def test_flow_log_collector_serialization(self): resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['name'] = 'my-resource-group' - cloud_object_storage_bucket_reference_model = {} # CloudObjectStorageBucketReference - cloud_object_storage_bucket_reference_model['name'] = 'bucket-27200-lwx4cfvcue' + legacy_cloud_object_storage_bucket_reference_model = {} # LegacyCloudObjectStorageBucketReference + legacy_cloud_object_storage_bucket_reference_model['name'] = 'bucket-27200-lwx4cfvcue' network_interface_reference_target_context_deleted_model = {} # NetworkInterfaceReferenceTargetContextDeleted network_interface_reference_target_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' @@ -33171,7 +33585,7 @@ def test_flow_log_collector_serialization(self): flow_log_collector_model_json['lifecycle_state'] = 'stable' flow_log_collector_model_json['name'] = 'my-flow-log-collector' flow_log_collector_model_json['resource_group'] = resource_group_reference_model - flow_log_collector_model_json['storage_bucket'] = cloud_object_storage_bucket_reference_model + flow_log_collector_model_json['storage_bucket'] = legacy_cloud_object_storage_bucket_reference_model flow_log_collector_model_json['target'] = flow_log_collector_target_model flow_log_collector_model_json['vpc'] = vpc_reference_model @@ -33210,8 +33624,8 @@ def test_flow_log_collector_collection_serialization(self): resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' resource_group_reference_model['name'] = 'my-resource-group' - cloud_object_storage_bucket_reference_model = {} # CloudObjectStorageBucketReference - cloud_object_storage_bucket_reference_model['name'] = 'bucket-27200-lwx4cfvcue' + legacy_cloud_object_storage_bucket_reference_model = {} # LegacyCloudObjectStorageBucketReference + legacy_cloud_object_storage_bucket_reference_model['name'] = 'bucket-27200-lwx4cfvcue' network_interface_reference_target_context_deleted_model = {} # NetworkInterfaceReferenceTargetContextDeleted network_interface_reference_target_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' @@ -33243,7 +33657,7 @@ def test_flow_log_collector_collection_serialization(self): flow_log_collector_model['lifecycle_state'] = 'stable' flow_log_collector_model['name'] = 'my-flow-log-collector' flow_log_collector_model['resource_group'] = resource_group_reference_model - flow_log_collector_model['storage_bucket'] = cloud_object_storage_bucket_reference_model + flow_log_collector_model['storage_bucket'] = legacy_cloud_object_storage_bucket_reference_model flow_log_collector_model['target'] = flow_log_collector_target_model flow_log_collector_model['vpc'] = vpc_reference_model @@ -33361,6 +33775,35 @@ def test_flow_log_collector_patch_serialization(self): flow_log_collector_patch_model_json2 = flow_log_collector_patch_model.to_dict() assert flow_log_collector_patch_model_json2 == flow_log_collector_patch_model_json +class TestModel_GenericResourceReferenceDeleted(): + """ + Test Class for GenericResourceReferenceDeleted + """ + + def test_generic_resource_reference_deleted_serialization(self): + """ + Test serialization/deserialization for GenericResourceReferenceDeleted + """ + + # Construct a json representation of a GenericResourceReferenceDeleted model + generic_resource_reference_deleted_model_json = {} + generic_resource_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + # Construct a model instance of GenericResourceReferenceDeleted by calling from_dict on the json representation + generic_resource_reference_deleted_model = GenericResourceReferenceDeleted.from_dict(generic_resource_reference_deleted_model_json) + assert generic_resource_reference_deleted_model != False + + # Construct a model instance of GenericResourceReferenceDeleted by calling from_dict on the json representation + generic_resource_reference_deleted_model_dict = GenericResourceReferenceDeleted.from_dict(generic_resource_reference_deleted_model_json).__dict__ + generic_resource_reference_deleted_model2 = GenericResourceReferenceDeleted(**generic_resource_reference_deleted_model_dict) + + # Verify the model instances are equivalent + assert generic_resource_reference_deleted_model == generic_resource_reference_deleted_model2 + + # Convert model instance back to dict and verify no loss of data + generic_resource_reference_deleted_model_json2 = generic_resource_reference_deleted_model.to_dict() + assert generic_resource_reference_deleted_model_json2 == generic_resource_reference_deleted_model_json + class TestModel_IKEPolicy(): """ Test Class for IKEPolicy @@ -34437,6 +34880,9 @@ def test_instance_serialization(self): # Construct dict forms of any model objects needed in order to build this model. + instance_availability_policy_model = {} # InstanceAvailabilityPolicy + instance_availability_policy_model['host_failure'] = 'restart' + volume_attachment_reference_instance_context_deleted_model = {} # VolumeAttachmentReferenceInstanceContextDeleted volume_attachment_reference_instance_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' @@ -34497,9 +34943,23 @@ def test_instance_serialization(self): image_reference_model['id'] = '9aaf3bcb-dcd7-4de7-bb60-24e39ff9d366' image_reference_model['name'] = 'my-image' + instance_metadata_service_model = {} # InstanceMetadataService + instance_metadata_service_model['enabled'] = True + network_interface_instance_context_reference_deleted_model = {} # NetworkInterfaceInstanceContextReferenceDeleted network_interface_instance_context_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted + reserved_ip_reference_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['deleted'] = reserved_ip_reference_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['resource_type'] = 'subnet_reserved_ip' + subnet_reference_deleted_model = {} # SubnetReferenceDeleted subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' @@ -34515,7 +34975,7 @@ def test_instance_serialization(self): network_interface_instance_context_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/e402fa1b-96f6-4aa2-a8d7-703aac843651/network_interfaces/7ca88dfb-8962-469d-b1de-1dd56f4c3275' network_interface_instance_context_reference_model['id'] = '7ca88dfb-8962-469d-b1de-1dd56f4c3275' network_interface_instance_context_reference_model['name'] = 'my-network-interface' - network_interface_instance_context_reference_model['primary_ipv4_address'] = '10.0.0.32' + network_interface_instance_context_reference_model['primary_ip'] = reserved_ip_reference_model network_interface_instance_context_reference_model['resource_type'] = 'network_interface' network_interface_instance_context_reference_model['subnet'] = subnet_reference_model @@ -34564,6 +35024,7 @@ def test_instance_serialization(self): # Construct a json representation of a Instance model instance_model_json = {} + instance_model_json['availability_policy'] = instance_availability_policy_model instance_model_json['bandwidth'] = 1000 instance_model_json['boot_volume_attachment'] = volume_attachment_reference_instance_context_model instance_model_json['created_at'] = "2019-01-01T12:00:00Z" @@ -34575,6 +35036,7 @@ def test_instance_serialization(self): instance_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' instance_model_json['image'] = image_reference_model instance_model_json['memory'] = 8 + instance_model_json['metadata_service'] = instance_metadata_service_model instance_model_json['name'] = 'my-instance' instance_model_json['network_interfaces'] = [network_interface_instance_context_reference_model] instance_model_json['placement_target'] = instance_placement_target_model @@ -34642,6 +35104,93 @@ def test_instance_action_serialization(self): instance_action_model_json2 = instance_action_model.to_dict() assert instance_action_model_json2 == instance_action_model_json +class TestModel_InstanceAvailabilityPolicy(): + """ + Test Class for InstanceAvailabilityPolicy + """ + + def test_instance_availability_policy_serialization(self): + """ + Test serialization/deserialization for InstanceAvailabilityPolicy + """ + + # Construct a json representation of a InstanceAvailabilityPolicy model + instance_availability_policy_model_json = {} + instance_availability_policy_model_json['host_failure'] = 'restart' + + # Construct a model instance of InstanceAvailabilityPolicy by calling from_dict on the json representation + instance_availability_policy_model = InstanceAvailabilityPolicy.from_dict(instance_availability_policy_model_json) + assert instance_availability_policy_model != False + + # Construct a model instance of InstanceAvailabilityPolicy by calling from_dict on the json representation + instance_availability_policy_model_dict = InstanceAvailabilityPolicy.from_dict(instance_availability_policy_model_json).__dict__ + instance_availability_policy_model2 = InstanceAvailabilityPolicy(**instance_availability_policy_model_dict) + + # Verify the model instances are equivalent + assert instance_availability_policy_model == instance_availability_policy_model2 + + # Convert model instance back to dict and verify no loss of data + instance_availability_policy_model_json2 = instance_availability_policy_model.to_dict() + assert instance_availability_policy_model_json2 == instance_availability_policy_model_json + +class TestModel_InstanceAvailabilityPolicyPatch(): + """ + Test Class for InstanceAvailabilityPolicyPatch + """ + + def test_instance_availability_policy_patch_serialization(self): + """ + Test serialization/deserialization for InstanceAvailabilityPolicyPatch + """ + + # Construct a json representation of a InstanceAvailabilityPolicyPatch model + instance_availability_policy_patch_model_json = {} + instance_availability_policy_patch_model_json['host_failure'] = 'restart' + + # Construct a model instance of InstanceAvailabilityPolicyPatch by calling from_dict on the json representation + instance_availability_policy_patch_model = InstanceAvailabilityPolicyPatch.from_dict(instance_availability_policy_patch_model_json) + assert instance_availability_policy_patch_model != False + + # Construct a model instance of InstanceAvailabilityPolicyPatch by calling from_dict on the json representation + instance_availability_policy_patch_model_dict = InstanceAvailabilityPolicyPatch.from_dict(instance_availability_policy_patch_model_json).__dict__ + instance_availability_policy_patch_model2 = InstanceAvailabilityPolicyPatch(**instance_availability_policy_patch_model_dict) + + # Verify the model instances are equivalent + assert instance_availability_policy_patch_model == instance_availability_policy_patch_model2 + + # Convert model instance back to dict and verify no loss of data + instance_availability_policy_patch_model_json2 = instance_availability_policy_patch_model.to_dict() + assert instance_availability_policy_patch_model_json2 == instance_availability_policy_patch_model_json + +class TestModel_InstanceAvailabilityPrototype(): + """ + Test Class for InstanceAvailabilityPrototype + """ + + def test_instance_availability_prototype_serialization(self): + """ + Test serialization/deserialization for InstanceAvailabilityPrototype + """ + + # Construct a json representation of a InstanceAvailabilityPrototype model + instance_availability_prototype_model_json = {} + instance_availability_prototype_model_json['host_failure'] = 'restart' + + # Construct a model instance of InstanceAvailabilityPrototype by calling from_dict on the json representation + instance_availability_prototype_model = InstanceAvailabilityPrototype.from_dict(instance_availability_prototype_model_json) + assert instance_availability_prototype_model != False + + # Construct a model instance of InstanceAvailabilityPrototype by calling from_dict on the json representation + instance_availability_prototype_model_dict = InstanceAvailabilityPrototype.from_dict(instance_availability_prototype_model_json).__dict__ + instance_availability_prototype_model2 = InstanceAvailabilityPrototype(**instance_availability_prototype_model_dict) + + # Verify the model instances are equivalent + assert instance_availability_prototype_model == instance_availability_prototype_model2 + + # Convert model instance back to dict and verify no loss of data + instance_availability_prototype_model_json2 = instance_availability_prototype_model.to_dict() + assert instance_availability_prototype_model_json2 == instance_availability_prototype_model_json + class TestModel_InstanceCollection(): """ Test Class for InstanceCollection @@ -34657,6 +35206,9 @@ def test_instance_collection_serialization(self): instance_collection_first_model = {} # InstanceCollectionFirst instance_collection_first_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' + volume_attachment_reference_instance_context_deleted_model = {} # VolumeAttachmentReferenceInstanceContextDeleted volume_attachment_reference_instance_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' @@ -34717,9 +35269,23 @@ def test_instance_collection_serialization(self): image_reference_model['id'] = '72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' image_reference_model['name'] = 'my-image' + instance_metadata_service_model = {} # InstanceMetadataService + instance_metadata_service_model['enabled'] = True + network_interface_instance_context_reference_deleted_model = {} # NetworkInterfaceInstanceContextReferenceDeleted network_interface_instance_context_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted + reserved_ip_reference_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['deleted'] = reserved_ip_reference_deleted_model + reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model['name'] = 'my-reserved-ip' + reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip' + subnet_reference_deleted_model = {} # SubnetReferenceDeleted subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' @@ -34735,7 +35301,7 @@ def test_instance_collection_serialization(self): network_interface_instance_context_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' network_interface_instance_context_reference_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' network_interface_instance_context_reference_model['name'] = 'my-network-interface' - network_interface_instance_context_reference_model['primary_ipv4_address'] = '192.168.3.4' + network_interface_instance_context_reference_model['primary_ip'] = reserved_ip_reference_model network_interface_instance_context_reference_model['resource_type'] = 'network_interface' network_interface_instance_context_reference_model['subnet'] = subnet_reference_model @@ -34751,8 +35317,8 @@ def test_instance_collection_serialization(self): instance_placement_target_model['resource_type'] = 'dedicated_host_group' instance_profile_reference_model = {} # InstanceProfileReference - instance_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16' - instance_profile_reference_model['name'] = 'bc1-4x16' + instance_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16' + instance_profile_reference_model['name'] = 'bx2-4x16' resource_group_reference_model = {} # ResourceGroupReference resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' @@ -34783,6 +35349,7 @@ def test_instance_collection_serialization(self): zone_reference_model['name'] = 'us-south-1' instance_model = {} # Instance + instance_model['availability_policy'] = instance_availability_policy_model instance_model['bandwidth'] = 1000 instance_model['boot_volume_attachment'] = volume_attachment_reference_instance_context_model instance_model['created_at'] = "2019-01-01T12:00:00Z" @@ -34794,6 +35361,7 @@ def test_instance_collection_serialization(self): instance_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' instance_model['image'] = image_reference_model instance_model['memory'] = 8 + instance_model['metadata_service'] = instance_metadata_service_model instance_model['name'] = 'my-instance' instance_model['network_interfaces'] = [network_interface_instance_context_reference_model] instance_model['placement_target'] = instance_placement_target_model @@ -34928,6 +35496,41 @@ def test_instance_console_access_token_serialization(self): instance_console_access_token_model_json2 = instance_console_access_token_model.to_dict() assert instance_console_access_token_model_json2 == instance_console_access_token_model_json +class TestModel_InstanceDefaultTrustedProfilePrototype(): + """ + Test Class for InstanceDefaultTrustedProfilePrototype + """ + + def test_instance_default_trusted_profile_prototype_serialization(self): + """ + Test serialization/deserialization for InstanceDefaultTrustedProfilePrototype + """ + + # Construct dict forms of any model objects needed in order to build this model. + + trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById + trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5' + + # Construct a json representation of a InstanceDefaultTrustedProfilePrototype model + instance_default_trusted_profile_prototype_model_json = {} + instance_default_trusted_profile_prototype_model_json['auto_link'] = False + instance_default_trusted_profile_prototype_model_json['target'] = trusted_profile_identity_model + + # Construct a model instance of InstanceDefaultTrustedProfilePrototype by calling from_dict on the json representation + instance_default_trusted_profile_prototype_model = InstanceDefaultTrustedProfilePrototype.from_dict(instance_default_trusted_profile_prototype_model_json) + assert instance_default_trusted_profile_prototype_model != False + + # Construct a model instance of InstanceDefaultTrustedProfilePrototype by calling from_dict on the json representation + instance_default_trusted_profile_prototype_model_dict = InstanceDefaultTrustedProfilePrototype.from_dict(instance_default_trusted_profile_prototype_model_json).__dict__ + instance_default_trusted_profile_prototype_model2 = InstanceDefaultTrustedProfilePrototype(**instance_default_trusted_profile_prototype_model_dict) + + # Verify the model instances are equivalent + assert instance_default_trusted_profile_prototype_model == instance_default_trusted_profile_prototype_model2 + + # Convert model instance back to dict and verify no loss of data + instance_default_trusted_profile_prototype_model_json2 = instance_default_trusted_profile_prototype_model.to_dict() + assert instance_default_trusted_profile_prototype_model_json2 == instance_default_trusted_profile_prototype_model_json + class TestModel_InstanceDisk(): """ Test Class for InstanceDisk @@ -36534,6 +37137,15 @@ 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['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5' + trusted_profile_reference_model['resource_type'] = 'trusted_profile' + + instance_initialization_default_trusted_profile_model = {} # InstanceInitializationDefaultTrustedProfile + instance_initialization_default_trusted_profile_model['auto_link'] = True + instance_initialization_default_trusted_profile_model['target'] = trusted_profile_reference_model + key_reference_deleted_model = {} # KeyReferenceDeleted key_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' @@ -36554,6 +37166,7 @@ def test_instance_initialization_serialization(self): # Construct a json representation of a InstanceInitialization model instance_initialization_model_json = {} + instance_initialization_model_json['default_trusted_profile'] = instance_initialization_default_trusted_profile_model instance_initialization_model_json['keys'] = [key_reference_model] instance_initialization_model_json['password'] = instance_initialization_password_model @@ -36572,6 +37185,43 @@ def test_instance_initialization_serialization(self): instance_initialization_model_json2 = instance_initialization_model.to_dict() assert instance_initialization_model_json2 == instance_initialization_model_json +class TestModel_InstanceInitializationDefaultTrustedProfile(): + """ + Test Class for InstanceInitializationDefaultTrustedProfile + """ + + def test_instance_initialization_default_trusted_profile_serialization(self): + """ + Test serialization/deserialization for InstanceInitializationDefaultTrustedProfile + """ + + # 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:v1:bluemix:public:iam-identity::a/123456::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' + + # Construct a json representation of a InstanceInitializationDefaultTrustedProfile model + instance_initialization_default_trusted_profile_model_json = {} + instance_initialization_default_trusted_profile_model_json['auto_link'] = True + instance_initialization_default_trusted_profile_model_json['target'] = trusted_profile_reference_model + + # Construct a model instance of InstanceInitializationDefaultTrustedProfile by calling from_dict on the json representation + instance_initialization_default_trusted_profile_model = InstanceInitializationDefaultTrustedProfile.from_dict(instance_initialization_default_trusted_profile_model_json) + assert instance_initialization_default_trusted_profile_model != False + + # Construct a model instance of InstanceInitializationDefaultTrustedProfile by calling from_dict on the json representation + instance_initialization_default_trusted_profile_model_dict = InstanceInitializationDefaultTrustedProfile.from_dict(instance_initialization_default_trusted_profile_model_json).__dict__ + instance_initialization_default_trusted_profile_model2 = InstanceInitializationDefaultTrustedProfile(**instance_initialization_default_trusted_profile_model_dict) + + # Verify the model instances are equivalent + assert instance_initialization_default_trusted_profile_model == instance_initialization_default_trusted_profile_model2 + + # Convert model instance back to dict and verify no loss of data + instance_initialization_default_trusted_profile_model_json2 = instance_initialization_default_trusted_profile_model.to_dict() + assert instance_initialization_default_trusted_profile_model_json2 == instance_initialization_default_trusted_profile_model_json + class TestModel_InstanceInitializationPassword(): """ Test Class for InstanceInitializationPassword @@ -36607,6 +37257,93 @@ def test_instance_initialization_password_serialization(self): instance_initialization_password_model_json2 = instance_initialization_password_model.to_dict() assert instance_initialization_password_model_json2 == instance_initialization_password_model_json +class TestModel_InstanceMetadataService(): + """ + Test Class for InstanceMetadataService + """ + + def test_instance_metadata_service_serialization(self): + """ + Test serialization/deserialization for InstanceMetadataService + """ + + # Construct a json representation of a InstanceMetadataService model + instance_metadata_service_model_json = {} + instance_metadata_service_model_json['enabled'] = True + + # Construct a model instance of InstanceMetadataService by calling from_dict on the json representation + instance_metadata_service_model = InstanceMetadataService.from_dict(instance_metadata_service_model_json) + assert instance_metadata_service_model != False + + # Construct a model instance of InstanceMetadataService by calling from_dict on the json representation + instance_metadata_service_model_dict = InstanceMetadataService.from_dict(instance_metadata_service_model_json).__dict__ + instance_metadata_service_model2 = InstanceMetadataService(**instance_metadata_service_model_dict) + + # Verify the model instances are equivalent + assert instance_metadata_service_model == instance_metadata_service_model2 + + # Convert model instance back to dict and verify no loss of data + instance_metadata_service_model_json2 = instance_metadata_service_model.to_dict() + assert instance_metadata_service_model_json2 == instance_metadata_service_model_json + +class TestModel_InstanceMetadataServicePatch(): + """ + Test Class for InstanceMetadataServicePatch + """ + + def test_instance_metadata_service_patch_serialization(self): + """ + Test serialization/deserialization for InstanceMetadataServicePatch + """ + + # Construct a json representation of a InstanceMetadataServicePatch model + instance_metadata_service_patch_model_json = {} + instance_metadata_service_patch_model_json['enabled'] = True + + # Construct a model instance of InstanceMetadataServicePatch by calling from_dict on the json representation + instance_metadata_service_patch_model = InstanceMetadataServicePatch.from_dict(instance_metadata_service_patch_model_json) + assert instance_metadata_service_patch_model != False + + # Construct a model instance of InstanceMetadataServicePatch by calling from_dict on the json representation + instance_metadata_service_patch_model_dict = InstanceMetadataServicePatch.from_dict(instance_metadata_service_patch_model_json).__dict__ + instance_metadata_service_patch_model2 = InstanceMetadataServicePatch(**instance_metadata_service_patch_model_dict) + + # Verify the model instances are equivalent + assert instance_metadata_service_patch_model == instance_metadata_service_patch_model2 + + # Convert model instance back to dict and verify no loss of data + instance_metadata_service_patch_model_json2 = instance_metadata_service_patch_model.to_dict() + assert instance_metadata_service_patch_model_json2 == instance_metadata_service_patch_model_json + +class TestModel_InstanceMetadataServicePrototype(): + """ + Test Class for InstanceMetadataServicePrototype + """ + + def test_instance_metadata_service_prototype_serialization(self): + """ + Test serialization/deserialization for InstanceMetadataServicePrototype + """ + + # Construct a json representation of a InstanceMetadataServicePrototype model + instance_metadata_service_prototype_model_json = {} + instance_metadata_service_prototype_model_json['enabled'] = True + + # Construct a model instance of InstanceMetadataServicePrototype by calling from_dict on the json representation + instance_metadata_service_prototype_model = InstanceMetadataServicePrototype.from_dict(instance_metadata_service_prototype_model_json) + assert instance_metadata_service_prototype_model != False + + # Construct a model instance of InstanceMetadataServicePrototype by calling from_dict on the json representation + instance_metadata_service_prototype_model_dict = InstanceMetadataServicePrototype.from_dict(instance_metadata_service_prototype_model_json).__dict__ + instance_metadata_service_prototype_model2 = InstanceMetadataServicePrototype(**instance_metadata_service_prototype_model_dict) + + # Verify the model instances are equivalent + assert instance_metadata_service_prototype_model == instance_metadata_service_prototype_model2 + + # Convert model instance back to dict and verify no loss of data + instance_metadata_service_prototype_model_json2 = instance_metadata_service_prototype_model.to_dict() + assert instance_metadata_service_prototype_model_json2 == instance_metadata_service_prototype_model_json + class TestModel_InstancePatch(): """ Test Class for InstancePatch @@ -36619,14 +37356,22 @@ def test_instance_patch_serialization(self): # Construct dict forms of any model objects needed in order to build this model. + instance_availability_policy_patch_model = {} # InstanceAvailabilityPolicyPatch + instance_availability_policy_patch_model['host_failure'] = 'restart' + + instance_metadata_service_patch_model = {} # InstanceMetadataServicePatch + instance_metadata_service_patch_model['enabled'] = True + instance_placement_target_patch_model = {} # InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById instance_placement_target_patch_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' instance_patch_profile_model = {} # InstancePatchProfileInstanceProfileIdentityByName - instance_patch_profile_model['name'] = 'bc1-4x16' + instance_patch_profile_model['name'] = 'bx2-4x16' # Construct a json representation of a InstancePatch model instance_patch_model_json = {} + instance_patch_model_json['availability_policy'] = instance_availability_policy_patch_model + instance_patch_model_json['metadata_service'] = instance_metadata_service_patch_model instance_patch_model_json['name'] = 'my-instance' instance_patch_model_json['placement_target'] = instance_placement_target_patch_model instance_patch_model_json['profile'] = instance_patch_profile_model @@ -36732,9 +37477,9 @@ def test_instance_profile_serialization(self): instance_profile_model_json['gpu_manufacturer'] = instance_profile_gpu_manufacturer_model instance_profile_model_json['gpu_memory'] = instance_profile_gpu_memory_model instance_profile_model_json['gpu_model'] = instance_profile_gpu_model_model - instance_profile_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16' + instance_profile_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16' instance_profile_model_json['memory'] = instance_profile_memory_model - instance_profile_model_json['name'] = 'bc1-4x16' + instance_profile_model_json['name'] = 'bx2-4x16' instance_profile_model_json['os_architecture'] = instance_profile_os_architecture_model instance_profile_model_json['port_speed'] = instance_profile_port_speed_model instance_profile_model_json['total_volume_bandwidth'] = instance_profile_volume_bandwidth_model @@ -36840,9 +37585,9 @@ def test_instance_profile_collection_serialization(self): instance_profile_model['gpu_manufacturer'] = instance_profile_gpu_manufacturer_model instance_profile_model['gpu_memory'] = instance_profile_gpu_memory_model instance_profile_model['gpu_model'] = instance_profile_gpu_model_model - instance_profile_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16' + instance_profile_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16' instance_profile_model['memory'] = instance_profile_memory_model - instance_profile_model['name'] = 'bc1-4x16' + instance_profile_model['name'] = 'bx2-4x16' instance_profile_model['os_architecture'] = instance_profile_os_architecture_model instance_profile_model['port_speed'] = instance_profile_port_speed_model instance_profile_model['total_volume_bandwidth'] = instance_profile_volume_bandwidth_model @@ -37048,8 +37793,8 @@ def test_instance_profile_reference_serialization(self): # Construct a json representation of a InstanceProfileReference model instance_profile_reference_model_json = {} - instance_profile_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16' - instance_profile_reference_model_json['name'] = 'bc1-4x16' + instance_profile_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16' + instance_profile_reference_model_json['name'] = 'bx2-4x16' # Construct a model instance of InstanceProfileReference by calling from_dict on the json representation instance_profile_reference_model = InstanceProfileReference.from_dict(instance_profile_reference_model_json) @@ -37213,9 +37958,27 @@ def test_instance_template_collection_serialization(self): 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' + instance_availability_prototype_model = {} # InstanceAvailabilityPrototype + instance_availability_prototype_model['host_failure'] = 'restart' + + trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById + trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5' + + instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype + instance_default_trusted_profile_prototype_model['auto_link'] = False + instance_default_trusted_profile_prototype_model['target'] = trusted_profile_identity_model + key_identity_model = {} # KeyIdentityById key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' + instance_metadata_service_prototype_model = {} # InstanceMetadataServicePrototype + instance_metadata_service_prototype_model['enabled'] = True + + 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' + security_group_identity_model = {} # SecurityGroupIdentityById security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' @@ -37225,7 +37988,7 @@ def test_instance_template_collection_serialization(self): network_interface_prototype_model = {} # NetworkInterfacePrototype network_interface_prototype_model['allow_ip_spoofing'] = True network_interface_prototype_model['name'] = 'my-network-interface' - network_interface_prototype_model['primary_ipv4_address'] = '10.0.0.5' + network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model network_interface_prototype_model['security_groups'] = [security_group_identity_model] network_interface_prototype_model['subnet'] = subnet_identity_model @@ -37233,7 +37996,7 @@ def test_instance_template_collection_serialization(self): instance_placement_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' instance_profile_identity_model = {} # InstanceProfileIdentityByName - instance_profile_identity_model['name'] = 'cc1-16x32' + instance_profile_identity_model['name'] = 'cx2-16x32' resource_group_reference_model = {} # ResourceGroupReference resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' @@ -37258,7 +38021,7 @@ def test_instance_template_collection_serialization(self): volume_profile_identity_model['name'] = 'general-purpose' volume_prototype_instance_by_image_context_model = {} # VolumePrototypeInstanceByImageContext - volume_prototype_instance_by_image_context_model['capacity'] = 38 + volume_prototype_instance_by_image_context_model['capacity'] = 250 volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model volume_prototype_instance_by_image_context_model['iops'] = 10000 volume_prototype_instance_by_image_context_model['name'] = 'my-volume' @@ -37276,11 +38039,14 @@ def test_instance_template_collection_serialization(self): zone_identity_model['name'] = 'us-south-1' instance_template_model = {} # InstanceTemplateInstanceByImage + instance_template_model['availability_policy'] = instance_availability_prototype_model instance_template_model['created_at'] = "2019-01-01T12:00:00Z" instance_template_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_template_model['default_trusted_profile'] = instance_default_trusted_profile_prototype_model instance_template_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a' instance_template_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' instance_template_model['keys'] = [key_identity_model] + instance_template_model['metadata_service'] = instance_metadata_service_prototype_model instance_template_model['name'] = 'my-instance-template' instance_template_model['network_interfaces'] = [network_interface_prototype_model] instance_template_model['placement_target'] = instance_placement_target_prototype_model @@ -37760,6 +38526,35 @@ def test_key_reference_deleted_serialization(self): key_reference_deleted_model_json2 = key_reference_deleted_model.to_dict() assert key_reference_deleted_model_json2 == key_reference_deleted_model_json +class TestModel_LegacyCloudObjectStorageBucketReference(): + """ + Test Class for LegacyCloudObjectStorageBucketReference + """ + + def test_legacy_cloud_object_storage_bucket_reference_serialization(self): + """ + Test serialization/deserialization for LegacyCloudObjectStorageBucketReference + """ + + # Construct a json representation of a LegacyCloudObjectStorageBucketReference model + legacy_cloud_object_storage_bucket_reference_model_json = {} + legacy_cloud_object_storage_bucket_reference_model_json['name'] = 'bucket-27200-lwx4cfvcue' + + # Construct a model instance of LegacyCloudObjectStorageBucketReference by calling from_dict on the json representation + legacy_cloud_object_storage_bucket_reference_model = LegacyCloudObjectStorageBucketReference.from_dict(legacy_cloud_object_storage_bucket_reference_model_json) + assert legacy_cloud_object_storage_bucket_reference_model != False + + # Construct a model instance of LegacyCloudObjectStorageBucketReference by calling from_dict on the json representation + legacy_cloud_object_storage_bucket_reference_model_dict = LegacyCloudObjectStorageBucketReference.from_dict(legacy_cloud_object_storage_bucket_reference_model_json).__dict__ + legacy_cloud_object_storage_bucket_reference_model2 = LegacyCloudObjectStorageBucketReference(**legacy_cloud_object_storage_bucket_reference_model_dict) + + # Verify the model instances are equivalent + assert legacy_cloud_object_storage_bucket_reference_model == legacy_cloud_object_storage_bucket_reference_model2 + + # Convert model instance back to dict and verify no loss of data + legacy_cloud_object_storage_bucket_reference_model_json2 = legacy_cloud_object_storage_bucket_reference_model.to_dict() + assert legacy_cloud_object_storage_bucket_reference_model_json2 == legacy_cloud_object_storage_bucket_reference_model_json + class TestModel_LoadBalancer(): """ Test Class for LoadBalancer @@ -37795,14 +38590,25 @@ def test_load_balancer_serialization(self): load_balancer_pool_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' load_balancer_pool_reference_model['name'] = 'my-load-balancer-pool' - ip_model = {} # IP - ip_model['address'] = '192.168.3.4' + reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted + reserved_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + load_balancer_private_ips_item_model = {} # LoadBalancerPrivateIpsItem + load_balancer_private_ips_item_model['address'] = '192.168.3.4' + load_balancer_private_ips_item_model['deleted'] = reserved_ip_reference_deleted_model + load_balancer_private_ips_item_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb' + load_balancer_private_ips_item_model['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb' + load_balancer_private_ips_item_model['name'] = 'my-reserved-ip' + load_balancer_private_ips_item_model['resource_type'] = 'subnet_reserved_ip' load_balancer_profile_reference_model = {} # LoadBalancerProfileReference load_balancer_profile_reference_model['family'] = 'network' load_balancer_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed' load_balancer_profile_reference_model['name'] = 'network-fixed' + ip_model = {} # IP + ip_model['address'] = '192.168.3.4' + 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' @@ -37841,15 +38647,17 @@ def test_load_balancer_serialization(self): load_balancer_model_json['name'] = 'my-load-balancer' load_balancer_model_json['operating_status'] = 'offline' load_balancer_model_json['pools'] = [load_balancer_pool_reference_model] - load_balancer_model_json['private_ips'] = [ip_model] + load_balancer_model_json['private_ips'] = [load_balancer_private_ips_item_model] load_balancer_model_json['profile'] = load_balancer_profile_reference_model load_balancer_model_json['provisioning_status'] = 'active' load_balancer_model_json['public_ips'] = [ip_model] load_balancer_model_json['resource_group'] = resource_group_reference_model + load_balancer_model_json['resource_type'] = 'load_balancer' load_balancer_model_json['route_mode'] = True load_balancer_model_json['security_groups'] = [security_group_reference_model] load_balancer_model_json['security_groups_supported'] = True load_balancer_model_json['subnets'] = [subnet_reference_model] + load_balancer_model_json['udp_supported'] = True # Construct a model instance of LoadBalancer by calling from_dict on the json representation load_balancer_model = LoadBalancer.from_dict(load_balancer_model_json) @@ -37904,14 +38712,25 @@ def test_load_balancer_collection_serialization(self): load_balancer_pool_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' load_balancer_pool_reference_model['name'] = 'my-load-balancer-pool' - ip_model = {} # IP - ip_model['address'] = '192.168.3.4' + reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted + reserved_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + load_balancer_private_ips_item_model = {} # LoadBalancerPrivateIpsItem + load_balancer_private_ips_item_model['address'] = '192.168.3.4' + load_balancer_private_ips_item_model['deleted'] = reserved_ip_reference_deleted_model + load_balancer_private_ips_item_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb' + load_balancer_private_ips_item_model['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb' + load_balancer_private_ips_item_model['name'] = 'my-reserved-ip' + load_balancer_private_ips_item_model['resource_type'] = 'subnet_reserved_ip' load_balancer_profile_reference_model = {} # LoadBalancerProfileReference load_balancer_profile_reference_model['family'] = 'network' load_balancer_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed' load_balancer_profile_reference_model['name'] = 'network-fixed' + ip_model = {} # IP + ip_model['address'] = '192.168.3.4' + 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' @@ -37949,15 +38768,17 @@ def test_load_balancer_collection_serialization(self): load_balancer_model['name'] = 'my-load-balancer' load_balancer_model['operating_status'] = 'offline' load_balancer_model['pools'] = [load_balancer_pool_reference_model] - load_balancer_model['private_ips'] = [ip_model] + load_balancer_model['private_ips'] = [load_balancer_private_ips_item_model] load_balancer_model['profile'] = load_balancer_profile_reference_model load_balancer_model['provisioning_status'] = 'active' load_balancer_model['public_ips'] = [ip_model] load_balancer_model['resource_group'] = resource_group_reference_model + load_balancer_model['resource_type'] = 'load_balancer' load_balancer_model['route_mode'] = True load_balancer_model['security_groups'] = [security_group_reference_model] load_balancer_model['security_groups_supported'] = True 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' @@ -38056,7 +38877,7 @@ def test_load_balancer_listener_serialization(self): # Construct dict forms of any model objects needed in order to build this model. certificate_instance_reference_model = {} # CertificateInstanceReference - certificate_instance_reference_model['crn'] = 'crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758' + certificate_instance_reference_model['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5' load_balancer_pool_reference_deleted_model = {} # LoadBalancerPoolReferenceDeleted load_balancer_pool_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' @@ -38133,7 +38954,7 @@ def test_load_balancer_listener_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. certificate_instance_reference_model = {} # CertificateInstanceReference - certificate_instance_reference_model['crn'] = 'crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758' + certificate_instance_reference_model['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5' load_balancer_pool_reference_deleted_model = {} # LoadBalancerPoolReferenceDeleted load_balancer_pool_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' @@ -38326,7 +39147,7 @@ def test_load_balancer_listener_patch_serialization(self): # Construct dict forms of any model objects needed in order to build this model. certificate_instance_identity_model = {} # CertificateInstanceIdentityByCRN - certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758' + certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5' load_balancer_pool_identity_model = {} # LoadBalancerPoolIdentityById load_balancer_pool_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' @@ -39813,6 +40634,45 @@ def test_load_balancer_pool_session_persistence_prototype_serialization(self): load_balancer_pool_session_persistence_prototype_model_json2 = load_balancer_pool_session_persistence_prototype_model.to_dict() assert load_balancer_pool_session_persistence_prototype_model_json2 == load_balancer_pool_session_persistence_prototype_model_json +class TestModel_LoadBalancerPrivateIpsItem(): + """ + Test Class for LoadBalancerPrivateIpsItem + """ + + def test_load_balancer_private_ips_item_serialization(self): + """ + Test serialization/deserialization for LoadBalancerPrivateIpsItem + """ + + # Construct dict forms of any model objects needed in order to build this model. + + reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted + reserved_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + # Construct a json representation of a LoadBalancerPrivateIpsItem model + load_balancer_private_ips_item_model_json = {} + load_balancer_private_ips_item_model_json['address'] = '192.168.3.4' + load_balancer_private_ips_item_model_json['deleted'] = reserved_ip_reference_deleted_model + load_balancer_private_ips_item_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb' + load_balancer_private_ips_item_model_json['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb' + load_balancer_private_ips_item_model_json['name'] = 'my-reserved-ip' + load_balancer_private_ips_item_model_json['resource_type'] = 'subnet_reserved_ip' + + # Construct a model instance of LoadBalancerPrivateIpsItem by calling from_dict on the json representation + load_balancer_private_ips_item_model = LoadBalancerPrivateIpsItem.from_dict(load_balancer_private_ips_item_model_json) + assert load_balancer_private_ips_item_model != False + + # Construct a model instance of LoadBalancerPrivateIpsItem by calling from_dict on the json representation + load_balancer_private_ips_item_model_dict = LoadBalancerPrivateIpsItem.from_dict(load_balancer_private_ips_item_model_json).__dict__ + load_balancer_private_ips_item_model2 = LoadBalancerPrivateIpsItem(**load_balancer_private_ips_item_model_dict) + + # Verify the model instances are equivalent + assert load_balancer_private_ips_item_model == load_balancer_private_ips_item_model2 + + # Convert model instance back to dict and verify no loss of data + load_balancer_private_ips_item_model_json2 = load_balancer_private_ips_item_model.to_dict() + assert load_balancer_private_ips_item_model_json2 == load_balancer_private_ips_item_model_json + class TestModel_LoadBalancerProfile(): """ Test Class for LoadBalancerProfile @@ -39837,6 +40697,10 @@ def test_load_balancer_profile_serialization(self): load_balancer_profile_security_groups_supported_model['type'] = 'fixed' load_balancer_profile_security_groups_supported_model['value'] = True + load_balancer_profile_udp_supported_model = {} # LoadBalancerProfileUDPSupportedFixed + load_balancer_profile_udp_supported_model['type'] = 'fixed' + load_balancer_profile_udp_supported_model['value'] = True + # Construct a json representation of a LoadBalancerProfile model load_balancer_profile_model_json = {} load_balancer_profile_model_json['family'] = 'network' @@ -39845,6 +40709,7 @@ def test_load_balancer_profile_serialization(self): load_balancer_profile_model_json['name'] = 'network-fixed' load_balancer_profile_model_json['route_mode_supported'] = load_balancer_profile_route_mode_supported_model load_balancer_profile_model_json['security_groups_supported'] = load_balancer_profile_security_groups_supported_model + load_balancer_profile_model_json['udp_supported'] = load_balancer_profile_udp_supported_model # Construct a model instance of LoadBalancerProfile by calling from_dict on the json representation load_balancer_profile_model = LoadBalancerProfile.from_dict(load_balancer_profile_model_json) @@ -39891,6 +40756,10 @@ def test_load_balancer_profile_collection_serialization(self): load_balancer_profile_security_groups_supported_model['type'] = 'fixed' load_balancer_profile_security_groups_supported_model['value'] = True + load_balancer_profile_udp_supported_model = {} # LoadBalancerProfileUDPSupportedFixed + load_balancer_profile_udp_supported_model['type'] = 'fixed' + load_balancer_profile_udp_supported_model['value'] = True + load_balancer_profile_model = {} # LoadBalancerProfile load_balancer_profile_model['family'] = 'network' load_balancer_profile_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed' @@ -39898,6 +40767,7 @@ def test_load_balancer_profile_collection_serialization(self): load_balancer_profile_model['name'] = 'network-fixed' load_balancer_profile_model['route_mode_supported'] = load_balancer_profile_route_mode_supported_model load_balancer_profile_model['security_groups_supported'] = load_balancer_profile_security_groups_supported_model + load_balancer_profile_model['udp_supported'] = load_balancer_profile_udp_supported_model # Construct a json representation of a LoadBalancerProfileCollection model load_balancer_profile_collection_model_json = {} @@ -40702,6 +41572,17 @@ def test_network_interface_serialization(self): floating_ip_reference_model['id'] = '181b8670-52bf-47af-a5ca-7aff7f3824d1' floating_ip_reference_model['name'] = 'my-floating-ip' + reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted + reserved_ip_reference_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['deleted'] = reserved_ip_reference_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['resource_type'] = 'subnet_reserved_ip' + security_group_reference_deleted_model = {} # SecurityGroupReferenceDeleted security_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' @@ -40731,7 +41612,7 @@ def test_network_interface_serialization(self): network_interface_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' network_interface_model_json['name'] = 'my-network-interface' network_interface_model_json['port_speed'] = 1000 - network_interface_model_json['primary_ipv4_address'] = '192.168.3.4' + network_interface_model_json['primary_ip'] = reserved_ip_reference_model network_interface_model_json['resource_type'] = 'network_interface' network_interface_model_json['security_groups'] = [security_group_reference_model] network_interface_model_json['status'] = 'available' @@ -40768,6 +41649,17 @@ def test_network_interface_bare_metal_server_context_reference_serialization(sel network_interface_bare_metal_server_context_reference_deleted_model = {} # NetworkInterfaceBareMetalServerContextReferenceDeleted network_interface_bare_metal_server_context_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted + reserved_ip_reference_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['deleted'] = reserved_ip_reference_deleted_model + reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model['name'] = 'my-reserved-ip' + reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip' + subnet_reference_deleted_model = {} # SubnetReferenceDeleted subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' @@ -40784,7 +41676,7 @@ def test_network_interface_bare_metal_server_context_reference_serialization(sel 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['name'] = 'my-network-interface' - network_interface_bare_metal_server_context_reference_model_json['primary_ipv4_address'] = '192.168.3.4' + 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' network_interface_bare_metal_server_context_reference_model_json['subnet'] = subnet_reference_model @@ -40832,151 +41724,6 @@ def test_network_interface_bare_metal_server_context_reference_deleted_serializa network_interface_bare_metal_server_context_reference_deleted_model_json2 = network_interface_bare_metal_server_context_reference_deleted_model.to_dict() assert network_interface_bare_metal_server_context_reference_deleted_model_json2 == network_interface_bare_metal_server_context_reference_deleted_model_json -class TestModel_NetworkInterfaceCollection(): - """ - Test Class for NetworkInterfaceCollection - """ - - def test_network_interface_collection_serialization(self): - """ - Test serialization/deserialization for NetworkInterfaceCollection - """ - - # Construct dict forms of any model objects needed in order to build this model. - - network_interface_collection_first_model = {} # NetworkInterfaceCollectionFirst - network_interface_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?limit=20' - - floating_ip_reference_deleted_model = {} # FloatingIPReferenceDeleted - floating_ip_reference_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/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689' - floating_ip_reference_model['deleted'] = floating_ip_reference_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' - - security_group_reference_deleted_model = {} # SecurityGroupReferenceDeleted - security_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - security_group_reference_model = {} # SecurityGroupReference - security_group_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271' - security_group_reference_model['deleted'] = security_group_reference_deleted_model - security_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271' - security_group_reference_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' - security_group_reference_model['name'] = 'my-security-group' - - subnet_reference_deleted_model = {} # SubnetReferenceDeleted - subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - subnet_reference_model = {} # SubnetReference - subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e' - subnet_reference_model['deleted'] = subnet_reference_deleted_model - subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e' - subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' - subnet_reference_model['name'] = 'my-subnet' - - network_interface_model = {} # NetworkInterface - network_interface_model['allow_ip_spoofing'] = True - network_interface_model['created_at'] = "2019-01-01T12:00:00Z" - network_interface_model['floating_ips'] = [floating_ip_reference_model] - network_interface_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' - network_interface_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' - network_interface_model['name'] = 'my-network-interface' - network_interface_model['port_speed'] = 1000 - network_interface_model['primary_ipv4_address'] = '192.168.3.4' - network_interface_model['resource_type'] = 'network_interface' - network_interface_model['security_groups'] = [security_group_reference_model] - network_interface_model['status'] = 'available' - network_interface_model['subnet'] = subnet_reference_model - network_interface_model['type'] = 'primary' - - network_interface_collection_next_model = {} # NetworkInterfaceCollectionNext - network_interface_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20' - - # Construct a json representation of a NetworkInterfaceCollection model - network_interface_collection_model_json = {} - network_interface_collection_model_json['first'] = network_interface_collection_first_model - network_interface_collection_model_json['limit'] = 20 - network_interface_collection_model_json['network_interfaces'] = [network_interface_model] - network_interface_collection_model_json['next'] = network_interface_collection_next_model - network_interface_collection_model_json['total_count'] = 132 - - # Construct a model instance of NetworkInterfaceCollection by calling from_dict on the json representation - network_interface_collection_model = NetworkInterfaceCollection.from_dict(network_interface_collection_model_json) - assert network_interface_collection_model != False - - # Construct a model instance of NetworkInterfaceCollection by calling from_dict on the json representation - network_interface_collection_model_dict = NetworkInterfaceCollection.from_dict(network_interface_collection_model_json).__dict__ - network_interface_collection_model2 = NetworkInterfaceCollection(**network_interface_collection_model_dict) - - # Verify the model instances are equivalent - assert network_interface_collection_model == network_interface_collection_model2 - - # Convert model instance back to dict and verify no loss of data - network_interface_collection_model_json2 = network_interface_collection_model.to_dict() - assert network_interface_collection_model_json2 == network_interface_collection_model_json - -class TestModel_NetworkInterfaceCollectionFirst(): - """ - Test Class for NetworkInterfaceCollectionFirst - """ - - def test_network_interface_collection_first_serialization(self): - """ - Test serialization/deserialization for NetworkInterfaceCollectionFirst - """ - - # Construct a json representation of a NetworkInterfaceCollectionFirst model - network_interface_collection_first_model_json = {} - network_interface_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?limit=20' - - # Construct a model instance of NetworkInterfaceCollectionFirst by calling from_dict on the json representation - network_interface_collection_first_model = NetworkInterfaceCollectionFirst.from_dict(network_interface_collection_first_model_json) - assert network_interface_collection_first_model != False - - # Construct a model instance of NetworkInterfaceCollectionFirst by calling from_dict on the json representation - network_interface_collection_first_model_dict = NetworkInterfaceCollectionFirst.from_dict(network_interface_collection_first_model_json).__dict__ - network_interface_collection_first_model2 = NetworkInterfaceCollectionFirst(**network_interface_collection_first_model_dict) - - # Verify the model instances are equivalent - assert network_interface_collection_first_model == network_interface_collection_first_model2 - - # Convert model instance back to dict and verify no loss of data - network_interface_collection_first_model_json2 = network_interface_collection_first_model.to_dict() - assert network_interface_collection_first_model_json2 == network_interface_collection_first_model_json - -class TestModel_NetworkInterfaceCollectionNext(): - """ - Test Class for NetworkInterfaceCollectionNext - """ - - def test_network_interface_collection_next_serialization(self): - """ - Test serialization/deserialization for NetworkInterfaceCollectionNext - """ - - # Construct a json representation of a NetworkInterfaceCollectionNext model - network_interface_collection_next_model_json = {} - network_interface_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20' - - # Construct a model instance of NetworkInterfaceCollectionNext by calling from_dict on the json representation - network_interface_collection_next_model = NetworkInterfaceCollectionNext.from_dict(network_interface_collection_next_model_json) - assert network_interface_collection_next_model != False - - # Construct a model instance of NetworkInterfaceCollectionNext by calling from_dict on the json representation - network_interface_collection_next_model_dict = NetworkInterfaceCollectionNext.from_dict(network_interface_collection_next_model_json).__dict__ - network_interface_collection_next_model2 = NetworkInterfaceCollectionNext(**network_interface_collection_next_model_dict) - - # Verify the model instances are equivalent - assert network_interface_collection_next_model == network_interface_collection_next_model2 - - # Convert model instance back to dict and verify no loss of data - network_interface_collection_next_model_json2 = network_interface_collection_next_model.to_dict() - assert network_interface_collection_next_model_json2 == network_interface_collection_next_model_json - class TestModel_NetworkInterfaceInstanceContextReference(): """ Test Class for NetworkInterfaceInstanceContextReference @@ -40992,6 +41739,17 @@ def test_network_interface_instance_context_reference_serialization(self): network_interface_instance_context_reference_deleted_model = {} # NetworkInterfaceInstanceContextReferenceDeleted network_interface_instance_context_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted + reserved_ip_reference_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['deleted'] = reserved_ip_reference_deleted_model + reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model['name'] = 'my-reserved-ip' + reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip' + subnet_reference_deleted_model = {} # SubnetReferenceDeleted subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' @@ -41008,7 +41766,7 @@ def test_network_interface_instance_context_reference_serialization(self): network_interface_instance_context_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' network_interface_instance_context_reference_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' network_interface_instance_context_reference_model_json['name'] = 'my-network-interface' - network_interface_instance_context_reference_model_json['primary_ipv4_address'] = '192.168.3.4' + network_interface_instance_context_reference_model_json['primary_ip'] = reserved_ip_reference_model network_interface_instance_context_reference_model_json['resource_type'] = 'network_interface' network_interface_instance_context_reference_model_json['subnet'] = subnet_reference_model @@ -41098,6 +41856,11 @@ def test_network_interface_prototype_serialization(self): # 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' + security_group_identity_model = {} # SecurityGroupIdentityById security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' @@ -41108,7 +41871,7 @@ def test_network_interface_prototype_serialization(self): network_interface_prototype_model_json = {} network_interface_prototype_model_json['allow_ip_spoofing'] = True network_interface_prototype_model_json['name'] = 'my-network-interface' - network_interface_prototype_model_json['primary_ipv4_address'] = '10.0.0.5' + network_interface_prototype_model_json['primary_ip'] = network_interface_ip_prototype_model network_interface_prototype_model_json['security_groups'] = [security_group_identity_model] network_interface_prototype_model_json['subnet'] = subnet_identity_model @@ -41127,45 +41890,6 @@ def test_network_interface_prototype_serialization(self): network_interface_prototype_model_json2 = network_interface_prototype_model.to_dict() assert network_interface_prototype_model_json2 == network_interface_prototype_model_json -class TestModel_NetworkInterfaceReference(): - """ - Test Class for NetworkInterfaceReference - """ - - def test_network_interface_reference_serialization(self): - """ - Test serialization/deserialization for NetworkInterfaceReference - """ - - # Construct dict forms of any model objects needed in order to build this model. - - network_interface_reference_deleted_model = {} # NetworkInterfaceReferenceDeleted - network_interface_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - # Construct a json representation of a NetworkInterfaceReference model - network_interface_reference_model_json = {} - network_interface_reference_model_json['deleted'] = network_interface_reference_deleted_model - network_interface_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' - network_interface_reference_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' - network_interface_reference_model_json['name'] = 'my-network-interface' - network_interface_reference_model_json['primary_ipv4_address'] = '192.168.3.4' - network_interface_reference_model_json['resource_type'] = 'network_interface' - - # Construct a model instance of NetworkInterfaceReference by calling from_dict on the json representation - network_interface_reference_model = NetworkInterfaceReference.from_dict(network_interface_reference_model_json) - assert network_interface_reference_model != False - - # Construct a model instance of NetworkInterfaceReference by calling from_dict on the json representation - network_interface_reference_model_dict = NetworkInterfaceReference.from_dict(network_interface_reference_model_json).__dict__ - network_interface_reference_model2 = NetworkInterfaceReference(**network_interface_reference_model_dict) - - # Verify the model instances are equivalent - assert network_interface_reference_model == network_interface_reference_model2 - - # Convert model instance back to dict and verify no loss of data - network_interface_reference_model_json2 = network_interface_reference_model.to_dict() - assert network_interface_reference_model_json2 == network_interface_reference_model_json - class TestModel_NetworkInterfaceReferenceDeleted(): """ Test Class for NetworkInterfaceReferenceDeleted @@ -41247,6 +41971,17 @@ def test_network_interface_unpaginated_collection_serialization(self): floating_ip_reference_model['id'] = '181b8670-52bf-47af-a5ca-7aff7f3824d1' floating_ip_reference_model['name'] = 'my-floating-ip' + reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted + reserved_ip_reference_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['deleted'] = reserved_ip_reference_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['resource_type'] = 'subnet_reserved_ip' + security_group_reference_deleted_model = {} # SecurityGroupReferenceDeleted security_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' @@ -41275,7 +42010,7 @@ def test_network_interface_unpaginated_collection_serialization(self): network_interface_model['id'] = '35bd3f19-bdd4-434b-ad6a-5e9358d65e20' network_interface_model['name'] = 'molecule-find-wild-name-dictionary-trench' network_interface_model['port_speed'] = 1000 - network_interface_model['primary_ipv4_address'] = '10.0.0.32' + network_interface_model['primary_ip'] = reserved_ip_reference_model network_interface_model['resource_type'] = 'network_interface' network_interface_model['security_groups'] = [security_group_reference_model] network_interface_model['status'] = 'available' @@ -42170,6 +42905,7 @@ def test_reserved_ip_serialization(self): reserved_ip_model_json['created_at'] = "2019-01-01T12:00:00Z" reserved_ip_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb' reserved_ip_model_json['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_model_json['lifecycle_state'] = 'stable' reserved_ip_model_json['name'] = 'my-reserved-ip' reserved_ip_model_json['owner'] = 'user' reserved_ip_model_json['resource_type'] = 'subnet_reserved_ip' @@ -42225,6 +42961,7 @@ def test_reserved_ip_collection_serialization(self): reserved_ip_model['created_at'] = "2019-01-01T12:00:00Z" reserved_ip_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb' reserved_ip_model['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_model['lifecycle_state'] = 'stable' reserved_ip_model['name'] = 'my-reserved-ip' reserved_ip_model['owner'] = 'user' reserved_ip_model['resource_type'] = 'subnet_reserved_ip' @@ -42285,6 +43022,7 @@ def test_reserved_ip_collection_endpoint_gateway_context_serialization(self): reserved_ip_model['created_at'] = "2019-01-01T12:00:00Z" reserved_ip_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb' reserved_ip_model['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_model['lifecycle_state'] = 'stable' reserved_ip_model['name'] = 'my-reserved-ip' reserved_ip_model['owner'] = 'user' reserved_ip_model['resource_type'] = 'subnet_reserved_ip' @@ -42403,6 +43141,128 @@ def test_reserved_ip_collection_first_serialization(self): 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_ReservedIPCollectionNetworkInterfaceContext(): + """ + Test Class for ReservedIPCollectionNetworkInterfaceContext + """ + + def test_reserved_ip_collection_network_interface_context_serialization(self): + """ + Test serialization/deserialization for ReservedIPCollectionNetworkInterfaceContext + """ + + # Construct dict forms of any model objects needed in order to build this model. + + reserved_ip_collection_network_interface_context_first_model = {} # ReservedIPCollectionNetworkInterfaceContextFirst + reserved_ip_collection_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' + + endpoint_gateway_reference_deleted_model = {} # EndpointGatewayReferenceDeleted + endpoint_gateway_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + reserved_ip_target_model = {} # ReservedIPTargetEndpointGatewayReference + reserved_ip_target_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5' + reserved_ip_target_model['deleted'] = endpoint_gateway_reference_deleted_model + reserved_ip_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5' + reserved_ip_target_model['id'] = 'd7cc5196-9864-48c4-82d8-3f30da41fcc5' + reserved_ip_target_model['name'] = 'my-endpoint-gateway' + reserved_ip_target_model['resource_type'] = 'endpoint_gateway' + + reserved_ip_model = {} # ReservedIP + reserved_ip_model['address'] = '192.168.3.4' + 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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_model['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_model['lifecycle_state'] = 'stable' + reserved_ip_model['name'] = 'my-reserved-ip' + reserved_ip_model['owner'] = 'user' + reserved_ip_model['resource_type'] = 'subnet_reserved_ip' + reserved_ip_model['target'] = reserved_ip_target_model + + reserved_ip_collection_network_interface_context_next_model = {} # ReservedIPCollectionNetworkInterfaceContextNext + reserved_ip_collection_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 ReservedIPCollectionNetworkInterfaceContext model + reserved_ip_collection_network_interface_context_model_json = {} + reserved_ip_collection_network_interface_context_model_json['first'] = reserved_ip_collection_network_interface_context_first_model + reserved_ip_collection_network_interface_context_model_json['ips'] = [reserved_ip_model] + reserved_ip_collection_network_interface_context_model_json['limit'] = 20 + reserved_ip_collection_network_interface_context_model_json['next'] = reserved_ip_collection_network_interface_context_next_model + reserved_ip_collection_network_interface_context_model_json['total_count'] = 132 + + # Construct a model instance of ReservedIPCollectionNetworkInterfaceContext by calling from_dict on the json representation + reserved_ip_collection_network_interface_context_model = ReservedIPCollectionNetworkInterfaceContext.from_dict(reserved_ip_collection_network_interface_context_model_json) + assert reserved_ip_collection_network_interface_context_model != False + + # Construct a model instance of ReservedIPCollectionNetworkInterfaceContext by calling from_dict on the json representation + reserved_ip_collection_network_interface_context_model_dict = ReservedIPCollectionNetworkInterfaceContext.from_dict(reserved_ip_collection_network_interface_context_model_json).__dict__ + reserved_ip_collection_network_interface_context_model2 = ReservedIPCollectionNetworkInterfaceContext(**reserved_ip_collection_network_interface_context_model_dict) + + # Verify the model instances are equivalent + assert reserved_ip_collection_network_interface_context_model == reserved_ip_collection_network_interface_context_model2 + + # Convert model instance back to dict and verify no loss of data + reserved_ip_collection_network_interface_context_model_json2 = reserved_ip_collection_network_interface_context_model.to_dict() + assert reserved_ip_collection_network_interface_context_model_json2 == reserved_ip_collection_network_interface_context_model_json + +class TestModel_ReservedIPCollectionNetworkInterfaceContextFirst(): + """ + Test Class for ReservedIPCollectionNetworkInterfaceContextFirst + """ + + def test_reserved_ip_collection_network_interface_context_first_serialization(self): + """ + Test serialization/deserialization for ReservedIPCollectionNetworkInterfaceContextFirst + """ + + # Construct a json representation of a ReservedIPCollectionNetworkInterfaceContextFirst model + reserved_ip_collection_network_interface_context_first_model_json = {} + reserved_ip_collection_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 ReservedIPCollectionNetworkInterfaceContextFirst by calling from_dict on the json representation + reserved_ip_collection_network_interface_context_first_model = ReservedIPCollectionNetworkInterfaceContextFirst.from_dict(reserved_ip_collection_network_interface_context_first_model_json) + assert reserved_ip_collection_network_interface_context_first_model != False + + # Construct a model instance of ReservedIPCollectionNetworkInterfaceContextFirst by calling from_dict on the json representation + reserved_ip_collection_network_interface_context_first_model_dict = ReservedIPCollectionNetworkInterfaceContextFirst.from_dict(reserved_ip_collection_network_interface_context_first_model_json).__dict__ + reserved_ip_collection_network_interface_context_first_model2 = ReservedIPCollectionNetworkInterfaceContextFirst(**reserved_ip_collection_network_interface_context_first_model_dict) + + # Verify the model instances are equivalent + assert reserved_ip_collection_network_interface_context_first_model == reserved_ip_collection_network_interface_context_first_model2 + + # Convert model instance back to dict and verify no loss of data + reserved_ip_collection_network_interface_context_first_model_json2 = reserved_ip_collection_network_interface_context_first_model.to_dict() + assert reserved_ip_collection_network_interface_context_first_model_json2 == reserved_ip_collection_network_interface_context_first_model_json + +class TestModel_ReservedIPCollectionNetworkInterfaceContextNext(): + """ + Test Class for ReservedIPCollectionNetworkInterfaceContextNext + """ + + def test_reserved_ip_collection_network_interface_context_next_serialization(self): + """ + Test serialization/deserialization for ReservedIPCollectionNetworkInterfaceContextNext + """ + + # Construct a json representation of a ReservedIPCollectionNetworkInterfaceContextNext model + reserved_ip_collection_network_interface_context_next_model_json = {} + reserved_ip_collection_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 ReservedIPCollectionNetworkInterfaceContextNext by calling from_dict on the json representation + reserved_ip_collection_network_interface_context_next_model = ReservedIPCollectionNetworkInterfaceContextNext.from_dict(reserved_ip_collection_network_interface_context_next_model_json) + assert reserved_ip_collection_network_interface_context_next_model != False + + # Construct a model instance of ReservedIPCollectionNetworkInterfaceContextNext by calling from_dict on the json representation + reserved_ip_collection_network_interface_context_next_model_dict = ReservedIPCollectionNetworkInterfaceContextNext.from_dict(reserved_ip_collection_network_interface_context_next_model_json).__dict__ + reserved_ip_collection_network_interface_context_next_model2 = ReservedIPCollectionNetworkInterfaceContextNext(**reserved_ip_collection_network_interface_context_next_model_dict) + + # Verify the model instances are equivalent + assert reserved_ip_collection_network_interface_context_next_model == reserved_ip_collection_network_interface_context_next_model2 + + # Convert model instance back to dict and verify no loss of data + reserved_ip_collection_network_interface_context_next_model_json2 = reserved_ip_collection_network_interface_context_next_model.to_dict() + assert reserved_ip_collection_network_interface_context_next_model_json2 == reserved_ip_collection_network_interface_context_next_model_json + class TestModel_ReservedIPCollectionNext(): """ Test Class for ReservedIPCollectionNext @@ -43164,17 +44024,6 @@ def test_security_group_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - network_interface_reference_deleted_model = {} # NetworkInterfaceReferenceDeleted - network_interface_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - network_interface_reference_model = {} # NetworkInterfaceReference - network_interface_reference_model['deleted'] = network_interface_reference_deleted_model - network_interface_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' - network_interface_reference_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' - network_interface_reference_model['name'] = 'my-network-interface' - network_interface_reference_model['primary_ipv4_address'] = '192.168.3.4' - network_interface_reference_model['resource_type'] = 'network_interface' - 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' @@ -43218,7 +44067,6 @@ def test_security_group_serialization(self): security_group_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271' security_group_model_json['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' security_group_model_json['name'] = 'my-security-group' - security_group_model_json['network_interfaces'] = [network_interface_reference_model] security_group_model_json['resource_group'] = resource_group_reference_model security_group_model_json['rules'] = [security_group_rule_model] security_group_model_json['targets'] = [security_group_target_reference_model] @@ -43257,17 +44105,6 @@ def test_security_group_collection_serialization(self): 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' - network_interface_reference_deleted_model = {} # NetworkInterfaceReferenceDeleted - network_interface_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - network_interface_reference_model = {} # NetworkInterfaceReference - network_interface_reference_model['deleted'] = network_interface_reference_deleted_model - network_interface_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' - network_interface_reference_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' - network_interface_reference_model['name'] = 'my-network-interface' - network_interface_reference_model['primary_ipv4_address'] = '192.168.3.4' - network_interface_reference_model['resource_type'] = 'network_interface' - 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' @@ -43310,7 +44147,6 @@ def test_security_group_collection_serialization(self): security_group_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271' security_group_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' security_group_model['name'] = 'my-security-group' - security_group_model['network_interfaces'] = [network_interface_reference_model] security_group_model['resource_group'] = resource_group_reference_model security_group_model['rules'] = [security_group_rule_model] security_group_model['targets'] = [security_group_target_reference_model] @@ -43751,9 +44587,11 @@ def test_snapshot_serialization(self): snapshot_model_json['operating_system'] = operating_system_model snapshot_model_json['resource_group'] = resource_group_reference_model snapshot_model_json['resource_type'] = 'snapshot' + snapshot_model_json['service_tags'] = ['testString'] snapshot_model_json['size'] = 1 snapshot_model_json['source_image'] = image_reference_model snapshot_model_json['source_volume'] = volume_reference_model + snapshot_model_json['user_tags'] = ['testString'] # Construct a model instance of Snapshot by calling from_dict on the json representation snapshot_model = Snapshot.from_dict(snapshot_model_json) @@ -43842,9 +44680,11 @@ def test_snapshot_collection_serialization(self): snapshot_model['operating_system'] = operating_system_model snapshot_model['resource_group'] = resource_group_reference_model snapshot_model['resource_type'] = 'snapshot' + snapshot_model['service_tags'] = ['testString'] snapshot_model['size'] = 1 snapshot_model['source_image'] = image_reference_model snapshot_model['source_volume'] = volume_reference_model + snapshot_model['user_tags'] = ['testString'] # Construct a json representation of a SnapshotCollection model snapshot_collection_model_json = {} @@ -43940,6 +44780,7 @@ def test_snapshot_patch_serialization(self): # Construct a json representation of a SnapshotPatch model snapshot_patch_model_json = {} snapshot_patch_model_json['name'] = 'my-snapshot' + snapshot_patch_model_json['user_tags'] = ['testString'] # Construct a model instance of SnapshotPatch by calling from_dict on the json representation snapshot_patch_model = SnapshotPatch.from_dict(snapshot_patch_model_json) @@ -44397,6 +45238,37 @@ def test_subnet_reference_deleted_serialization(self): subnet_reference_deleted_model_json2 = subnet_reference_deleted_model.to_dict() assert subnet_reference_deleted_model_json2 == subnet_reference_deleted_model_json +class TestModel_TrustedProfileReference(): + """ + Test Class for TrustedProfileReference + """ + + def test_trusted_profile_reference_serialization(self): + """ + Test serialization/deserialization for TrustedProfileReference + """ + + # Construct a json representation of a TrustedProfileReference model + trusted_profile_reference_model_json = {} + trusted_profile_reference_model_json['crn'] = 'crn:v1:bluemix:public:iam-identity::a/123456::profile:Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5' + trusted_profile_reference_model_json['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5' + trusted_profile_reference_model_json['resource_type'] = 'trusted_profile' + + # Construct a model instance of TrustedProfileReference by calling from_dict on the json representation + trusted_profile_reference_model = TrustedProfileReference.from_dict(trusted_profile_reference_model_json) + assert trusted_profile_reference_model != False + + # Construct a model instance of TrustedProfileReference by calling from_dict on the json representation + trusted_profile_reference_model_dict = TrustedProfileReference.from_dict(trusted_profile_reference_model_json).__dict__ + trusted_profile_reference_model2 = TrustedProfileReference(**trusted_profile_reference_model_dict) + + # Verify the model instances are equivalent + assert trusted_profile_reference_model == trusted_profile_reference_model2 + + # Convert model instance back to dict and verify no loss of data + trusted_profile_reference_model_json2 = trusted_profile_reference_model.to_dict() + assert trusted_profile_reference_model_json2 == trusted_profile_reference_model_json + class TestModel_VCPU(): """ Test Class for VCPU @@ -45356,6 +46228,35 @@ def test_vpn_gateway_patch_serialization(self): vpn_gateway_patch_model_json2 = vpn_gateway_patch_model.to_dict() assert vpn_gateway_patch_model_json2 == vpn_gateway_patch_model_json +class TestModel_VPNGatewayReferenceDeleted(): + """ + Test Class for VPNGatewayReferenceDeleted + """ + + def test_vpn_gateway_reference_deleted_serialization(self): + """ + Test serialization/deserialization for VPNGatewayReferenceDeleted + """ + + # Construct a json representation of a VPNGatewayReferenceDeleted model + vpn_gateway_reference_deleted_model_json = {} + vpn_gateway_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + # Construct a model instance of VPNGatewayReferenceDeleted by calling from_dict on the json representation + vpn_gateway_reference_deleted_model = VPNGatewayReferenceDeleted.from_dict(vpn_gateway_reference_deleted_model_json) + assert vpn_gateway_reference_deleted_model != False + + # Construct a model instance of VPNGatewayReferenceDeleted by calling from_dict on the json representation + vpn_gateway_reference_deleted_model_dict = VPNGatewayReferenceDeleted.from_dict(vpn_gateway_reference_deleted_model_json).__dict__ + vpn_gateway_reference_deleted_model2 = VPNGatewayReferenceDeleted(**vpn_gateway_reference_deleted_model_dict) + + # Verify the model instances are equivalent + assert vpn_gateway_reference_deleted_model == vpn_gateway_reference_deleted_model2 + + # Convert model instance back to dict and verify no loss of data + vpn_gateway_reference_deleted_model_json2 = vpn_gateway_reference_deleted_model.to_dict() + assert vpn_gateway_reference_deleted_model_json2 == vpn_gateway_reference_deleted_model_json + class TestModel_Volume(): """ Test Class for Volume @@ -45461,6 +46362,7 @@ def test_volume_serialization(self): volume_model_json['source_snapshot'] = snapshot_reference_model volume_model_json['status'] = 'available' volume_model_json['status_reasons'] = [volume_status_reason_model] + volume_model_json['user_tags'] = ['testString'] volume_model_json['volume_attachments'] = [volume_attachment_reference_volume_context_model] volume_model_json['zone'] = zone_reference_model @@ -45666,7 +46568,7 @@ def test_volume_attachment_prototype_instance_by_image_context_serialization(sel volume_profile_identity_model['name'] = 'general-purpose' volume_prototype_instance_by_image_context_model = {} # VolumePrototypeInstanceByImageContext - volume_prototype_instance_by_image_context_model['capacity'] = 38 + volume_prototype_instance_by_image_context_model['capacity'] = 250 volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model volume_prototype_instance_by_image_context_model['iops'] = 10000 volume_prototype_instance_by_image_context_model['name'] = 'my-volume' @@ -45693,14 +46595,14 @@ def test_volume_attachment_prototype_instance_by_image_context_serialization(sel volume_attachment_prototype_instance_by_image_context_model_json2 = volume_attachment_prototype_instance_by_image_context_model.to_dict() assert volume_attachment_prototype_instance_by_image_context_model_json2 == volume_attachment_prototype_instance_by_image_context_model_json -class TestModel_VolumeAttachmentPrototypeInstanceByVolumeContext(): +class TestModel_VolumeAttachmentPrototypeInstanceBySourceSnapshotContext(): """ - Test Class for VolumeAttachmentPrototypeInstanceByVolumeContext + Test Class for VolumeAttachmentPrototypeInstanceBySourceSnapshotContext """ - def test_volume_attachment_prototype_instance_by_volume_context_serialization(self): + def test_volume_attachment_prototype_instance_by_source_snapshot_context_serialization(self): """ - Test serialization/deserialization for VolumeAttachmentPrototypeInstanceByVolumeContext + Test serialization/deserialization for VolumeAttachmentPrototypeInstanceBySourceSnapshotContext """ # Construct dict forms of any model objects needed in order to build this model. @@ -45714,34 +46616,34 @@ def test_volume_attachment_prototype_instance_by_volume_context_serialization(se snapshot_identity_model = {} # SnapshotIdentityById snapshot_identity_model['id'] = '349a61d8-7ab1-420f-a690-5fed76ef9d4f' - volume_attachment_volume_prototype_instance_by_volume_context_model = {} # VolumeAttachmentVolumePrototypeInstanceByVolumeContextVolumePrototypeInstanceByVolumeContext - volume_attachment_volume_prototype_instance_by_volume_context_model['capacity'] = 38 - volume_attachment_volume_prototype_instance_by_volume_context_model['encryption_key'] = encryption_key_identity_model - volume_attachment_volume_prototype_instance_by_volume_context_model['iops'] = 10000 - volume_attachment_volume_prototype_instance_by_volume_context_model['name'] = 'my-volume' - volume_attachment_volume_prototype_instance_by_volume_context_model['profile'] = volume_profile_identity_model - volume_attachment_volume_prototype_instance_by_volume_context_model['source_snapshot'] = snapshot_identity_model + volume_prototype_instance_by_source_snapshot_context_model = {} # VolumePrototypeInstanceBySourceSnapshotContext + volume_prototype_instance_by_source_snapshot_context_model['capacity'] = 100 + volume_prototype_instance_by_source_snapshot_context_model['encryption_key'] = encryption_key_identity_model + volume_prototype_instance_by_source_snapshot_context_model['iops'] = 10000 + volume_prototype_instance_by_source_snapshot_context_model['name'] = 'my-volume' + volume_prototype_instance_by_source_snapshot_context_model['profile'] = volume_profile_identity_model + volume_prototype_instance_by_source_snapshot_context_model['source_snapshot'] = snapshot_identity_model - # Construct a json representation of a VolumeAttachmentPrototypeInstanceByVolumeContext model - volume_attachment_prototype_instance_by_volume_context_model_json = {} - volume_attachment_prototype_instance_by_volume_context_model_json['delete_volume_on_instance_delete'] = False - volume_attachment_prototype_instance_by_volume_context_model_json['name'] = 'my-volume-attachment' - volume_attachment_prototype_instance_by_volume_context_model_json['volume'] = volume_attachment_volume_prototype_instance_by_volume_context_model + # Construct a json representation of a VolumeAttachmentPrototypeInstanceBySourceSnapshotContext model + volume_attachment_prototype_instance_by_source_snapshot_context_model_json = {} + volume_attachment_prototype_instance_by_source_snapshot_context_model_json['delete_volume_on_instance_delete'] = True + volume_attachment_prototype_instance_by_source_snapshot_context_model_json['name'] = 'my-volume-attachment' + volume_attachment_prototype_instance_by_source_snapshot_context_model_json['volume'] = volume_prototype_instance_by_source_snapshot_context_model - # Construct a model instance of VolumeAttachmentPrototypeInstanceByVolumeContext by calling from_dict on the json representation - volume_attachment_prototype_instance_by_volume_context_model = VolumeAttachmentPrototypeInstanceByVolumeContext.from_dict(volume_attachment_prototype_instance_by_volume_context_model_json) - assert volume_attachment_prototype_instance_by_volume_context_model != False + # Construct a model instance of VolumeAttachmentPrototypeInstanceBySourceSnapshotContext by calling from_dict on the json representation + volume_attachment_prototype_instance_by_source_snapshot_context_model = VolumeAttachmentPrototypeInstanceBySourceSnapshotContext.from_dict(volume_attachment_prototype_instance_by_source_snapshot_context_model_json) + assert volume_attachment_prototype_instance_by_source_snapshot_context_model != False - # Construct a model instance of VolumeAttachmentPrototypeInstanceByVolumeContext by calling from_dict on the json representation - volume_attachment_prototype_instance_by_volume_context_model_dict = VolumeAttachmentPrototypeInstanceByVolumeContext.from_dict(volume_attachment_prototype_instance_by_volume_context_model_json).__dict__ - volume_attachment_prototype_instance_by_volume_context_model2 = VolumeAttachmentPrototypeInstanceByVolumeContext(**volume_attachment_prototype_instance_by_volume_context_model_dict) + # Construct a model instance of VolumeAttachmentPrototypeInstanceBySourceSnapshotContext by calling from_dict on the json representation + volume_attachment_prototype_instance_by_source_snapshot_context_model_dict = VolumeAttachmentPrototypeInstanceBySourceSnapshotContext.from_dict(volume_attachment_prototype_instance_by_source_snapshot_context_model_json).__dict__ + volume_attachment_prototype_instance_by_source_snapshot_context_model2 = VolumeAttachmentPrototypeInstanceBySourceSnapshotContext(**volume_attachment_prototype_instance_by_source_snapshot_context_model_dict) # Verify the model instances are equivalent - assert volume_attachment_prototype_instance_by_volume_context_model == volume_attachment_prototype_instance_by_volume_context_model2 + assert volume_attachment_prototype_instance_by_source_snapshot_context_model == volume_attachment_prototype_instance_by_source_snapshot_context_model2 # Convert model instance back to dict and verify no loss of data - volume_attachment_prototype_instance_by_volume_context_model_json2 = volume_attachment_prototype_instance_by_volume_context_model.to_dict() - assert volume_attachment_prototype_instance_by_volume_context_model_json2 == volume_attachment_prototype_instance_by_volume_context_model_json + volume_attachment_prototype_instance_by_source_snapshot_context_model_json2 = volume_attachment_prototype_instance_by_source_snapshot_context_model.to_dict() + assert volume_attachment_prototype_instance_by_source_snapshot_context_model_json2 == volume_attachment_prototype_instance_by_source_snapshot_context_model_json class TestModel_VolumeAttachmentPrototypeInstanceContext(): """ @@ -46053,6 +46955,7 @@ def test_volume_collection_serialization(self): volume_model['source_snapshot'] = snapshot_reference_model volume_model['status'] = 'available' volume_model['status_reasons'] = [volume_status_reason_model] + volume_model['user_tags'] = ['testString'] volume_model['volume_attachments'] = [volume_attachment_reference_volume_context_model] volume_model['zone'] = zone_reference_model @@ -46157,6 +47060,7 @@ def test_volume_patch_serialization(self): volume_patch_model_json['iops'] = 10000 volume_patch_model_json['name'] = 'my-volume' volume_patch_model_json['profile'] = volume_profile_identity_model + volume_patch_model_json['user_tags'] = ['testString'] # Construct a model instance of VolumePatch by calling from_dict on the json representation volume_patch_model = VolumePatch.from_dict(volume_patch_model_json) @@ -46358,7 +47262,7 @@ def test_volume_prototype_instance_by_image_context_serialization(self): # Construct a json representation of a VolumePrototypeInstanceByImageContext model volume_prototype_instance_by_image_context_model_json = {} - volume_prototype_instance_by_image_context_model_json['capacity'] = 38 + volume_prototype_instance_by_image_context_model_json['capacity'] = 250 volume_prototype_instance_by_image_context_model_json['encryption_key'] = encryption_key_identity_model volume_prototype_instance_by_image_context_model_json['iops'] = 10000 volume_prototype_instance_by_image_context_model_json['name'] = 'my-volume' @@ -46379,6 +47283,51 @@ def test_volume_prototype_instance_by_image_context_serialization(self): volume_prototype_instance_by_image_context_model_json2 = volume_prototype_instance_by_image_context_model.to_dict() assert volume_prototype_instance_by_image_context_model_json2 == volume_prototype_instance_by_image_context_model_json +class TestModel_VolumePrototypeInstanceBySourceSnapshotContext(): + """ + Test Class for VolumePrototypeInstanceBySourceSnapshotContext + """ + + def test_volume_prototype_instance_by_source_snapshot_context_serialization(self): + """ + Test serialization/deserialization for VolumePrototypeInstanceBySourceSnapshotContext + """ + + # 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/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' + + volume_profile_identity_model = {} # VolumeProfileIdentityByName + volume_profile_identity_model['name'] = 'general-purpose' + + snapshot_identity_model = {} # SnapshotIdentityById + snapshot_identity_model['id'] = '349a61d8-7ab1-420f-a690-5fed76ef9d4f' + + # Construct a json representation of a VolumePrototypeInstanceBySourceSnapshotContext model + volume_prototype_instance_by_source_snapshot_context_model_json = {} + volume_prototype_instance_by_source_snapshot_context_model_json['capacity'] = 100 + volume_prototype_instance_by_source_snapshot_context_model_json['encryption_key'] = encryption_key_identity_model + volume_prototype_instance_by_source_snapshot_context_model_json['iops'] = 10000 + volume_prototype_instance_by_source_snapshot_context_model_json['name'] = 'my-volume' + volume_prototype_instance_by_source_snapshot_context_model_json['profile'] = volume_profile_identity_model + volume_prototype_instance_by_source_snapshot_context_model_json['source_snapshot'] = snapshot_identity_model + + # Construct a model instance of VolumePrototypeInstanceBySourceSnapshotContext by calling from_dict on the json representation + volume_prototype_instance_by_source_snapshot_context_model = VolumePrototypeInstanceBySourceSnapshotContext.from_dict(volume_prototype_instance_by_source_snapshot_context_model_json) + assert volume_prototype_instance_by_source_snapshot_context_model != False + + # Construct a model instance of VolumePrototypeInstanceBySourceSnapshotContext by calling from_dict on the json representation + volume_prototype_instance_by_source_snapshot_context_model_dict = VolumePrototypeInstanceBySourceSnapshotContext.from_dict(volume_prototype_instance_by_source_snapshot_context_model_json).__dict__ + volume_prototype_instance_by_source_snapshot_context_model2 = VolumePrototypeInstanceBySourceSnapshotContext(**volume_prototype_instance_by_source_snapshot_context_model_dict) + + # Verify the model instances are equivalent + assert volume_prototype_instance_by_source_snapshot_context_model == volume_prototype_instance_by_source_snapshot_context_model2 + + # Convert model instance back to dict and verify no loss of data + volume_prototype_instance_by_source_snapshot_context_model_json2 = volume_prototype_instance_by_source_snapshot_context_model.to_dict() + assert volume_prototype_instance_by_source_snapshot_context_model_json2 == volume_prototype_instance_by_source_snapshot_context_model_json + class TestModel_VolumeReference(): """ Test Class for VolumeReference @@ -46692,6 +47641,17 @@ def test_bare_metal_server_network_interface_by_pci_serialization(self): floating_ip_reference_model['id'] = '39300233-9995-4806-89a5-3c1b6eb88689' floating_ip_reference_model['name'] = 'my-floating-ip' + reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted + reserved_ip_reference_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['deleted'] = reserved_ip_reference_deleted_model + reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model['id'] = '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_deleted_model = {} # SecurityGroupReferenceDeleted security_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' @@ -46724,7 +47684,7 @@ def test_bare_metal_server_network_interface_by_pci_serialization(self): bare_metal_server_network_interface_by_pci_model_json['mac_address'] = '02:00:0a:00:23:94' bare_metal_server_network_interface_by_pci_model_json['name'] = 'my-network-interface' bare_metal_server_network_interface_by_pci_model_json['port_speed'] = 1000 - bare_metal_server_network_interface_by_pci_model_json['primary_ipv4_address'] = '192.168.3.4' + bare_metal_server_network_interface_by_pci_model_json['primary_ip'] = reserved_ip_reference_model bare_metal_server_network_interface_by_pci_model_json['resource_type'] = 'network_interface' bare_metal_server_network_interface_by_pci_model_json['security_groups'] = [security_group_reference_model] bare_metal_server_network_interface_by_pci_model_json['status'] = 'available' @@ -46770,6 +47730,17 @@ def test_bare_metal_server_network_interface_by_vlan_serialization(self): floating_ip_reference_model['id'] = '39300233-9995-4806-89a5-3c1b6eb88689' floating_ip_reference_model['name'] = 'my-floating-ip' + reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted + reserved_ip_reference_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['deleted'] = reserved_ip_reference_deleted_model + reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model['id'] = '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_deleted_model = {} # SecurityGroupReferenceDeleted security_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' @@ -46802,7 +47773,7 @@ def test_bare_metal_server_network_interface_by_vlan_serialization(self): bare_metal_server_network_interface_by_vlan_model_json['mac_address'] = '02:00:0a:00:23:94' bare_metal_server_network_interface_by_vlan_model_json['name'] = 'my-network-interface' bare_metal_server_network_interface_by_vlan_model_json['port_speed'] = 1000 - bare_metal_server_network_interface_by_vlan_model_json['primary_ipv4_address'] = '192.168.3.4' + bare_metal_server_network_interface_by_vlan_model_json['primary_ip'] = reserved_ip_reference_model bare_metal_server_network_interface_by_vlan_model_json['resource_type'] = 'network_interface' bare_metal_server_network_interface_by_vlan_model_json['security_groups'] = [security_group_reference_model] bare_metal_server_network_interface_by_vlan_model_json['status'] = 'available' @@ -46838,6 +47809,11 @@ def test_bare_metal_server_network_interface_prototype_bare_metal_server_network # 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' + security_group_identity_model = {} # SecurityGroupIdentityById security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' @@ -46850,7 +47826,7 @@ def test_bare_metal_server_network_interface_prototype_bare_metal_server_network bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_pci_prototype_model_json['enable_infrastructure_nat'] = True bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_pci_prototype_model_json['interface_type'] = 'pci' bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_pci_prototype_model_json['name'] = 'my-network-interface' - bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_pci_prototype_model_json['primary_ipv4_address'] = '10.0.0.5' + bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_pci_prototype_model_json['primary_ip'] = network_interface_ip_prototype_model bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_pci_prototype_model_json['security_groups'] = [security_group_identity_model] bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_pci_prototype_model_json['subnet'] = subnet_identity_model bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_pci_prototype_model_json['allowed_vlans'] = [4] @@ -46882,6 +47858,11 @@ def test_bare_metal_server_network_interface_prototype_bare_metal_server_network # 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' + security_group_identity_model = {} # SecurityGroupIdentityById security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' @@ -46894,7 +47875,7 @@ def test_bare_metal_server_network_interface_prototype_bare_metal_server_network bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_vlan_prototype_model_json['enable_infrastructure_nat'] = True bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_vlan_prototype_model_json['interface_type'] = 'vlan' bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_vlan_prototype_model_json['name'] = 'my-network-interface' - bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_vlan_prototype_model_json['primary_ipv4_address'] = '10.0.0.5' + bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_vlan_prototype_model_json['primary_ip'] = network_interface_ip_prototype_model bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_vlan_prototype_model_json['security_groups'] = [security_group_identity_model] bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_vlan_prototype_model_json['subnet'] = subnet_identity_model bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_vlan_prototype_model_json['allow_interface_to_float'] = False @@ -47723,7 +48704,7 @@ def test_certificate_instance_identity_by_crn_serialization(self): # Construct a json representation of a CertificateInstanceIdentityByCRN model certificate_instance_identity_by_crn_model_json = {} - certificate_instance_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758' + certificate_instance_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5' # Construct a model instance of CertificateInstanceIdentityByCRN by calling from_dict on the json representation certificate_instance_identity_by_crn_model = CertificateInstanceIdentityByCRN.from_dict(certificate_instance_identity_by_crn_model_json) @@ -47740,35 +48721,6 @@ def test_certificate_instance_identity_by_crn_serialization(self): certificate_instance_identity_by_crn_model_json2 = certificate_instance_identity_by_crn_model.to_dict() assert certificate_instance_identity_by_crn_model_json2 == certificate_instance_identity_by_crn_model_json -class TestModel_CloudObjectStorageBucketIdentityByName(): - """ - Test Class for CloudObjectStorageBucketIdentityByName - """ - - def test_cloud_object_storage_bucket_identity_by_name_serialization(self): - """ - Test serialization/deserialization for CloudObjectStorageBucketIdentityByName - """ - - # Construct a json representation of a CloudObjectStorageBucketIdentityByName model - cloud_object_storage_bucket_identity_by_name_model_json = {} - cloud_object_storage_bucket_identity_by_name_model_json['name'] = 'bucket-27200-lwx4cfvcue' - - # Construct a model instance of CloudObjectStorageBucketIdentityByName by calling from_dict on the json representation - cloud_object_storage_bucket_identity_by_name_model = CloudObjectStorageBucketIdentityByName.from_dict(cloud_object_storage_bucket_identity_by_name_model_json) - assert cloud_object_storage_bucket_identity_by_name_model != False - - # Construct a model instance of CloudObjectStorageBucketIdentityByName by calling from_dict on the json representation - cloud_object_storage_bucket_identity_by_name_model_dict = CloudObjectStorageBucketIdentityByName.from_dict(cloud_object_storage_bucket_identity_by_name_model_json).__dict__ - cloud_object_storage_bucket_identity_by_name_model2 = CloudObjectStorageBucketIdentityByName(**cloud_object_storage_bucket_identity_by_name_model_dict) - - # Verify the model instances are equivalent - assert cloud_object_storage_bucket_identity_by_name_model == cloud_object_storage_bucket_identity_by_name_model2 - - # Convert model instance back to dict and verify no loss of data - cloud_object_storage_bucket_identity_by_name_model_json2 = cloud_object_storage_bucket_identity_by_name_model.to_dict() - assert cloud_object_storage_bucket_identity_by_name_model_json2 == cloud_object_storage_bucket_identity_by_name_model_json - class TestModel_DedicatedHostGroupIdentityByCRN(): """ Test Class for DedicatedHostGroupIdentityByCRN @@ -48422,6 +49374,7 @@ def test_endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_seria # Construct a json representation of a EndpointGatewayReservedIPReservedIPPrototypeTargetContext model endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model_json = {} + endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model_json['address'] = '192.168.3.4' endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model_json['auto_delete'] = False endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model_json['name'] = 'my-reserved-ip' endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model_json['subnet'] = subnet_identity_model @@ -48710,13 +49663,24 @@ def test_floating_ip_target_network_interface_reference_serialization(self): network_interface_reference_deleted_model = {} # NetworkInterfaceReferenceDeleted network_interface_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted + reserved_ip_reference_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['deleted'] = reserved_ip_reference_deleted_model + reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model['id'] = '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 FloatingIPTargetNetworkInterfaceReference model floating_ip_target_network_interface_reference_model_json = {} floating_ip_target_network_interface_reference_model_json['deleted'] = network_interface_reference_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/10c02d81-0ecb-4dc5-897d-28392913b81e' floating_ip_target_network_interface_reference_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' floating_ip_target_network_interface_reference_model_json['name'] = 'my-network-interface' - floating_ip_target_network_interface_reference_model_json['primary_ipv4_address'] = '192.168.3.4' + 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' # Construct a model instance of FloatingIPTargetNetworkInterfaceReference by calling from_dict on the json representation @@ -49387,7 +50351,7 @@ def test_instance_patch_profile_instance_profile_identity_by_href_serialization( # Construct a json representation of a InstancePatchProfileInstanceProfileIdentityByHref model instance_patch_profile_instance_profile_identity_by_href_model_json = {} - instance_patch_profile_instance_profile_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16' + instance_patch_profile_instance_profile_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16' # Construct a model instance of InstancePatchProfileInstanceProfileIdentityByHref by calling from_dict on the json representation instance_patch_profile_instance_profile_identity_by_href_model = InstancePatchProfileInstanceProfileIdentityByHref.from_dict(instance_patch_profile_instance_profile_identity_by_href_model_json) @@ -49416,7 +50380,7 @@ def test_instance_patch_profile_instance_profile_identity_by_name_serialization( # Construct a json representation of a InstancePatchProfileInstanceProfileIdentityByName model instance_patch_profile_instance_profile_identity_by_name_model_json = {} - instance_patch_profile_instance_profile_identity_by_name_model_json['name'] = 'bc1-4x16' + instance_patch_profile_instance_profile_identity_by_name_model_json['name'] = 'bx2-4x16' # Construct a model instance of InstancePatchProfileInstanceProfileIdentityByName by calling from_dict on the json representation instance_patch_profile_instance_profile_identity_by_name_model = InstancePatchProfileInstanceProfileIdentityByName.from_dict(instance_patch_profile_instance_profile_identity_by_name_model_json) @@ -50177,7 +51141,7 @@ def test_instance_profile_identity_by_href_serialization(self): # Construct a json representation of a InstanceProfileIdentityByHref model instance_profile_identity_by_href_model_json = {} - instance_profile_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16' + instance_profile_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16' # Construct a model instance of InstanceProfileIdentityByHref by calling from_dict on the json representation instance_profile_identity_by_href_model = InstanceProfileIdentityByHref.from_dict(instance_profile_identity_by_href_model_json) @@ -50206,7 +51170,7 @@ def test_instance_profile_identity_by_name_serialization(self): # Construct a json representation of a InstanceProfileIdentityByName model instance_profile_identity_by_name_model_json = {} - instance_profile_identity_by_name_model_json['name'] = 'bc1-4x16' + instance_profile_identity_by_name_model_json['name'] = 'bx2-4x16' # Construct a model instance of InstanceProfileIdentityByName by calling from_dict on the json representation instance_profile_identity_by_name_model = InstanceProfileIdentityByName.from_dict(instance_profile_identity_by_name_model_json) @@ -50663,9 +51627,27 @@ def test_instance_prototype_instance_by_image_serialization(self): # Construct dict forms of any model objects needed in order to build this model. + instance_availability_prototype_model = {} # InstanceAvailabilityPrototype + instance_availability_prototype_model['host_failure'] = 'restart' + + trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById + trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5' + + instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype + instance_default_trusted_profile_prototype_model['auto_link'] = False + instance_default_trusted_profile_prototype_model['target'] = trusted_profile_identity_model + key_identity_model = {} # KeyIdentityById key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' + instance_metadata_service_prototype_model = {} # InstanceMetadataServicePrototype + instance_metadata_service_prototype_model['enabled'] = True + + 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' + security_group_identity_model = {} # SecurityGroupIdentityById security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' @@ -50675,7 +51657,7 @@ def test_instance_prototype_instance_by_image_serialization(self): network_interface_prototype_model = {} # NetworkInterfacePrototype network_interface_prototype_model['allow_ip_spoofing'] = True network_interface_prototype_model['name'] = 'my-network-interface' - network_interface_prototype_model['primary_ipv4_address'] = '10.0.0.5' + network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model network_interface_prototype_model['security_groups'] = [security_group_identity_model] network_interface_prototype_model['subnet'] = subnet_identity_model @@ -50683,7 +51665,7 @@ def test_instance_prototype_instance_by_image_serialization(self): instance_placement_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' instance_profile_identity_model = {} # InstanceProfileIdentityByName - instance_profile_identity_model['name'] = 'cc1-16x32' + instance_profile_identity_model['name'] = 'cx2-16x32' resource_group_identity_model = {} # ResourceGroupIdentityById resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' @@ -50706,7 +51688,7 @@ def test_instance_prototype_instance_by_image_serialization(self): volume_profile_identity_model['name'] = 'general-purpose' volume_prototype_instance_by_image_context_model = {} # VolumePrototypeInstanceByImageContext - volume_prototype_instance_by_image_context_model['capacity'] = 38 + volume_prototype_instance_by_image_context_model['capacity'] = 250 volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model volume_prototype_instance_by_image_context_model['iops'] = 10000 volume_prototype_instance_by_image_context_model['name'] = 'my-volume' @@ -50725,7 +51707,10 @@ def test_instance_prototype_instance_by_image_serialization(self): # Construct a json representation of a InstancePrototypeInstanceByImage model instance_prototype_instance_by_image_model_json = {} + instance_prototype_instance_by_image_model_json['availability_policy'] = instance_availability_prototype_model + instance_prototype_instance_by_image_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model instance_prototype_instance_by_image_model_json['keys'] = [key_identity_model] + instance_prototype_instance_by_image_model_json['metadata_service'] = instance_metadata_service_prototype_model instance_prototype_instance_by_image_model_json['name'] = 'my-instance' instance_prototype_instance_by_image_model_json['network_interfaces'] = [network_interface_prototype_model] instance_prototype_instance_by_image_model_json['placement_target'] = instance_placement_target_prototype_model @@ -50755,21 +51740,39 @@ def test_instance_prototype_instance_by_image_serialization(self): instance_prototype_instance_by_image_model_json2 = instance_prototype_instance_by_image_model.to_dict() assert instance_prototype_instance_by_image_model_json2 == instance_prototype_instance_by_image_model_json -class TestModel_InstancePrototypeInstanceBySourceTemplate(): +class TestModel_InstancePrototypeInstanceBySourceSnapshot(): """ - Test Class for InstancePrototypeInstanceBySourceTemplate + Test Class for InstancePrototypeInstanceBySourceSnapshot """ - def test_instance_prototype_instance_by_source_template_serialization(self): + def test_instance_prototype_instance_by_source_snapshot_serialization(self): """ - Test serialization/deserialization for InstancePrototypeInstanceBySourceTemplate + Test serialization/deserialization for InstancePrototypeInstanceBySourceSnapshot """ # Construct dict forms of any model objects needed in order to build this model. + instance_availability_prototype_model = {} # InstanceAvailabilityPrototype + instance_availability_prototype_model['host_failure'] = 'restart' + + trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById + trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5' + + instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype + instance_default_trusted_profile_prototype_model['auto_link'] = False + instance_default_trusted_profile_prototype_model['target'] = trusted_profile_identity_model + key_identity_model = {} # KeyIdentityById key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' + instance_metadata_service_prototype_model = {} # InstanceMetadataServicePrototype + instance_metadata_service_prototype_model['enabled'] = True + + 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' + security_group_identity_model = {} # SecurityGroupIdentityById security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' @@ -50779,7 +51782,7 @@ def test_instance_prototype_instance_by_source_template_serialization(self): network_interface_prototype_model = {} # NetworkInterfacePrototype network_interface_prototype_model['allow_ip_spoofing'] = True network_interface_prototype_model['name'] = 'my-network-interface' - network_interface_prototype_model['primary_ipv4_address'] = '10.0.0.5' + network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model network_interface_prototype_model['security_groups'] = [security_group_identity_model] network_interface_prototype_model['subnet'] = subnet_identity_model @@ -50787,7 +51790,7 @@ def test_instance_prototype_instance_by_source_template_serialization(self): instance_placement_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' instance_profile_identity_model = {} # InstanceProfileIdentityByName - instance_profile_identity_model['name'] = 'cc1-16x32' + instance_profile_identity_model['name'] = 'cx2-16x32' resource_group_identity_model = {} # ResourceGroupIdentityById resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' @@ -50809,75 +51812,92 @@ def test_instance_prototype_instance_by_source_template_serialization(self): volume_profile_identity_model = {} # VolumeProfileIdentityByName volume_profile_identity_model['name'] = 'general-purpose' - volume_prototype_instance_by_image_context_model = {} # VolumePrototypeInstanceByImageContext - volume_prototype_instance_by_image_context_model['capacity'] = 38 - volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model - volume_prototype_instance_by_image_context_model['iops'] = 10000 - volume_prototype_instance_by_image_context_model['name'] = 'my-volume' - volume_prototype_instance_by_image_context_model['profile'] = volume_profile_identity_model - - volume_attachment_prototype_instance_by_image_context_model = {} # VolumeAttachmentPrototypeInstanceByImageContext - volume_attachment_prototype_instance_by_image_context_model['delete_volume_on_instance_delete'] = True - volume_attachment_prototype_instance_by_image_context_model['name'] = 'my-volume-attachment' - volume_attachment_prototype_instance_by_image_context_model['volume'] = volume_prototype_instance_by_image_context_model + snapshot_identity_model = {} # SnapshotIdentityById + snapshot_identity_model['id'] = '349a61d8-7ab1-420f-a690-5fed76ef9d4f' - image_identity_model = {} # ImageIdentityById - image_identity_model['id'] = '72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' + volume_prototype_instance_by_source_snapshot_context_model = {} # VolumePrototypeInstanceBySourceSnapshotContext + volume_prototype_instance_by_source_snapshot_context_model['capacity'] = 100 + volume_prototype_instance_by_source_snapshot_context_model['encryption_key'] = encryption_key_identity_model + volume_prototype_instance_by_source_snapshot_context_model['iops'] = 10000 + volume_prototype_instance_by_source_snapshot_context_model['name'] = 'my-volume' + volume_prototype_instance_by_source_snapshot_context_model['profile'] = volume_profile_identity_model + volume_prototype_instance_by_source_snapshot_context_model['source_snapshot'] = snapshot_identity_model - instance_template_identity_model = {} # InstanceTemplateIdentityById - instance_template_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' + volume_attachment_prototype_instance_by_source_snapshot_context_model = {} # VolumeAttachmentPrototypeInstanceBySourceSnapshotContext + volume_attachment_prototype_instance_by_source_snapshot_context_model['delete_volume_on_instance_delete'] = True + volume_attachment_prototype_instance_by_source_snapshot_context_model['name'] = 'my-volume-attachment' + volume_attachment_prototype_instance_by_source_snapshot_context_model['volume'] = volume_prototype_instance_by_source_snapshot_context_model zone_identity_model = {} # ZoneIdentityByName zone_identity_model['name'] = 'us-south-1' - # Construct a json representation of a InstancePrototypeInstanceBySourceTemplate model - instance_prototype_instance_by_source_template_model_json = {} - instance_prototype_instance_by_source_template_model_json['keys'] = [key_identity_model] - instance_prototype_instance_by_source_template_model_json['name'] = 'my-instance' - instance_prototype_instance_by_source_template_model_json['network_interfaces'] = [network_interface_prototype_model] - instance_prototype_instance_by_source_template_model_json['placement_target'] = instance_placement_target_prototype_model - instance_prototype_instance_by_source_template_model_json['profile'] = instance_profile_identity_model - instance_prototype_instance_by_source_template_model_json['resource_group'] = resource_group_identity_model - instance_prototype_instance_by_source_template_model_json['total_volume_bandwidth'] = 500 - instance_prototype_instance_by_source_template_model_json['user_data'] = 'testString' - instance_prototype_instance_by_source_template_model_json['volume_attachments'] = [volume_attachment_prototype_instance_context_model] - instance_prototype_instance_by_source_template_model_json['vpc'] = vpc_identity_model - instance_prototype_instance_by_source_template_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model - instance_prototype_instance_by_source_template_model_json['image'] = image_identity_model - instance_prototype_instance_by_source_template_model_json['primary_network_interface'] = network_interface_prototype_model - instance_prototype_instance_by_source_template_model_json['source_template'] = instance_template_identity_model - instance_prototype_instance_by_source_template_model_json['zone'] = zone_identity_model + # Construct a json representation of a InstancePrototypeInstanceBySourceSnapshot model + instance_prototype_instance_by_source_snapshot_model_json = {} + instance_prototype_instance_by_source_snapshot_model_json['availability_policy'] = instance_availability_prototype_model + instance_prototype_instance_by_source_snapshot_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model + instance_prototype_instance_by_source_snapshot_model_json['keys'] = [key_identity_model] + instance_prototype_instance_by_source_snapshot_model_json['metadata_service'] = instance_metadata_service_prototype_model + instance_prototype_instance_by_source_snapshot_model_json['name'] = 'my-instance' + instance_prototype_instance_by_source_snapshot_model_json['network_interfaces'] = [network_interface_prototype_model] + instance_prototype_instance_by_source_snapshot_model_json['placement_target'] = instance_placement_target_prototype_model + instance_prototype_instance_by_source_snapshot_model_json['profile'] = instance_profile_identity_model + instance_prototype_instance_by_source_snapshot_model_json['resource_group'] = resource_group_identity_model + instance_prototype_instance_by_source_snapshot_model_json['total_volume_bandwidth'] = 500 + instance_prototype_instance_by_source_snapshot_model_json['user_data'] = 'testString' + instance_prototype_instance_by_source_snapshot_model_json['volume_attachments'] = [volume_attachment_prototype_instance_context_model] + instance_prototype_instance_by_source_snapshot_model_json['vpc'] = vpc_identity_model + instance_prototype_instance_by_source_snapshot_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_source_snapshot_context_model + instance_prototype_instance_by_source_snapshot_model_json['primary_network_interface'] = network_interface_prototype_model + instance_prototype_instance_by_source_snapshot_model_json['zone'] = zone_identity_model - # Construct a model instance of InstancePrototypeInstanceBySourceTemplate by calling from_dict on the json representation - instance_prototype_instance_by_source_template_model = InstancePrototypeInstanceBySourceTemplate.from_dict(instance_prototype_instance_by_source_template_model_json) - assert instance_prototype_instance_by_source_template_model != False + # Construct a model instance of InstancePrototypeInstanceBySourceSnapshot by calling from_dict on the json representation + instance_prototype_instance_by_source_snapshot_model = InstancePrototypeInstanceBySourceSnapshot.from_dict(instance_prototype_instance_by_source_snapshot_model_json) + assert instance_prototype_instance_by_source_snapshot_model != False - # Construct a model instance of InstancePrototypeInstanceBySourceTemplate by calling from_dict on the json representation - instance_prototype_instance_by_source_template_model_dict = InstancePrototypeInstanceBySourceTemplate.from_dict(instance_prototype_instance_by_source_template_model_json).__dict__ - instance_prototype_instance_by_source_template_model2 = InstancePrototypeInstanceBySourceTemplate(**instance_prototype_instance_by_source_template_model_dict) + # Construct a model instance of InstancePrototypeInstanceBySourceSnapshot by calling from_dict on the json representation + instance_prototype_instance_by_source_snapshot_model_dict = InstancePrototypeInstanceBySourceSnapshot.from_dict(instance_prototype_instance_by_source_snapshot_model_json).__dict__ + instance_prototype_instance_by_source_snapshot_model2 = InstancePrototypeInstanceBySourceSnapshot(**instance_prototype_instance_by_source_snapshot_model_dict) # Verify the model instances are equivalent - assert instance_prototype_instance_by_source_template_model == instance_prototype_instance_by_source_template_model2 + assert instance_prototype_instance_by_source_snapshot_model == instance_prototype_instance_by_source_snapshot_model2 # Convert model instance back to dict and verify no loss of data - instance_prototype_instance_by_source_template_model_json2 = instance_prototype_instance_by_source_template_model.to_dict() - assert instance_prototype_instance_by_source_template_model_json2 == instance_prototype_instance_by_source_template_model_json + instance_prototype_instance_by_source_snapshot_model_json2 = instance_prototype_instance_by_source_snapshot_model.to_dict() + assert instance_prototype_instance_by_source_snapshot_model_json2 == instance_prototype_instance_by_source_snapshot_model_json -class TestModel_InstancePrototypeInstanceByVolume(): +class TestModel_InstancePrototypeInstanceBySourceTemplate(): """ - Test Class for InstancePrototypeInstanceByVolume + Test Class for InstancePrototypeInstanceBySourceTemplate """ - def test_instance_prototype_instance_by_volume_serialization(self): + def test_instance_prototype_instance_by_source_template_serialization(self): """ - Test serialization/deserialization for InstancePrototypeInstanceByVolume + Test serialization/deserialization for InstancePrototypeInstanceBySourceTemplate """ # Construct dict forms of any model objects needed in order to build this model. + instance_availability_prototype_model = {} # InstanceAvailabilityPrototype + instance_availability_prototype_model['host_failure'] = 'restart' + + trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById + trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5' + + instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype + instance_default_trusted_profile_prototype_model['auto_link'] = False + instance_default_trusted_profile_prototype_model['target'] = trusted_profile_identity_model + key_identity_model = {} # KeyIdentityById key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' + instance_metadata_service_prototype_model = {} # InstanceMetadataServicePrototype + instance_metadata_service_prototype_model['enabled'] = True + + 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' + security_group_identity_model = {} # SecurityGroupIdentityById security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' @@ -50887,7 +51907,7 @@ def test_instance_prototype_instance_by_volume_serialization(self): network_interface_prototype_model = {} # NetworkInterfacePrototype network_interface_prototype_model['allow_ip_spoofing'] = True network_interface_prototype_model['name'] = 'my-network-interface' - network_interface_prototype_model['primary_ipv4_address'] = '10.0.0.5' + network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model network_interface_prototype_model['security_groups'] = [security_group_identity_model] network_interface_prototype_model['subnet'] = subnet_identity_model @@ -50895,7 +51915,7 @@ def test_instance_prototype_instance_by_volume_serialization(self): instance_placement_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' instance_profile_identity_model = {} # InstanceProfileIdentityByName - instance_profile_identity_model['name'] = 'cc1-16x32' + instance_profile_identity_model['name'] = 'cx2-16x32' resource_group_identity_model = {} # ResourceGroupIdentityById resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' @@ -50917,55 +51937,62 @@ def test_instance_prototype_instance_by_volume_serialization(self): volume_profile_identity_model = {} # VolumeProfileIdentityByName volume_profile_identity_model['name'] = 'general-purpose' - snapshot_identity_model = {} # SnapshotIdentityById - snapshot_identity_model['id'] = '349a61d8-7ab1-420f-a690-5fed76ef9d4f' + volume_prototype_instance_by_image_context_model = {} # VolumePrototypeInstanceByImageContext + volume_prototype_instance_by_image_context_model['capacity'] = 250 + volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model + volume_prototype_instance_by_image_context_model['iops'] = 10000 + volume_prototype_instance_by_image_context_model['name'] = 'my-volume' + volume_prototype_instance_by_image_context_model['profile'] = volume_profile_identity_model - volume_attachment_volume_prototype_instance_by_volume_context_model = {} # VolumeAttachmentVolumePrototypeInstanceByVolumeContextVolumePrototypeInstanceByVolumeContext - volume_attachment_volume_prototype_instance_by_volume_context_model['capacity'] = 38 - volume_attachment_volume_prototype_instance_by_volume_context_model['encryption_key'] = encryption_key_identity_model - volume_attachment_volume_prototype_instance_by_volume_context_model['iops'] = 10000 - volume_attachment_volume_prototype_instance_by_volume_context_model['name'] = 'my-volume' - volume_attachment_volume_prototype_instance_by_volume_context_model['profile'] = volume_profile_identity_model - volume_attachment_volume_prototype_instance_by_volume_context_model['source_snapshot'] = snapshot_identity_model + volume_attachment_prototype_instance_by_image_context_model = {} # VolumeAttachmentPrototypeInstanceByImageContext + volume_attachment_prototype_instance_by_image_context_model['delete_volume_on_instance_delete'] = True + volume_attachment_prototype_instance_by_image_context_model['name'] = 'my-volume-attachment' + volume_attachment_prototype_instance_by_image_context_model['volume'] = volume_prototype_instance_by_image_context_model - volume_attachment_prototype_instance_by_volume_context_model = {} # VolumeAttachmentPrototypeInstanceByVolumeContext - volume_attachment_prototype_instance_by_volume_context_model['delete_volume_on_instance_delete'] = False - volume_attachment_prototype_instance_by_volume_context_model['name'] = 'my-volume-attachment' - volume_attachment_prototype_instance_by_volume_context_model['volume'] = volume_attachment_volume_prototype_instance_by_volume_context_model + image_identity_model = {} # ImageIdentityById + image_identity_model['id'] = '72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' + + instance_template_identity_model = {} # InstanceTemplateIdentityById + instance_template_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' zone_identity_model = {} # ZoneIdentityByName zone_identity_model['name'] = 'us-south-1' - # Construct a json representation of a InstancePrototypeInstanceByVolume model - instance_prototype_instance_by_volume_model_json = {} - instance_prototype_instance_by_volume_model_json['keys'] = [key_identity_model] - instance_prototype_instance_by_volume_model_json['name'] = 'my-instance' - instance_prototype_instance_by_volume_model_json['network_interfaces'] = [network_interface_prototype_model] - instance_prototype_instance_by_volume_model_json['placement_target'] = instance_placement_target_prototype_model - instance_prototype_instance_by_volume_model_json['profile'] = instance_profile_identity_model - instance_prototype_instance_by_volume_model_json['resource_group'] = resource_group_identity_model - instance_prototype_instance_by_volume_model_json['total_volume_bandwidth'] = 500 - instance_prototype_instance_by_volume_model_json['user_data'] = 'testString' - instance_prototype_instance_by_volume_model_json['volume_attachments'] = [volume_attachment_prototype_instance_context_model] - instance_prototype_instance_by_volume_model_json['vpc'] = vpc_identity_model - instance_prototype_instance_by_volume_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_volume_context_model - instance_prototype_instance_by_volume_model_json['primary_network_interface'] = network_interface_prototype_model - instance_prototype_instance_by_volume_model_json['zone'] = zone_identity_model + # 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_prototype_model + 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['keys'] = [key_identity_model] + instance_prototype_instance_by_source_template_model_json['metadata_service'] = instance_metadata_service_prototype_model + instance_prototype_instance_by_source_template_model_json['name'] = 'my-instance' + instance_prototype_instance_by_source_template_model_json['network_interfaces'] = [network_interface_prototype_model] + instance_prototype_instance_by_source_template_model_json['placement_target'] = instance_placement_target_prototype_model + instance_prototype_instance_by_source_template_model_json['profile'] = instance_profile_identity_model + instance_prototype_instance_by_source_template_model_json['resource_group'] = resource_group_identity_model + instance_prototype_instance_by_source_template_model_json['total_volume_bandwidth'] = 500 + instance_prototype_instance_by_source_template_model_json['user_data'] = 'testString' + instance_prototype_instance_by_source_template_model_json['volume_attachments'] = [volume_attachment_prototype_instance_context_model] + instance_prototype_instance_by_source_template_model_json['vpc'] = vpc_identity_model + instance_prototype_instance_by_source_template_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model + instance_prototype_instance_by_source_template_model_json['image'] = image_identity_model + instance_prototype_instance_by_source_template_model_json['primary_network_interface'] = network_interface_prototype_model + instance_prototype_instance_by_source_template_model_json['source_template'] = instance_template_identity_model + instance_prototype_instance_by_source_template_model_json['zone'] = zone_identity_model - # Construct a model instance of InstancePrototypeInstanceByVolume by calling from_dict on the json representation - instance_prototype_instance_by_volume_model = InstancePrototypeInstanceByVolume.from_dict(instance_prototype_instance_by_volume_model_json) - assert instance_prototype_instance_by_volume_model != False + # Construct a model instance of InstancePrototypeInstanceBySourceTemplate by calling from_dict on the json representation + instance_prototype_instance_by_source_template_model = InstancePrototypeInstanceBySourceTemplate.from_dict(instance_prototype_instance_by_source_template_model_json) + assert instance_prototype_instance_by_source_template_model != False - # Construct a model instance of InstancePrototypeInstanceByVolume by calling from_dict on the json representation - instance_prototype_instance_by_volume_model_dict = InstancePrototypeInstanceByVolume.from_dict(instance_prototype_instance_by_volume_model_json).__dict__ - instance_prototype_instance_by_volume_model2 = InstancePrototypeInstanceByVolume(**instance_prototype_instance_by_volume_model_dict) + # Construct a model instance of InstancePrototypeInstanceBySourceTemplate by calling from_dict on the json representation + instance_prototype_instance_by_source_template_model_dict = InstancePrototypeInstanceBySourceTemplate.from_dict(instance_prototype_instance_by_source_template_model_json).__dict__ + instance_prototype_instance_by_source_template_model2 = InstancePrototypeInstanceBySourceTemplate(**instance_prototype_instance_by_source_template_model_dict) # Verify the model instances are equivalent - assert instance_prototype_instance_by_volume_model == instance_prototype_instance_by_volume_model2 + assert instance_prototype_instance_by_source_template_model == instance_prototype_instance_by_source_template_model2 # Convert model instance back to dict and verify no loss of data - instance_prototype_instance_by_volume_model_json2 = instance_prototype_instance_by_volume_model.to_dict() - assert instance_prototype_instance_by_volume_model_json2 == instance_prototype_instance_by_volume_model_json + instance_prototype_instance_by_source_template_model_json2 = instance_prototype_instance_by_source_template_model.to_dict() + assert instance_prototype_instance_by_source_template_model_json2 == instance_prototype_instance_by_source_template_model_json class TestModel_InstanceTemplateIdentityByCRN(): """ @@ -51066,9 +52093,27 @@ def test_instance_template_prototype_instance_by_image_serialization(self): # Construct dict forms of any model objects needed in order to build this model. + instance_availability_prototype_model = {} # InstanceAvailabilityPrototype + instance_availability_prototype_model['host_failure'] = 'restart' + + trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById + trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5' + + instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype + instance_default_trusted_profile_prototype_model['auto_link'] = False + instance_default_trusted_profile_prototype_model['target'] = trusted_profile_identity_model + key_identity_model = {} # KeyIdentityById key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' + instance_metadata_service_prototype_model = {} # InstanceMetadataServicePrototype + instance_metadata_service_prototype_model['enabled'] = True + + 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' + security_group_identity_model = {} # SecurityGroupIdentityById security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' @@ -51078,7 +52123,7 @@ def test_instance_template_prototype_instance_by_image_serialization(self): network_interface_prototype_model = {} # NetworkInterfacePrototype network_interface_prototype_model['allow_ip_spoofing'] = True network_interface_prototype_model['name'] = 'my-network-interface' - network_interface_prototype_model['primary_ipv4_address'] = '10.0.0.5' + network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model network_interface_prototype_model['security_groups'] = [security_group_identity_model] network_interface_prototype_model['subnet'] = subnet_identity_model @@ -51086,7 +52131,7 @@ def test_instance_template_prototype_instance_by_image_serialization(self): instance_placement_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' instance_profile_identity_model = {} # InstanceProfileIdentityByName - instance_profile_identity_model['name'] = 'cc1-16x32' + instance_profile_identity_model['name'] = 'cx2-16x32' resource_group_identity_model = {} # ResourceGroupIdentityById resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' @@ -51109,7 +52154,7 @@ def test_instance_template_prototype_instance_by_image_serialization(self): volume_profile_identity_model['name'] = 'general-purpose' volume_prototype_instance_by_image_context_model = {} # VolumePrototypeInstanceByImageContext - volume_prototype_instance_by_image_context_model['capacity'] = 38 + volume_prototype_instance_by_image_context_model['capacity'] = 250 volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model volume_prototype_instance_by_image_context_model['iops'] = 10000 volume_prototype_instance_by_image_context_model['name'] = 'my-volume' @@ -51128,7 +52173,10 @@ def test_instance_template_prototype_instance_by_image_serialization(self): # Construct a json representation of a InstanceTemplatePrototypeInstanceByImage model instance_template_prototype_instance_by_image_model_json = {} + instance_template_prototype_instance_by_image_model_json['availability_policy'] = instance_availability_prototype_model + instance_template_prototype_instance_by_image_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model instance_template_prototype_instance_by_image_model_json['keys'] = [key_identity_model] + instance_template_prototype_instance_by_image_model_json['metadata_service'] = instance_metadata_service_prototype_model instance_template_prototype_instance_by_image_model_json['name'] = 'my-instance' instance_template_prototype_instance_by_image_model_json['network_interfaces'] = [network_interface_prototype_model] instance_template_prototype_instance_by_image_model_json['placement_target'] = instance_placement_target_prototype_model @@ -51170,9 +52218,27 @@ def test_instance_template_prototype_instance_by_source_template_serialization(s # Construct dict forms of any model objects needed in order to build this model. + instance_availability_prototype_model = {} # InstanceAvailabilityPrototype + instance_availability_prototype_model['host_failure'] = 'restart' + + trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById + trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5' + + instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype + instance_default_trusted_profile_prototype_model['auto_link'] = False + instance_default_trusted_profile_prototype_model['target'] = trusted_profile_identity_model + key_identity_model = {} # KeyIdentityById key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' + instance_metadata_service_prototype_model = {} # InstanceMetadataServicePrototype + instance_metadata_service_prototype_model['enabled'] = True + + 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' + security_group_identity_model = {} # SecurityGroupIdentityById security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' @@ -51182,7 +52248,7 @@ def test_instance_template_prototype_instance_by_source_template_serialization(s network_interface_prototype_model = {} # NetworkInterfacePrototype network_interface_prototype_model['allow_ip_spoofing'] = True network_interface_prototype_model['name'] = 'my-network-interface' - network_interface_prototype_model['primary_ipv4_address'] = '10.0.0.5' + network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model network_interface_prototype_model['security_groups'] = [security_group_identity_model] network_interface_prototype_model['subnet'] = subnet_identity_model @@ -51190,7 +52256,7 @@ def test_instance_template_prototype_instance_by_source_template_serialization(s instance_placement_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' instance_profile_identity_model = {} # InstanceProfileIdentityByName - instance_profile_identity_model['name'] = 'cc1-16x32' + instance_profile_identity_model['name'] = 'cx2-16x32' resource_group_identity_model = {} # ResourceGroupIdentityById resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' @@ -51213,7 +52279,7 @@ def test_instance_template_prototype_instance_by_source_template_serialization(s volume_profile_identity_model['name'] = 'general-purpose' volume_prototype_instance_by_image_context_model = {} # VolumePrototypeInstanceByImageContext - volume_prototype_instance_by_image_context_model['capacity'] = 38 + volume_prototype_instance_by_image_context_model['capacity'] = 250 volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model volume_prototype_instance_by_image_context_model['iops'] = 10000 volume_prototype_instance_by_image_context_model['name'] = 'my-volume' @@ -51235,7 +52301,10 @@ def test_instance_template_prototype_instance_by_source_template_serialization(s # Construct a json representation of a InstanceTemplatePrototypeInstanceBySourceTemplate model instance_template_prototype_instance_by_source_template_model_json = {} + instance_template_prototype_instance_by_source_template_model_json['availability_policy'] = instance_availability_prototype_model + instance_template_prototype_instance_by_source_template_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model instance_template_prototype_instance_by_source_template_model_json['keys'] = [key_identity_model] + instance_template_prototype_instance_by_source_template_model_json['metadata_service'] = instance_metadata_service_prototype_model instance_template_prototype_instance_by_source_template_model_json['name'] = 'my-instance' instance_template_prototype_instance_by_source_template_model_json['network_interfaces'] = [network_interface_prototype_model] instance_template_prototype_instance_by_source_template_model_json['placement_target'] = instance_placement_target_prototype_model @@ -51266,110 +52335,6 @@ def test_instance_template_prototype_instance_by_source_template_serialization(s instance_template_prototype_instance_by_source_template_model_json2 = instance_template_prototype_instance_by_source_template_model.to_dict() assert instance_template_prototype_instance_by_source_template_model_json2 == instance_template_prototype_instance_by_source_template_model_json -class TestModel_InstanceTemplatePrototypeInstanceByVolume(): - """ - Test Class for InstanceTemplatePrototypeInstanceByVolume - """ - - def test_instance_template_prototype_instance_by_volume_serialization(self): - """ - Test serialization/deserialization for InstanceTemplatePrototypeInstanceByVolume - """ - - # Construct dict forms of any model objects needed in order to build this model. - - key_identity_model = {} # KeyIdentityById - key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' - - security_group_identity_model = {} # SecurityGroupIdentityById - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' - - subnet_identity_model = {} # SubnetIdentityById - subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' - - network_interface_prototype_model = {} # NetworkInterfacePrototype - network_interface_prototype_model['allow_ip_spoofing'] = True - network_interface_prototype_model['name'] = 'my-network-interface' - network_interface_prototype_model['primary_ipv4_address'] = '10.0.0.5' - network_interface_prototype_model['security_groups'] = [security_group_identity_model] - network_interface_prototype_model['subnet'] = subnet_identity_model - - instance_placement_target_prototype_model = {} # InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById - instance_placement_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' - - instance_profile_identity_model = {} # InstanceProfileIdentityByName - instance_profile_identity_model['name'] = 'cc1-16x32' - - resource_group_identity_model = {} # ResourceGroupIdentityById - resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' - - volume_attachment_volume_prototype_instance_context_model = {} # VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById - volume_attachment_volume_prototype_instance_context_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5' - - volume_attachment_prototype_instance_context_model = {} # VolumeAttachmentPrototypeInstanceContext - volume_attachment_prototype_instance_context_model['delete_volume_on_instance_delete'] = True - volume_attachment_prototype_instance_context_model['name'] = 'my-volume-attachment' - volume_attachment_prototype_instance_context_model['volume'] = volume_attachment_volume_prototype_instance_context_model - - vpc_identity_model = {} # VPCIdentityById - vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' - - encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN - encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' - - volume_profile_identity_model = {} # VolumeProfileIdentityByName - volume_profile_identity_model['name'] = 'general-purpose' - - snapshot_identity_model = {} # SnapshotIdentityById - snapshot_identity_model['id'] = '349a61d8-7ab1-420f-a690-5fed76ef9d4f' - - volume_attachment_volume_prototype_instance_by_volume_context_model = {} # VolumeAttachmentVolumePrototypeInstanceByVolumeContextVolumePrototypeInstanceByVolumeContext - volume_attachment_volume_prototype_instance_by_volume_context_model['capacity'] = 38 - volume_attachment_volume_prototype_instance_by_volume_context_model['encryption_key'] = encryption_key_identity_model - volume_attachment_volume_prototype_instance_by_volume_context_model['iops'] = 10000 - volume_attachment_volume_prototype_instance_by_volume_context_model['name'] = 'my-volume' - volume_attachment_volume_prototype_instance_by_volume_context_model['profile'] = volume_profile_identity_model - volume_attachment_volume_prototype_instance_by_volume_context_model['source_snapshot'] = snapshot_identity_model - - volume_attachment_prototype_instance_by_volume_context_model = {} # VolumeAttachmentPrototypeInstanceByVolumeContext - volume_attachment_prototype_instance_by_volume_context_model['delete_volume_on_instance_delete'] = False - volume_attachment_prototype_instance_by_volume_context_model['name'] = 'my-volume-attachment' - volume_attachment_prototype_instance_by_volume_context_model['volume'] = volume_attachment_volume_prototype_instance_by_volume_context_model - - zone_identity_model = {} # ZoneIdentityByName - zone_identity_model['name'] = 'us-south-1' - - # Construct a json representation of a InstanceTemplatePrototypeInstanceByVolume model - instance_template_prototype_instance_by_volume_model_json = {} - instance_template_prototype_instance_by_volume_model_json['keys'] = [key_identity_model] - instance_template_prototype_instance_by_volume_model_json['name'] = 'my-instance' - instance_template_prototype_instance_by_volume_model_json['network_interfaces'] = [network_interface_prototype_model] - instance_template_prototype_instance_by_volume_model_json['placement_target'] = instance_placement_target_prototype_model - instance_template_prototype_instance_by_volume_model_json['profile'] = instance_profile_identity_model - instance_template_prototype_instance_by_volume_model_json['resource_group'] = resource_group_identity_model - instance_template_prototype_instance_by_volume_model_json['total_volume_bandwidth'] = 500 - instance_template_prototype_instance_by_volume_model_json['user_data'] = 'testString' - instance_template_prototype_instance_by_volume_model_json['volume_attachments'] = [volume_attachment_prototype_instance_context_model] - instance_template_prototype_instance_by_volume_model_json['vpc'] = vpc_identity_model - instance_template_prototype_instance_by_volume_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_volume_context_model - instance_template_prototype_instance_by_volume_model_json['primary_network_interface'] = network_interface_prototype_model - instance_template_prototype_instance_by_volume_model_json['zone'] = zone_identity_model - - # Construct a model instance of InstanceTemplatePrototypeInstanceByVolume by calling from_dict on the json representation - instance_template_prototype_instance_by_volume_model = InstanceTemplatePrototypeInstanceByVolume.from_dict(instance_template_prototype_instance_by_volume_model_json) - assert instance_template_prototype_instance_by_volume_model != False - - # Construct a model instance of InstanceTemplatePrototypeInstanceByVolume by calling from_dict on the json representation - instance_template_prototype_instance_by_volume_model_dict = InstanceTemplatePrototypeInstanceByVolume.from_dict(instance_template_prototype_instance_by_volume_model_json).__dict__ - instance_template_prototype_instance_by_volume_model2 = InstanceTemplatePrototypeInstanceByVolume(**instance_template_prototype_instance_by_volume_model_dict) - - # Verify the model instances are equivalent - assert instance_template_prototype_instance_by_volume_model == instance_template_prototype_instance_by_volume_model2 - - # Convert model instance back to dict and verify no loss of data - instance_template_prototype_instance_by_volume_model_json2 = instance_template_prototype_instance_by_volume_model.to_dict() - assert instance_template_prototype_instance_by_volume_model_json2 == instance_template_prototype_instance_by_volume_model_json - class TestModel_InstanceTemplateInstanceByImage(): """ Test Class for InstanceTemplateInstanceByImage @@ -51382,119 +52347,27 @@ def test_instance_template_instance_by_image_serialization(self): # Construct dict forms of any model objects needed in order to build this model. - key_identity_model = {} # KeyIdentityById - key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' - - security_group_identity_model = {} # SecurityGroupIdentityById - security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' - - subnet_identity_model = {} # SubnetIdentityById - subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' - - network_interface_prototype_model = {} # NetworkInterfacePrototype - network_interface_prototype_model['allow_ip_spoofing'] = True - network_interface_prototype_model['name'] = 'my-network-interface' - network_interface_prototype_model['primary_ipv4_address'] = '10.0.0.5' - network_interface_prototype_model['security_groups'] = [security_group_identity_model] - network_interface_prototype_model['subnet'] = subnet_identity_model - - instance_placement_target_prototype_model = {} # InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById - instance_placement_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' - - instance_profile_identity_model = {} # InstanceProfileIdentityByName - instance_profile_identity_model['name'] = 'cc1-16x32' - - 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' - - volume_attachment_volume_prototype_instance_context_model = {} # VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById - volume_attachment_volume_prototype_instance_context_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5' - - volume_attachment_prototype_instance_context_model = {} # VolumeAttachmentPrototypeInstanceContext - volume_attachment_prototype_instance_context_model['delete_volume_on_instance_delete'] = True - volume_attachment_prototype_instance_context_model['name'] = 'my-volume-attachment' - volume_attachment_prototype_instance_context_model['volume'] = volume_attachment_volume_prototype_instance_context_model - - vpc_identity_model = {} # VPCIdentityById - vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' - - encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN - encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' + instance_availability_prototype_model = {} # InstanceAvailabilityPrototype + instance_availability_prototype_model['host_failure'] = 'restart' - volume_profile_identity_model = {} # VolumeProfileIdentityByName - volume_profile_identity_model['name'] = 'general-purpose' - - volume_prototype_instance_by_image_context_model = {} # VolumePrototypeInstanceByImageContext - volume_prototype_instance_by_image_context_model['capacity'] = 38 - volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model - volume_prototype_instance_by_image_context_model['iops'] = 10000 - volume_prototype_instance_by_image_context_model['name'] = 'my-volume' - volume_prototype_instance_by_image_context_model['profile'] = volume_profile_identity_model + trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById + trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5' - volume_attachment_prototype_instance_by_image_context_model = {} # VolumeAttachmentPrototypeInstanceByImageContext - volume_attachment_prototype_instance_by_image_context_model['delete_volume_on_instance_delete'] = True - volume_attachment_prototype_instance_by_image_context_model['name'] = 'my-volume-attachment' - volume_attachment_prototype_instance_by_image_context_model['volume'] = volume_prototype_instance_by_image_context_model - - image_identity_model = {} # ImageIdentityById - image_identity_model['id'] = '72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' - - zone_identity_model = {} # ZoneIdentityByName - zone_identity_model['name'] = 'us-south-1' - - # Construct a json representation of a InstanceTemplateInstanceByImage model - instance_template_instance_by_image_model_json = {} - instance_template_instance_by_image_model_json['created_at'] = "2019-01-01T12:00:00Z" - instance_template_instance_by_image_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a' - instance_template_instance_by_image_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a' - instance_template_instance_by_image_model_json['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' - instance_template_instance_by_image_model_json['keys'] = [key_identity_model] - instance_template_instance_by_image_model_json['name'] = 'my-instance-template' - instance_template_instance_by_image_model_json['network_interfaces'] = [network_interface_prototype_model] - instance_template_instance_by_image_model_json['placement_target'] = instance_placement_target_prototype_model - instance_template_instance_by_image_model_json['profile'] = instance_profile_identity_model - instance_template_instance_by_image_model_json['resource_group'] = resource_group_reference_model - instance_template_instance_by_image_model_json['total_volume_bandwidth'] = 500 - instance_template_instance_by_image_model_json['user_data'] = 'testString' - instance_template_instance_by_image_model_json['volume_attachments'] = [volume_attachment_prototype_instance_context_model] - instance_template_instance_by_image_model_json['vpc'] = vpc_identity_model - instance_template_instance_by_image_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model - instance_template_instance_by_image_model_json['image'] = image_identity_model - instance_template_instance_by_image_model_json['primary_network_interface'] = network_interface_prototype_model - instance_template_instance_by_image_model_json['zone'] = zone_identity_model - - # Construct a model instance of InstanceTemplateInstanceByImage by calling from_dict on the json representation - instance_template_instance_by_image_model = InstanceTemplateInstanceByImage.from_dict(instance_template_instance_by_image_model_json) - assert instance_template_instance_by_image_model != False - - # Construct a model instance of InstanceTemplateInstanceByImage by calling from_dict on the json representation - instance_template_instance_by_image_model_dict = InstanceTemplateInstanceByImage.from_dict(instance_template_instance_by_image_model_json).__dict__ - instance_template_instance_by_image_model2 = InstanceTemplateInstanceByImage(**instance_template_instance_by_image_model_dict) - - # Verify the model instances are equivalent - assert instance_template_instance_by_image_model == instance_template_instance_by_image_model2 - - # Convert model instance back to dict and verify no loss of data - instance_template_instance_by_image_model_json2 = instance_template_instance_by_image_model.to_dict() - assert instance_template_instance_by_image_model_json2 == instance_template_instance_by_image_model_json - -class TestModel_InstanceTemplateInstanceByVolume(): - """ - Test Class for InstanceTemplateInstanceByVolume - """ - - def test_instance_template_instance_by_volume_serialization(self): - """ - Test serialization/deserialization for InstanceTemplateInstanceByVolume - """ - - # Construct dict forms of any model objects needed in order to build this model. + instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype + instance_default_trusted_profile_prototype_model['auto_link'] = False + instance_default_trusted_profile_prototype_model['target'] = trusted_profile_identity_model key_identity_model = {} # KeyIdentityById key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' + instance_metadata_service_prototype_model = {} # InstanceMetadataServicePrototype + instance_metadata_service_prototype_model['enabled'] = True + + 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' + security_group_identity_model = {} # SecurityGroupIdentityById security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' @@ -51504,7 +52377,7 @@ def test_instance_template_instance_by_volume_serialization(self): network_interface_prototype_model = {} # NetworkInterfacePrototype network_interface_prototype_model['allow_ip_spoofing'] = True network_interface_prototype_model['name'] = 'my-network-interface' - network_interface_prototype_model['primary_ipv4_address'] = '10.0.0.5' + network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model network_interface_prototype_model['security_groups'] = [security_group_identity_model] network_interface_prototype_model['subnet'] = subnet_identity_model @@ -51512,7 +52385,7 @@ def test_instance_template_instance_by_volume_serialization(self): instance_placement_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' instance_profile_identity_model = {} # InstanceProfileIdentityByName - instance_profile_identity_model['name'] = 'cc1-16x32' + instance_profile_identity_model['name'] = 'cx2-16x32' resource_group_reference_model = {} # ResourceGroupReference resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' @@ -51536,59 +52409,62 @@ def test_instance_template_instance_by_volume_serialization(self): volume_profile_identity_model = {} # VolumeProfileIdentityByName volume_profile_identity_model['name'] = 'general-purpose' - snapshot_identity_model = {} # SnapshotIdentityById - snapshot_identity_model['id'] = '349a61d8-7ab1-420f-a690-5fed76ef9d4f' + volume_prototype_instance_by_image_context_model = {} # VolumePrototypeInstanceByImageContext + volume_prototype_instance_by_image_context_model['capacity'] = 250 + volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model + volume_prototype_instance_by_image_context_model['iops'] = 10000 + volume_prototype_instance_by_image_context_model['name'] = 'my-volume' + volume_prototype_instance_by_image_context_model['profile'] = volume_profile_identity_model - volume_attachment_volume_prototype_instance_by_volume_context_model = {} # VolumeAttachmentVolumePrototypeInstanceByVolumeContextVolumePrototypeInstanceByVolumeContext - volume_attachment_volume_prototype_instance_by_volume_context_model['capacity'] = 38 - volume_attachment_volume_prototype_instance_by_volume_context_model['encryption_key'] = encryption_key_identity_model - volume_attachment_volume_prototype_instance_by_volume_context_model['iops'] = 10000 - volume_attachment_volume_prototype_instance_by_volume_context_model['name'] = 'my-volume' - volume_attachment_volume_prototype_instance_by_volume_context_model['profile'] = volume_profile_identity_model - volume_attachment_volume_prototype_instance_by_volume_context_model['source_snapshot'] = snapshot_identity_model + volume_attachment_prototype_instance_by_image_context_model = {} # VolumeAttachmentPrototypeInstanceByImageContext + volume_attachment_prototype_instance_by_image_context_model['delete_volume_on_instance_delete'] = True + volume_attachment_prototype_instance_by_image_context_model['name'] = 'my-volume-attachment' + volume_attachment_prototype_instance_by_image_context_model['volume'] = volume_prototype_instance_by_image_context_model - volume_attachment_prototype_instance_by_volume_context_model = {} # VolumeAttachmentPrototypeInstanceByVolumeContext - volume_attachment_prototype_instance_by_volume_context_model['delete_volume_on_instance_delete'] = False - volume_attachment_prototype_instance_by_volume_context_model['name'] = 'my-volume-attachment' - volume_attachment_prototype_instance_by_volume_context_model['volume'] = volume_attachment_volume_prototype_instance_by_volume_context_model + image_identity_model = {} # ImageIdentityById + image_identity_model['id'] = '72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' zone_identity_model = {} # ZoneIdentityByName zone_identity_model['name'] = 'us-south-1' - # Construct a json representation of a InstanceTemplateInstanceByVolume model - instance_template_instance_by_volume_model_json = {} - instance_template_instance_by_volume_model_json['created_at'] = "2019-01-01T12:00:00Z" - instance_template_instance_by_volume_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a' - instance_template_instance_by_volume_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a' - instance_template_instance_by_volume_model_json['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' - instance_template_instance_by_volume_model_json['keys'] = [key_identity_model] - instance_template_instance_by_volume_model_json['name'] = 'my-instance-template' - instance_template_instance_by_volume_model_json['network_interfaces'] = [network_interface_prototype_model] - instance_template_instance_by_volume_model_json['placement_target'] = instance_placement_target_prototype_model - instance_template_instance_by_volume_model_json['profile'] = instance_profile_identity_model - instance_template_instance_by_volume_model_json['resource_group'] = resource_group_reference_model - instance_template_instance_by_volume_model_json['total_volume_bandwidth'] = 500 - instance_template_instance_by_volume_model_json['user_data'] = 'testString' - instance_template_instance_by_volume_model_json['volume_attachments'] = [volume_attachment_prototype_instance_context_model] - instance_template_instance_by_volume_model_json['vpc'] = vpc_identity_model - instance_template_instance_by_volume_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_volume_context_model - instance_template_instance_by_volume_model_json['primary_network_interface'] = network_interface_prototype_model - instance_template_instance_by_volume_model_json['zone'] = zone_identity_model - - # Construct a model instance of InstanceTemplateInstanceByVolume by calling from_dict on the json representation - instance_template_instance_by_volume_model = InstanceTemplateInstanceByVolume.from_dict(instance_template_instance_by_volume_model_json) - assert instance_template_instance_by_volume_model != False - - # Construct a model instance of InstanceTemplateInstanceByVolume by calling from_dict on the json representation - instance_template_instance_by_volume_model_dict = InstanceTemplateInstanceByVolume.from_dict(instance_template_instance_by_volume_model_json).__dict__ - instance_template_instance_by_volume_model2 = InstanceTemplateInstanceByVolume(**instance_template_instance_by_volume_model_dict) - - # Verify the model instances are equivalent - assert instance_template_instance_by_volume_model == instance_template_instance_by_volume_model2 - - # Convert model instance back to dict and verify no loss of data - instance_template_instance_by_volume_model_json2 = instance_template_instance_by_volume_model.to_dict() - assert instance_template_instance_by_volume_model_json2 == instance_template_instance_by_volume_model_json + # Construct a json representation of a InstanceTemplateInstanceByImage model + instance_template_instance_by_image_model_json = {} + instance_template_instance_by_image_model_json['availability_policy'] = instance_availability_prototype_model + instance_template_instance_by_image_model_json['created_at'] = "2019-01-01T12:00:00Z" + instance_template_instance_by_image_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_template_instance_by_image_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model + instance_template_instance_by_image_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_template_instance_by_image_model_json['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' + instance_template_instance_by_image_model_json['keys'] = [key_identity_model] + instance_template_instance_by_image_model_json['metadata_service'] = instance_metadata_service_prototype_model + instance_template_instance_by_image_model_json['name'] = 'my-instance-template' + instance_template_instance_by_image_model_json['network_interfaces'] = [network_interface_prototype_model] + instance_template_instance_by_image_model_json['placement_target'] = instance_placement_target_prototype_model + instance_template_instance_by_image_model_json['profile'] = instance_profile_identity_model + instance_template_instance_by_image_model_json['resource_group'] = resource_group_reference_model + instance_template_instance_by_image_model_json['total_volume_bandwidth'] = 500 + instance_template_instance_by_image_model_json['user_data'] = 'testString' + instance_template_instance_by_image_model_json['volume_attachments'] = [volume_attachment_prototype_instance_context_model] + instance_template_instance_by_image_model_json['vpc'] = vpc_identity_model + instance_template_instance_by_image_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model + instance_template_instance_by_image_model_json['image'] = image_identity_model + instance_template_instance_by_image_model_json['primary_network_interface'] = network_interface_prototype_model + instance_template_instance_by_image_model_json['zone'] = zone_identity_model + + # Construct a model instance of InstanceTemplateInstanceByImage by calling from_dict on the json representation + instance_template_instance_by_image_model = InstanceTemplateInstanceByImage.from_dict(instance_template_instance_by_image_model_json) + assert instance_template_instance_by_image_model != False + + # Construct a model instance of InstanceTemplateInstanceByImage by calling from_dict on the json representation + instance_template_instance_by_image_model_dict = InstanceTemplateInstanceByImage.from_dict(instance_template_instance_by_image_model_json).__dict__ + instance_template_instance_by_image_model2 = InstanceTemplateInstanceByImage(**instance_template_instance_by_image_model_dict) + + # Verify the model instances are equivalent + assert instance_template_instance_by_image_model == instance_template_instance_by_image_model2 + + # Convert model instance back to dict and verify no loss of data + instance_template_instance_by_image_model_json2 = instance_template_instance_by_image_model.to_dict() + assert instance_template_instance_by_image_model_json2 == instance_template_instance_by_image_model_json class TestModel_KeyIdentityByCRN(): """ @@ -51706,6 +52582,35 @@ def test_key_identity_by_id_serialization(self): key_identity_by_id_model_json2 = key_identity_by_id_model.to_dict() assert key_identity_by_id_model_json2 == key_identity_by_id_model_json +class TestModel_LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName(): + """ + Test Class for LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName + """ + + def test_legacy_cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_serialization(self): + """ + Test serialization/deserialization for LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName + """ + + # Construct a json representation of a LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName model + legacy_cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model_json = {} + legacy_cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model_json['name'] = 'bucket-27200-lwx4cfvcue' + + # Construct a model instance of LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName by calling from_dict on the json representation + legacy_cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model = LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName.from_dict(legacy_cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model_json) + assert legacy_cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model != False + + # Construct a model instance of LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName by calling from_dict on the json representation + legacy_cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model_dict = LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName.from_dict(legacy_cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model_json).__dict__ + legacy_cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model2 = LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName(**legacy_cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model_dict) + + # Verify the model instances are equivalent + assert legacy_cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model == legacy_cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model2 + + # Convert model instance back to dict and verify no loss of data + legacy_cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model_json2 = legacy_cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model.to_dict() + assert legacy_cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model_json2 == legacy_cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model_json + class TestModel_LoadBalancerIdentityByCRN(): """ Test Class for LoadBalancerIdentityByCRN @@ -52421,6 +53326,65 @@ def test_load_balancer_profile_security_groups_supported_fixed_serialization(sel load_balancer_profile_security_groups_supported_fixed_model_json2 = load_balancer_profile_security_groups_supported_fixed_model.to_dict() assert load_balancer_profile_security_groups_supported_fixed_model_json2 == load_balancer_profile_security_groups_supported_fixed_model_json +class TestModel_LoadBalancerProfileUDPSupportedDependent(): + """ + Test Class for LoadBalancerProfileUDPSupportedDependent + """ + + def test_load_balancer_profile_udp_supported_dependent_serialization(self): + """ + Test serialization/deserialization for LoadBalancerProfileUDPSupportedDependent + """ + + # Construct a json representation of a LoadBalancerProfileUDPSupportedDependent model + load_balancer_profile_udp_supported_dependent_model_json = {} + load_balancer_profile_udp_supported_dependent_model_json['type'] = 'dependent' + + # Construct a model instance of LoadBalancerProfileUDPSupportedDependent by calling from_dict on the json representation + load_balancer_profile_udp_supported_dependent_model = LoadBalancerProfileUDPSupportedDependent.from_dict(load_balancer_profile_udp_supported_dependent_model_json) + assert load_balancer_profile_udp_supported_dependent_model != False + + # Construct a model instance of LoadBalancerProfileUDPSupportedDependent by calling from_dict on the json representation + load_balancer_profile_udp_supported_dependent_model_dict = LoadBalancerProfileUDPSupportedDependent.from_dict(load_balancer_profile_udp_supported_dependent_model_json).__dict__ + load_balancer_profile_udp_supported_dependent_model2 = LoadBalancerProfileUDPSupportedDependent(**load_balancer_profile_udp_supported_dependent_model_dict) + + # Verify the model instances are equivalent + assert load_balancer_profile_udp_supported_dependent_model == load_balancer_profile_udp_supported_dependent_model2 + + # Convert model instance back to dict and verify no loss of data + load_balancer_profile_udp_supported_dependent_model_json2 = load_balancer_profile_udp_supported_dependent_model.to_dict() + assert load_balancer_profile_udp_supported_dependent_model_json2 == load_balancer_profile_udp_supported_dependent_model_json + +class TestModel_LoadBalancerProfileUDPSupportedFixed(): + """ + Test Class for LoadBalancerProfileUDPSupportedFixed + """ + + def test_load_balancer_profile_udp_supported_fixed_serialization(self): + """ + Test serialization/deserialization for LoadBalancerProfileUDPSupportedFixed + """ + + # Construct a json representation of a LoadBalancerProfileUDPSupportedFixed model + load_balancer_profile_udp_supported_fixed_model_json = {} + load_balancer_profile_udp_supported_fixed_model_json['type'] = 'fixed' + load_balancer_profile_udp_supported_fixed_model_json['value'] = True + + # Construct a model instance of LoadBalancerProfileUDPSupportedFixed by calling from_dict on the json representation + load_balancer_profile_udp_supported_fixed_model = LoadBalancerProfileUDPSupportedFixed.from_dict(load_balancer_profile_udp_supported_fixed_model_json) + assert load_balancer_profile_udp_supported_fixed_model != False + + # Construct a model instance of LoadBalancerProfileUDPSupportedFixed by calling from_dict on the json representation + load_balancer_profile_udp_supported_fixed_model_dict = LoadBalancerProfileUDPSupportedFixed.from_dict(load_balancer_profile_udp_supported_fixed_model_json).__dict__ + load_balancer_profile_udp_supported_fixed_model2 = LoadBalancerProfileUDPSupportedFixed(**load_balancer_profile_udp_supported_fixed_model_dict) + + # Verify the model instances are equivalent + assert load_balancer_profile_udp_supported_fixed_model == load_balancer_profile_udp_supported_fixed_model2 + + # Convert model instance back to dict and verify no loss of data + load_balancer_profile_udp_supported_fixed_model_json2 = load_balancer_profile_udp_supported_fixed_model.to_dict() + assert load_balancer_profile_udp_supported_fixed_model_json2 == load_balancer_profile_udp_supported_fixed_model_json + class TestModel_NetworkACLIdentityByCRN(): """ Test Class for NetworkACLIdentityByCRN @@ -53265,6 +54229,37 @@ def test_network_acl_rule_network_acl_rule_protocol_tcpudp_serialization(self): network_acl_rule_network_acl_rule_protocol_tcpudp_model_json2 = network_acl_rule_network_acl_rule_protocol_tcpudp_model.to_dict() assert network_acl_rule_network_acl_rule_protocol_tcpudp_model_json2 == network_acl_rule_network_acl_rule_protocol_tcpudp_model_json +class TestModel_NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext(): + """ + Test Class for NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext + """ + + def test_network_interface_ip_prototype_reserved_ip_prototype_network_interface_context_serialization(self): + """ + Test serialization/deserialization for NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext + """ + + # Construct a json representation of a NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext model + network_interface_ip_prototype_reserved_ip_prototype_network_interface_context_model_json = {} + network_interface_ip_prototype_reserved_ip_prototype_network_interface_context_model_json['address'] = '192.168.3.4' + network_interface_ip_prototype_reserved_ip_prototype_network_interface_context_model_json['auto_delete'] = False + network_interface_ip_prototype_reserved_ip_prototype_network_interface_context_model_json['name'] = 'my-reserved-ip' + + # Construct a model instance of NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext by calling from_dict on the json representation + network_interface_ip_prototype_reserved_ip_prototype_network_interface_context_model = NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext.from_dict(network_interface_ip_prototype_reserved_ip_prototype_network_interface_context_model_json) + assert network_interface_ip_prototype_reserved_ip_prototype_network_interface_context_model != False + + # Construct a model instance of NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext by calling from_dict on the json representation + network_interface_ip_prototype_reserved_ip_prototype_network_interface_context_model_dict = NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext.from_dict(network_interface_ip_prototype_reserved_ip_prototype_network_interface_context_model_json).__dict__ + network_interface_ip_prototype_reserved_ip_prototype_network_interface_context_model2 = NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext(**network_interface_ip_prototype_reserved_ip_prototype_network_interface_context_model_dict) + + # Verify the model instances are equivalent + assert network_interface_ip_prototype_reserved_ip_prototype_network_interface_context_model == network_interface_ip_prototype_reserved_ip_prototype_network_interface_context_model2 + + # Convert model instance back to dict and verify no loss of data + network_interface_ip_prototype_reserved_ip_prototype_network_interface_context_model_json2 = network_interface_ip_prototype_reserved_ip_prototype_network_interface_context_model.to_dict() + assert network_interface_ip_prototype_reserved_ip_prototype_network_interface_context_model_json2 == network_interface_ip_prototype_reserved_ip_prototype_network_interface_context_model_json + class TestModel_OperatingSystemIdentityByHref(): """ Test Class for OperatingSystemIdentityByHref @@ -53484,6 +54479,158 @@ def test_reserved_ip_target_endpoint_gateway_reference_serialization(self): reserved_ip_target_endpoint_gateway_reference_model_json2 = reserved_ip_target_endpoint_gateway_reference_model.to_dict() assert reserved_ip_target_endpoint_gateway_reference_model_json2 == reserved_ip_target_endpoint_gateway_reference_model_json +class TestModel_ReservedIPTargetGenericResourceReference(): + """ + Test Class for ReservedIPTargetGenericResourceReference + """ + + def test_reserved_ip_target_generic_resource_reference_serialization(self): + """ + Test serialization/deserialization for ReservedIPTargetGenericResourceReference + """ + + # Construct dict forms of any model objects needed in order to build this model. + + generic_resource_reference_deleted_model = {} # GenericResourceReferenceDeleted + generic_resource_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + # Construct a json representation of a ReservedIPTargetGenericResourceReference model + reserved_ip_target_generic_resource_reference_model_json = {} + reserved_ip_target_generic_resource_reference_model_json['crn'] = 'crn:v1:bluemix:public:containers-kubernetes:us-south:a/c10403890f084abcbf26b3e6b3760361:9qtrw1peys2spdfs7agb::' + reserved_ip_target_generic_resource_reference_model_json['deleted'] = generic_resource_reference_deleted_model + reserved_ip_target_generic_resource_reference_model_json['resource_type'] = 'cloud_resource' + + # Construct a model instance of ReservedIPTargetGenericResourceReference by calling from_dict on the json representation + reserved_ip_target_generic_resource_reference_model = ReservedIPTargetGenericResourceReference.from_dict(reserved_ip_target_generic_resource_reference_model_json) + assert reserved_ip_target_generic_resource_reference_model != False + + # Construct a model instance of ReservedIPTargetGenericResourceReference by calling from_dict on the json representation + reserved_ip_target_generic_resource_reference_model_dict = ReservedIPTargetGenericResourceReference.from_dict(reserved_ip_target_generic_resource_reference_model_json).__dict__ + reserved_ip_target_generic_resource_reference_model2 = ReservedIPTargetGenericResourceReference(**reserved_ip_target_generic_resource_reference_model_dict) + + # Verify the model instances are equivalent + assert reserved_ip_target_generic_resource_reference_model == reserved_ip_target_generic_resource_reference_model2 + + # Convert model instance back to dict and verify no loss of data + reserved_ip_target_generic_resource_reference_model_json2 = reserved_ip_target_generic_resource_reference_model.to_dict() + assert reserved_ip_target_generic_resource_reference_model_json2 == reserved_ip_target_generic_resource_reference_model_json + +class TestModel_ReservedIPTargetLoadBalancerReference(): + """ + Test Class for ReservedIPTargetLoadBalancerReference + """ + + def test_reserved_ip_target_load_balancer_reference_serialization(self): + """ + Test serialization/deserialization for ReservedIPTargetLoadBalancerReference + """ + + # Construct dict forms of any model objects needed in order to build this model. + + load_balancer_reference_deleted_model = {} # LoadBalancerReferenceDeleted + load_balancer_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + # Construct a json representation of a ReservedIPTargetLoadBalancerReference model + reserved_ip_target_load_balancer_reference_model_json = {} + reserved_ip_target_load_balancer_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727' + reserved_ip_target_load_balancer_reference_model_json['deleted'] = load_balancer_reference_deleted_model + reserved_ip_target_load_balancer_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727' + reserved_ip_target_load_balancer_reference_model_json['id'] = 'dd754295-e9e0-4c9d-bf6c-58fbc59e5727' + reserved_ip_target_load_balancer_reference_model_json['name'] = 'my-load-balancer' + reserved_ip_target_load_balancer_reference_model_json['resource_type'] = 'load_balancer' + + # Construct a model instance of ReservedIPTargetLoadBalancerReference by calling from_dict on the json representation + reserved_ip_target_load_balancer_reference_model = ReservedIPTargetLoadBalancerReference.from_dict(reserved_ip_target_load_balancer_reference_model_json) + assert reserved_ip_target_load_balancer_reference_model != False + + # Construct a model instance of ReservedIPTargetLoadBalancerReference by calling from_dict on the json representation + reserved_ip_target_load_balancer_reference_model_dict = ReservedIPTargetLoadBalancerReference.from_dict(reserved_ip_target_load_balancer_reference_model_json).__dict__ + reserved_ip_target_load_balancer_reference_model2 = ReservedIPTargetLoadBalancerReference(**reserved_ip_target_load_balancer_reference_model_dict) + + # Verify the model instances are equivalent + assert reserved_ip_target_load_balancer_reference_model == reserved_ip_target_load_balancer_reference_model2 + + # Convert model instance back to dict and verify no loss of data + reserved_ip_target_load_balancer_reference_model_json2 = reserved_ip_target_load_balancer_reference_model.to_dict() + assert reserved_ip_target_load_balancer_reference_model_json2 == reserved_ip_target_load_balancer_reference_model_json + +class TestModel_ReservedIPTargetNetworkInterfaceReferenceTargetContext(): + """ + Test Class for ReservedIPTargetNetworkInterfaceReferenceTargetContext + """ + + def test_reserved_ip_target_network_interface_reference_target_context_serialization(self): + """ + Test serialization/deserialization for ReservedIPTargetNetworkInterfaceReferenceTargetContext + """ + + # Construct dict forms of any model objects needed in order to build this model. + + network_interface_reference_target_context_deleted_model = {} # NetworkInterfaceReferenceTargetContextDeleted + network_interface_reference_target_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + # 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'] = network_interface_reference_target_context_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/10c02d81-0ecb-4dc5-897d-28392913b81e' + reserved_ip_target_network_interface_reference_target_context_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' + reserved_ip_target_network_interface_reference_target_context_model_json['name'] = 'my-network-interface' + reserved_ip_target_network_interface_reference_target_context_model_json['resource_type'] = 'network_interface' + + # Construct a model instance of ReservedIPTargetNetworkInterfaceReferenceTargetContext by calling from_dict on the json representation + reserved_ip_target_network_interface_reference_target_context_model = ReservedIPTargetNetworkInterfaceReferenceTargetContext.from_dict(reserved_ip_target_network_interface_reference_target_context_model_json) + assert reserved_ip_target_network_interface_reference_target_context_model != False + + # Construct a model instance of ReservedIPTargetNetworkInterfaceReferenceTargetContext by calling from_dict on the json representation + reserved_ip_target_network_interface_reference_target_context_model_dict = ReservedIPTargetNetworkInterfaceReferenceTargetContext.from_dict(reserved_ip_target_network_interface_reference_target_context_model_json).__dict__ + reserved_ip_target_network_interface_reference_target_context_model2 = ReservedIPTargetNetworkInterfaceReferenceTargetContext(**reserved_ip_target_network_interface_reference_target_context_model_dict) + + # Verify the model instances are equivalent + assert reserved_ip_target_network_interface_reference_target_context_model == reserved_ip_target_network_interface_reference_target_context_model2 + + # Convert model instance back to dict and verify no loss of data + reserved_ip_target_network_interface_reference_target_context_model_json2 = reserved_ip_target_network_interface_reference_target_context_model.to_dict() + assert reserved_ip_target_network_interface_reference_target_context_model_json2 == reserved_ip_target_network_interface_reference_target_context_model_json + +class TestModel_ReservedIPTargetVPNGatewayReference(): + """ + Test Class for ReservedIPTargetVPNGatewayReference + """ + + def test_reserved_ip_target_vpn_gateway_reference_serialization(self): + """ + Test serialization/deserialization for ReservedIPTargetVPNGatewayReference + """ + + # Construct dict forms of any model objects needed in order to build this model. + + vpn_gateway_reference_deleted_model = {} # VPNGatewayReferenceDeleted + vpn_gateway_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + # Construct a json representation of a ReservedIPTargetVPNGatewayReference model + reserved_ip_target_vpn_gateway_reference_model_json = {} + reserved_ip_target_vpn_gateway_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b' + reserved_ip_target_vpn_gateway_reference_model_json['deleted'] = vpn_gateway_reference_deleted_model + reserved_ip_target_vpn_gateway_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b' + reserved_ip_target_vpn_gateway_reference_model_json['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' + reserved_ip_target_vpn_gateway_reference_model_json['name'] = 'my-vpn-gateway' + reserved_ip_target_vpn_gateway_reference_model_json['resource_type'] = 'vpn_gateway' + + # Construct a model instance of ReservedIPTargetVPNGatewayReference by calling from_dict on the json representation + reserved_ip_target_vpn_gateway_reference_model = ReservedIPTargetVPNGatewayReference.from_dict(reserved_ip_target_vpn_gateway_reference_model_json) + assert reserved_ip_target_vpn_gateway_reference_model != False + + # Construct a model instance of ReservedIPTargetVPNGatewayReference by calling from_dict on the json representation + reserved_ip_target_vpn_gateway_reference_model_dict = ReservedIPTargetVPNGatewayReference.from_dict(reserved_ip_target_vpn_gateway_reference_model_json).__dict__ + reserved_ip_target_vpn_gateway_reference_model2 = ReservedIPTargetVPNGatewayReference(**reserved_ip_target_vpn_gateway_reference_model_dict) + + # Verify the model instances are equivalent + assert reserved_ip_target_vpn_gateway_reference_model == reserved_ip_target_vpn_gateway_reference_model2 + + # Convert model instance back to dict and verify no loss of data + reserved_ip_target_vpn_gateway_reference_model_json2 = reserved_ip_target_vpn_gateway_reference_model.to_dict() + assert reserved_ip_target_vpn_gateway_reference_model_json2 == reserved_ip_target_vpn_gateway_reference_model_json + class TestModel_ResourceGroupIdentityById(): """ Test Class for ResourceGroupIdentityById @@ -54263,6 +55410,7 @@ def test_security_group_target_reference_load_balancer_reference_serialization(s security_group_target_reference_load_balancer_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727' security_group_target_reference_load_balancer_reference_model_json['id'] = 'dd754295-e9e0-4c9d-bf6c-58fbc59e5727' security_group_target_reference_load_balancer_reference_model_json['name'] = 'my-load-balancer' + security_group_target_reference_load_balancer_reference_model_json['resource_type'] = 'load_balancer' # Construct a model instance of SecurityGroupTargetReferenceLoadBalancerReference by calling from_dict on the json representation security_group_target_reference_load_balancer_reference_model = SecurityGroupTargetReferenceLoadBalancerReference.from_dict(security_group_target_reference_load_balancer_reference_model_json) @@ -54404,6 +55552,46 @@ def test_snapshot_identity_by_id_serialization(self): snapshot_identity_by_id_model_json2 = snapshot_identity_by_id_model.to_dict() assert snapshot_identity_by_id_model_json2 == snapshot_identity_by_id_model_json +class TestModel_SnapshotPrototypeSnapshotBySourceVolume(): + """ + Test Class for SnapshotPrototypeSnapshotBySourceVolume + """ + + def test_snapshot_prototype_snapshot_by_source_volume_serialization(self): + """ + Test serialization/deserialization for SnapshotPrototypeSnapshotBySourceVolume + """ + + # Construct dict forms of any model objects needed in order to build this model. + + resource_group_identity_model = {} # ResourceGroupIdentityById + resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + + volume_identity_model = {} # VolumeIdentityById + volume_identity_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5' + + # Construct a json representation of a SnapshotPrototypeSnapshotBySourceVolume model + snapshot_prototype_snapshot_by_source_volume_model_json = {} + snapshot_prototype_snapshot_by_source_volume_model_json['name'] = 'my-snapshot' + snapshot_prototype_snapshot_by_source_volume_model_json['resource_group'] = resource_group_identity_model + snapshot_prototype_snapshot_by_source_volume_model_json['user_tags'] = ['testString'] + snapshot_prototype_snapshot_by_source_volume_model_json['source_volume'] = volume_identity_model + + # Construct a model instance of SnapshotPrototypeSnapshotBySourceVolume by calling from_dict on the json representation + snapshot_prototype_snapshot_by_source_volume_model = SnapshotPrototypeSnapshotBySourceVolume.from_dict(snapshot_prototype_snapshot_by_source_volume_model_json) + assert snapshot_prototype_snapshot_by_source_volume_model != False + + # Construct a model instance of SnapshotPrototypeSnapshotBySourceVolume by calling from_dict on the json representation + snapshot_prototype_snapshot_by_source_volume_model_dict = SnapshotPrototypeSnapshotBySourceVolume.from_dict(snapshot_prototype_snapshot_by_source_volume_model_json).__dict__ + snapshot_prototype_snapshot_by_source_volume_model2 = SnapshotPrototypeSnapshotBySourceVolume(**snapshot_prototype_snapshot_by_source_volume_model_dict) + + # Verify the model instances are equivalent + assert snapshot_prototype_snapshot_by_source_volume_model == snapshot_prototype_snapshot_by_source_volume_model2 + + # Convert model instance back to dict and verify no loss of data + snapshot_prototype_snapshot_by_source_volume_model_json2 = snapshot_prototype_snapshot_by_source_volume_model.to_dict() + assert snapshot_prototype_snapshot_by_source_volume_model_json2 == snapshot_prototype_snapshot_by_source_volume_model_json + class TestModel_SubnetIdentityByCRN(): """ Test Class for SubnetIdentityByCRN @@ -54692,6 +55880,64 @@ def test_subnet_public_gateway_patch_public_gateway_identity_by_id_serialization subnet_public_gateway_patch_public_gateway_identity_by_id_model_json2 = subnet_public_gateway_patch_public_gateway_identity_by_id_model.to_dict() 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(): + """ + Test Class for TrustedProfileIdentityTrustedProfileByCRN + """ + + def test_trusted_profile_identity_trusted_profile_by_crn_serialization(self): + """ + Test serialization/deserialization for TrustedProfileIdentityTrustedProfileByCRN + """ + + # 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/123456::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 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) + + # Verify the model instances are equivalent + assert trusted_profile_identity_trusted_profile_by_crn_model == trusted_profile_identity_trusted_profile_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 + +class TestModel_TrustedProfileIdentityTrustedProfileById(): + """ + Test Class for TrustedProfileIdentityTrustedProfileById + """ + + def test_trusted_profile_identity_trusted_profile_by_id_serialization(self): + """ + Test serialization/deserialization for TrustedProfileIdentityTrustedProfileById + """ + + # 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 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 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) + + # Verify the model instances are equivalent + assert trusted_profile_identity_trusted_profile_by_id_model == trusted_profile_identity_trusted_profile_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 + class TestModel_VPCIdentityByCRN(): """ Test Class for VPCIdentityByCRN @@ -55540,51 +56786,6 @@ def test_vpn_gateway_route_mode_serialization(self): vpn_gateway_route_mode_model_json2 = vpn_gateway_route_mode_model.to_dict() assert vpn_gateway_route_mode_model_json2 == vpn_gateway_route_mode_model_json -class TestModel_VolumeAttachmentVolumePrototypeInstanceByVolumeContextVolumePrototypeInstanceByVolumeContext(): - """ - Test Class for VolumeAttachmentVolumePrototypeInstanceByVolumeContextVolumePrototypeInstanceByVolumeContext - """ - - def test_volume_attachment_volume_prototype_instance_by_volume_context_volume_prototype_instance_by_volume_context_serialization(self): - """ - Test serialization/deserialization for VolumeAttachmentVolumePrototypeInstanceByVolumeContextVolumePrototypeInstanceByVolumeContext - """ - - # 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/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' - - volume_profile_identity_model = {} # VolumeProfileIdentityByName - volume_profile_identity_model['name'] = 'general-purpose' - - snapshot_identity_model = {} # SnapshotIdentityById - snapshot_identity_model['id'] = '349a61d8-7ab1-420f-a690-5fed76ef9d4f' - - # Construct a json representation of a VolumeAttachmentVolumePrototypeInstanceByVolumeContextVolumePrototypeInstanceByVolumeContext model - volume_attachment_volume_prototype_instance_by_volume_context_volume_prototype_instance_by_volume_context_model_json = {} - volume_attachment_volume_prototype_instance_by_volume_context_volume_prototype_instance_by_volume_context_model_json['capacity'] = 38 - volume_attachment_volume_prototype_instance_by_volume_context_volume_prototype_instance_by_volume_context_model_json['encryption_key'] = encryption_key_identity_model - volume_attachment_volume_prototype_instance_by_volume_context_volume_prototype_instance_by_volume_context_model_json['iops'] = 10000 - volume_attachment_volume_prototype_instance_by_volume_context_volume_prototype_instance_by_volume_context_model_json['name'] = 'my-volume' - volume_attachment_volume_prototype_instance_by_volume_context_volume_prototype_instance_by_volume_context_model_json['profile'] = volume_profile_identity_model - volume_attachment_volume_prototype_instance_by_volume_context_volume_prototype_instance_by_volume_context_model_json['source_snapshot'] = snapshot_identity_model - - # Construct a model instance of VolumeAttachmentVolumePrototypeInstanceByVolumeContextVolumePrototypeInstanceByVolumeContext by calling from_dict on the json representation - volume_attachment_volume_prototype_instance_by_volume_context_volume_prototype_instance_by_volume_context_model = VolumeAttachmentVolumePrototypeInstanceByVolumeContextVolumePrototypeInstanceByVolumeContext.from_dict(volume_attachment_volume_prototype_instance_by_volume_context_volume_prototype_instance_by_volume_context_model_json) - assert volume_attachment_volume_prototype_instance_by_volume_context_volume_prototype_instance_by_volume_context_model != False - - # Construct a model instance of VolumeAttachmentVolumePrototypeInstanceByVolumeContextVolumePrototypeInstanceByVolumeContext by calling from_dict on the json representation - volume_attachment_volume_prototype_instance_by_volume_context_volume_prototype_instance_by_volume_context_model_dict = VolumeAttachmentVolumePrototypeInstanceByVolumeContextVolumePrototypeInstanceByVolumeContext.from_dict(volume_attachment_volume_prototype_instance_by_volume_context_volume_prototype_instance_by_volume_context_model_json).__dict__ - volume_attachment_volume_prototype_instance_by_volume_context_volume_prototype_instance_by_volume_context_model2 = VolumeAttachmentVolumePrototypeInstanceByVolumeContextVolumePrototypeInstanceByVolumeContext(**volume_attachment_volume_prototype_instance_by_volume_context_volume_prototype_instance_by_volume_context_model_dict) - - # Verify the model instances are equivalent - assert volume_attachment_volume_prototype_instance_by_volume_context_volume_prototype_instance_by_volume_context_model == volume_attachment_volume_prototype_instance_by_volume_context_volume_prototype_instance_by_volume_context_model2 - - # Convert model instance back to dict and verify no loss of data - volume_attachment_volume_prototype_instance_by_volume_context_volume_prototype_instance_by_volume_context_model_json2 = volume_attachment_volume_prototype_instance_by_volume_context_volume_prototype_instance_by_volume_context_model.to_dict() - assert volume_attachment_volume_prototype_instance_by_volume_context_volume_prototype_instance_by_volume_context_model_json2 == volume_attachment_volume_prototype_instance_by_volume_context_volume_prototype_instance_by_volume_context_model_json - class TestModel_VolumeIdentityByCRN(): """ Test Class for VolumeIdentityByCRN @@ -55760,6 +56961,7 @@ def test_volume_prototype_volume_by_capacity_serialization(self): volume_prototype_volume_by_capacity_model_json['name'] = 'my-volume' volume_prototype_volume_by_capacity_model_json['profile'] = volume_profile_identity_model volume_prototype_volume_by_capacity_model_json['resource_group'] = resource_group_identity_model + volume_prototype_volume_by_capacity_model_json['user_tags'] = ['testString'] volume_prototype_volume_by_capacity_model_json['zone'] = zone_identity_model volume_prototype_volume_by_capacity_model_json['capacity'] = 100 volume_prototype_volume_by_capacity_model_json['encryption_key'] = encryption_key_identity_model @@ -57076,6 +58278,64 @@ def test_load_balancer_pool_member_target_prototype_instance_identity_instance_i load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_id_model_json2 = load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_id_model.to_dict() assert load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_id_model_json2 == load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_id_model_json +class TestModel_NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityByHref(): + """ + Test Class for NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityByHref + """ + + def test_network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_href_serialization(self): + """ + Test serialization/deserialization for NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityByHref + """ + + # Construct a json representation of a NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityByHref model + network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_href_model_json = {} + network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb' + + # Construct a model instance of NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityByHref by calling from_dict on the json representation + network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_href_model = NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityByHref.from_dict(network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_href_model_json) + assert network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_href_model != False + + # Construct a model instance of NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityByHref by calling from_dict on the json representation + network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_href_model_dict = NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityByHref.from_dict(network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_href_model_json).__dict__ + network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_href_model2 = NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityByHref(**network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_href_model_dict) + + # Verify the model instances are equivalent + assert network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_href_model == network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_href_model2 + + # Convert model instance back to dict and verify no loss of data + network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_href_model_json2 = network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_href_model.to_dict() + assert network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_href_model_json2 == network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_href_model_json + +class TestModel_NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityById(): + """ + Test Class for NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityById + """ + + def test_network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_id_serialization(self): + """ + Test serialization/deserialization for NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityById + """ + + # Construct a json representation of a NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityById model + network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_id_model_json = {} + network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_id_model_json['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb' + + # Construct a model instance of NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityById by calling from_dict on the json representation + network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_id_model = NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityById.from_dict(network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_id_model_json) + assert network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_id_model != False + + # Construct a model instance of NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityById by calling from_dict on the json representation + network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_id_model_dict = NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityById.from_dict(network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_id_model_json).__dict__ + network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_id_model2 = NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityById(**network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_id_model_dict) + + # Verify the model instances are equivalent + assert network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_id_model == network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_id_model2 + + # Convert model instance back to dict and verify no loss of data + network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_id_model_json2 = network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_id_model.to_dict() + assert network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_id_model_json2 == network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_id_model_json + class TestModel_PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByAddress(): """ Test Class for PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByAddress @@ -57665,7 +58925,7 @@ def test_volume_attachment_prototype_volume_volume_prototype_instance_context_vo volume_attachment_prototype_volume_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_source_snapshot_model_json['iops'] = 10000 volume_attachment_prototype_volume_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_source_snapshot_model_json['name'] = 'my-volume' volume_attachment_prototype_volume_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_source_snapshot_model_json['profile'] = volume_profile_identity_model - volume_attachment_prototype_volume_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_source_snapshot_model_json['capacity'] = 38 + volume_attachment_prototype_volume_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_source_snapshot_model_json['capacity'] = 100 volume_attachment_prototype_volume_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_source_snapshot_model_json['encryption_key'] = encryption_key_identity_model volume_attachment_prototype_volume_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_source_snapshot_model_json['source_snapshot'] = snapshot_identity_model @@ -57838,7 +59098,7 @@ def test_volume_attachment_volume_prototype_instance_context_volume_prototype_in volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_source_snapshot_model_json['iops'] = 10000 volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_source_snapshot_model_json['name'] = 'my-volume' volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_source_snapshot_model_json['profile'] = volume_profile_identity_model - volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_source_snapshot_model_json['capacity'] = 38 + volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_source_snapshot_model_json['capacity'] = 100 volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_source_snapshot_model_json['encryption_key'] = encryption_key_identity_model volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_source_snapshot_model_json['source_snapshot'] = snapshot_identity_model