diff --git a/ibm_vpc/vpc_v1.py b/ibm_vpc/vpc_v1.py index 535b7c5..b89b1f8 100644 --- a/ibm_vpc/vpc_v1.py +++ b/ibm_vpc/vpc_v1.py @@ -14,14 +14,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -# IBM OpenAPI SDK Code Generator Version: 3.50.0-af9e48c4-20220523-163800 - +# IBM OpenAPI SDK Code Generator Version: 3.57.0-b6d48d21-20220921-194423 + """ The IBM Cloud Virtual Private Cloud (VPC) API can be used to programmatically provision and manage virtual server instances, along with subnets, volumes, load balancers, and more. -API Version: 2022-06-30 +API Version: 2022-09-13 """ from datetime import datetime @@ -31,7 +31,7 @@ import json import sys -from ibm_cloud_sdk_core import BaseService, DetailedResponse +from ibm_cloud_sdk_core import BaseService, DetailedResponse, get_query_param from ibm_cloud_sdk_core.authenticators.authenticator import Authenticator from ibm_cloud_sdk_core.get_authenticator import get_authenticator_from_environment from ibm_cloud_sdk_core.utils import convert_model, datetime_to_string, string_to_datetime @@ -50,7 +50,7 @@ class VpcV1(BaseService): @classmethod def new_instance(cls, - version: str = '2022-06-30', + version: str = '2022-09-13', service_name: str = DEFAULT_SERVICE_NAME, generation: int = 2, ) -> 'VpcV1': @@ -59,7 +59,7 @@ def new_instance(cls, external configuration. :param str version: The API version, in format `YYYY-MM-DD`. For the API - behavior documented here, specify any date between `2022-07-06` and today's + behavior documented here, specify any date between `2022-10-13` and today's date (UTC). """ if version is None: @@ -75,7 +75,7 @@ def new_instance(cls, return service def __init__(self, - version: str = '2022-06-30', + version: str = '2022-09-13', authenticator: Authenticator = None, generation: int = 2, ) -> None: @@ -83,7 +83,7 @@ def __init__(self, Construct a new client for the vpc service. :param str version: The API version, in format `YYYY-MM-DD`. For the API - behavior documented here, specify any date between `2022-07-06` and today's + behavior documented here, specify any date between `2022-10-13` and today's date (UTC). :param Authenticator authenticator: The authenticator specifies the authentication mechanism. @@ -150,6 +150,7 @@ def list_vpcs(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' url = '/vpcs' @@ -224,6 +225,7 @@ def create_vpc(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' url = '/vpcs' @@ -256,7 +258,7 @@ def delete_vpc(self, :rtype: DetailedResponse """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -271,6 +273,7 @@ def delete_vpc(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['id'] path_param_values = self.encode_path_vars(id) @@ -300,7 +303,7 @@ def get_vpc(self, :rtype: DetailedResponse with `dict` result representing a `VPC` object """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -315,6 +318,7 @@ def get_vpc(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -347,7 +351,7 @@ def update_vpc(self, :rtype: DetailedResponse with `dict` result representing a `VPC` object """ - if id is None: + if not id: raise ValueError('id must be provided') if vpc_patch is None: raise ValueError('vpc_patch must be provided') @@ -369,6 +373,7 @@ def update_vpc(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -402,7 +407,7 @@ def get_vpc_default_network_acl(self, :rtype: DetailedResponse with `dict` result representing a `DefaultNetworkACL` object """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -417,6 +422,7 @@ def get_vpc_default_network_acl(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -450,7 +456,7 @@ def get_vpc_default_routing_table(self, :rtype: DetailedResponse with `dict` result representing a `DefaultRoutingTable` object """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -465,6 +471,7 @@ def get_vpc_default_routing_table(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -498,7 +505,7 @@ def get_vpc_default_security_group(self, :rtype: DetailedResponse with `dict` result representing a `DefaultSecurityGroup` object """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -513,6 +520,7 @@ def get_vpc_default_security_group(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -549,7 +557,7 @@ def list_vpc_address_prefixes(self, :rtype: DetailedResponse with `dict` result representing a `AddressPrefixCollection` object """ - if vpc_id is None: + if not vpc_id: raise ValueError('vpc_id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -566,6 +574,7 @@ def list_vpc_address_prefixes(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['vpc_id'] @@ -599,7 +608,7 @@ def create_vpc_address_prefix(self, :param str vpc_id: The VPC identifier. :param str cidr: The IPv4 range of the address prefix, expressed in CIDR - format. The request must not overlap with any existing address prefixes in + format. The range must not overlap with any existing address prefixes in the VPC or any of the following reserved address ranges: - `127.0.0.0/8` (IPv4 loopback addresses) - `161.26.0.0/16` (IBM services) @@ -620,7 +629,7 @@ def create_vpc_address_prefix(self, :rtype: DetailedResponse with `dict` result representing a `AddressPrefix` object """ - if vpc_id is None: + if not vpc_id: raise ValueError('vpc_id must be provided') if cidr is None: raise ValueError('cidr must be provided') @@ -650,6 +659,7 @@ def create_vpc_address_prefix(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['vpc_id'] @@ -684,9 +694,9 @@ def delete_vpc_address_prefix(self, :rtype: DetailedResponse """ - if vpc_id is None: + if not vpc_id: raise ValueError('vpc_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -701,6 +711,7 @@ def delete_vpc_address_prefix(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['vpc_id', 'id'] path_param_values = self.encode_path_vars(vpc_id, id) @@ -732,9 +743,9 @@ def get_vpc_address_prefix(self, :rtype: DetailedResponse with `dict` result representing a `AddressPrefix` object """ - if vpc_id is None: + if not vpc_id: raise ValueError('vpc_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -749,6 +760,7 @@ def get_vpc_address_prefix(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['vpc_id', 'id'] @@ -785,9 +797,9 @@ def update_vpc_address_prefix(self, :rtype: DetailedResponse with `dict` result representing a `AddressPrefix` object """ - if vpc_id is None: + if not vpc_id: raise ValueError('vpc_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') if address_prefix_patch is None: raise ValueError('address_prefix_patch must be provided') @@ -809,6 +821,7 @@ def update_vpc_address_prefix(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['vpc_id', 'id'] @@ -853,7 +866,7 @@ def list_vpc_routes(self, :rtype: DetailedResponse with `dict` result representing a `RouteCollection` object """ - if vpc_id is None: + if not vpc_id: raise ValueError('vpc_id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -871,6 +884,7 @@ def list_vpc_routes(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['vpc_id'] @@ -907,17 +921,15 @@ def create_vpc_route(self, :param str vpc_id: The VPC identifier. :param str destination: The destination of the route. At most two routes per `zone` in a table can have the same destination, and only if both - routes have an `action` of `deliver` and the - `next_hop` is an IP address. + routes have an `action` of `deliver` and the `next_hop` is an IP address. :param ZoneIdentity zone: The zone to apply the route to. (Traffic from subnets in this zone will be subject to this route.). :param str action: (optional) The action to perform with a packet matching the route: - - `delegate`: delegate to the system's built-in routes - - `delegate_vpc`: delegate to the system's built-in routes, ignoring - Internet-bound - routes + - `delegate`: delegate to system-provided routes + - `delegate_vpc`: delegate to system-provided routes, ignoring + Internet-bound routes - `deliver`: deliver the packet to the specified `next_hop` - `drop`: drop the packet. :param str name: (optional) The user-defined name for this route. If @@ -931,7 +943,7 @@ def create_vpc_route(self, :rtype: DetailedResponse with `dict` result representing a `Route` object """ - if vpc_id is None: + if not vpc_id: raise ValueError('vpc_id must be provided') if destination is None: raise ValueError('destination must be provided') @@ -964,6 +976,7 @@ def create_vpc_route(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['vpc_id'] @@ -997,9 +1010,9 @@ def delete_vpc_route(self, :rtype: DetailedResponse """ - if vpc_id is None: + if not vpc_id: raise ValueError('vpc_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -1014,6 +1027,7 @@ def delete_vpc_route(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['vpc_id', 'id'] path_param_values = self.encode_path_vars(vpc_id, id) @@ -1045,9 +1059,9 @@ def get_vpc_route(self, :rtype: DetailedResponse with `dict` result representing a `Route` object """ - if vpc_id is None: + if not vpc_id: raise ValueError('vpc_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -1062,6 +1076,7 @@ def get_vpc_route(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['vpc_id', 'id'] @@ -1098,9 +1113,9 @@ def update_vpc_route(self, :rtype: DetailedResponse with `dict` result representing a `Route` object """ - if vpc_id is None: + if not vpc_id: raise ValueError('vpc_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') if route_patch is None: raise ValueError('route_patch must be provided') @@ -1122,6 +1137,7 @@ def update_vpc_route(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['vpc_id', 'id'] @@ -1167,7 +1183,7 @@ def list_vpc_routing_tables(self, :rtype: DetailedResponse with `dict` result representing a `RoutingTableCollection` object """ - if vpc_id is None: + if not vpc_id: raise ValueError('vpc_id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -1185,6 +1201,7 @@ def list_vpc_routing_tables(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['vpc_id'] @@ -1206,6 +1223,7 @@ def create_vpc_routing_table(self, accept_routes_from: List['ResourceFilter'] = None, name: str = None, route_direct_link_ingress: bool = None, + route_internet_ingress: bool = None, route_transit_gateway_ingress: bool = None, route_vpc_zone_ingress: bool = None, routes: List['RoutePrototype'] = None, @@ -1229,33 +1247,49 @@ def create_vpc_routing_table(self, unspecified, the name will be a hyphenated list of randomly-selected words. :param bool route_direct_link_ingress: (optional) If set to `true`, this routing table will be used to route traffic that originates from [Direct - Link](https://cloud.ibm.com/docs/dl/) to this VPC. For this to succeed, the - VPC must not already have a routing table with this property set to `true`. + Link](https://cloud.ibm.com/docs/dl) to this VPC. The 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 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 + traffic will also be routed according to this routing table. + :param bool route_internet_ingress: (optional) If set to `true`, this + routing table will be used to route traffic that originates from the + internet. For this to succeed, the 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 two + exceptions: + - Traffic destined for IP addresses associated with public gateways will + not be + subject to routes in this routing table. + - Routes with an action of deliver are treated as drop 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 - VPC. For this to succeed, the VPC must not already have a routing table - with this property set to `true`. + [Transit Gateway](https://cloud.ibm.com/docs/transit-gateway) to this VPC. + The 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 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 - traffic will also be routed according to this routing table. :param bool route_vpc_zone_ingress: (optional) If set to `true`, this routing table will be used to route traffic that originates from subnets in - other zones in this VPC. For this to succeed, the VPC must not already have - a routing table with this property set to `true`. + other zones in this VPC. The 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 @@ -1270,7 +1304,7 @@ def create_vpc_routing_table(self, :rtype: DetailedResponse with `dict` result representing a `RoutingTable` object """ - if vpc_id is None: + if not vpc_id: raise ValueError('vpc_id must be provided') if accept_routes_from is not None: accept_routes_from = [convert_model(x) for x in accept_routes_from] @@ -1291,6 +1325,7 @@ def create_vpc_routing_table(self, 'accept_routes_from': accept_routes_from, 'name': name, 'route_direct_link_ingress': route_direct_link_ingress, + 'route_internet_ingress': route_internet_ingress, 'route_transit_gateway_ingress': route_transit_gateway_ingress, 'route_vpc_zone_ingress': route_vpc_zone_ingress, 'routes': routes @@ -1301,6 +1336,7 @@ def create_vpc_routing_table(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['vpc_id'] @@ -1340,9 +1376,9 @@ def delete_vpc_routing_table(self, :rtype: DetailedResponse """ - if vpc_id is None: + if not vpc_id: raise ValueError('vpc_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = { 'If-Match': if_match @@ -1359,6 +1395,7 @@ def delete_vpc_routing_table(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['vpc_id', 'id'] path_param_values = self.encode_path_vars(vpc_id, id) @@ -1391,9 +1428,9 @@ def get_vpc_routing_table(self, :rtype: DetailedResponse with `dict` result representing a `RoutingTable` object """ - if vpc_id is None: + if not vpc_id: raise ValueError('vpc_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -1408,6 +1445,7 @@ def get_vpc_routing_table(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['vpc_id', 'id'] @@ -1449,9 +1487,9 @@ def update_vpc_routing_table(self, :rtype: DetailedResponse with `dict` result representing a `RoutingTable` object """ - if vpc_id is None: + if not vpc_id: raise ValueError('vpc_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') if routing_table_patch is None: raise ValueError('routing_table_patch must be provided') @@ -1475,6 +1513,7 @@ def update_vpc_routing_table(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['vpc_id', 'id'] @@ -1519,9 +1558,9 @@ def list_vpc_routing_table_routes(self, :rtype: DetailedResponse with `dict` result representing a `RouteCollection` object """ - if vpc_id is None: + if not vpc_id: raise ValueError('vpc_id must be provided') - if routing_table_id is None: + if not routing_table_id: raise ValueError('routing_table_id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -1538,6 +1577,7 @@ def list_vpc_routing_table_routes(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['vpc_id', 'routing_table_id'] @@ -1575,17 +1615,15 @@ def create_vpc_routing_table_route(self, :param str routing_table_id: The routing table identifier. :param str destination: The destination of the route. At most two routes per `zone` in a table can have the same destination, and only if both - routes have an `action` of `deliver` and the - `next_hop` is an IP address. + routes have an `action` of `deliver` and the `next_hop` is an IP address. :param ZoneIdentity zone: The zone to apply the route to. (Traffic from subnets in this zone will be subject to this route.). :param str action: (optional) The action to perform with a packet matching the route: - - `delegate`: delegate to the system's built-in routes - - `delegate_vpc`: delegate to the system's built-in routes, ignoring - Internet-bound - routes + - `delegate`: delegate to system-provided routes + - `delegate_vpc`: delegate to system-provided routes, ignoring + Internet-bound routes - `deliver`: deliver the packet to the specified `next_hop` - `drop`: drop the packet. :param str name: (optional) The user-defined name for this route. If @@ -1599,9 +1637,9 @@ def create_vpc_routing_table_route(self, :rtype: DetailedResponse with `dict` result representing a `Route` object """ - if vpc_id is None: + if not vpc_id: raise ValueError('vpc_id must be provided') - if routing_table_id is None: + if not routing_table_id: raise ValueError('routing_table_id must be provided') if destination is None: raise ValueError('destination must be provided') @@ -1634,6 +1672,7 @@ def create_vpc_routing_table_route(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['vpc_id', 'routing_table_id'] @@ -1659,7 +1698,8 @@ def delete_vpc_routing_table_route(self, """ Delete a VPC routing table route. - This request deletes a VPC route. This operation cannot be reversed. + This request deletes a VPC route. This operation cannot be reversed. Only VPC + routes with an `origin` of `user` are allowed to be deleted. :param str vpc_id: The VPC identifier. :param str routing_table_id: The routing table identifier. @@ -1669,11 +1709,11 @@ def delete_vpc_routing_table_route(self, :rtype: DetailedResponse """ - if vpc_id is None: + if not vpc_id: raise ValueError('vpc_id must be provided') - if routing_table_id is None: + if not routing_table_id: raise ValueError('routing_table_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -1688,6 +1728,7 @@ def delete_vpc_routing_table_route(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['vpc_id', 'routing_table_id', 'id'] path_param_values = self.encode_path_vars(vpc_id, routing_table_id, id) @@ -1722,11 +1763,11 @@ def get_vpc_routing_table_route(self, :rtype: DetailedResponse with `dict` result representing a `Route` object """ - if vpc_id is None: + if not vpc_id: raise ValueError('vpc_id must be provided') - if routing_table_id is None: + if not routing_table_id: raise ValueError('routing_table_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -1741,6 +1782,7 @@ def get_vpc_routing_table_route(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['vpc_id', 'routing_table_id', 'id'] @@ -1768,7 +1810,8 @@ def update_vpc_routing_table_route(self, This request updates a VPC route with the information provided in a route patch object. The patch object is structured in the same way as a retrieved VPC route - and needs to contain only the information to be updated. + and needs to contain only the information to be updated. Only VPC routes with an + `origin` of `user` are allowed to be updated. :param str vpc_id: The VPC identifier. :param str routing_table_id: The routing table identifier. @@ -1779,11 +1822,11 @@ def update_vpc_routing_table_route(self, :rtype: DetailedResponse with `dict` result representing a `Route` object """ - if vpc_id is None: + if not vpc_id: raise ValueError('vpc_id must be provided') - if routing_table_id is None: + if not routing_table_id: raise ValueError('routing_table_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') if route_patch is None: raise ValueError('route_patch must be provided') @@ -1805,6 +1848,7 @@ def update_vpc_routing_table_route(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['vpc_id', 'routing_table_id', 'id'] @@ -1873,6 +1917,7 @@ def list_subnets(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' url = '/subnets' @@ -1923,6 +1968,7 @@ def create_subnet(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' url = '/subnets' @@ -1956,7 +2002,7 @@ def delete_subnet(self, :rtype: DetailedResponse """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -1971,6 +2017,7 @@ def delete_subnet(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['id'] path_param_values = self.encode_path_vars(id) @@ -2000,7 +2047,7 @@ def get_subnet(self, :rtype: DetailedResponse with `dict` result representing a `Subnet` object """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -2015,6 +2062,7 @@ def get_subnet(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -2049,7 +2097,7 @@ def update_subnet(self, :rtype: DetailedResponse with `dict` result representing a `Subnet` object """ - if id is None: + if not id: raise ValueError('id must be provided') if subnet_patch is None: raise ValueError('subnet_patch must be provided') @@ -2071,6 +2119,7 @@ def update_subnet(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -2103,7 +2152,7 @@ def get_subnet_network_acl(self, :rtype: DetailedResponse with `dict` result representing a `NetworkACL` object """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -2118,6 +2167,7 @@ def get_subnet_network_acl(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -2139,11 +2189,10 @@ def replace_subnet_network_acl(self, **kwargs ) -> DetailedResponse: """ - Attach a network ACL to a subnet. + Replace the network ACL for a subnet. - This request attaches the network ACL, specified in the request body, to the - subnet specified by the subnet identifier in the URL. This replaces the existing - network ACL on the subnet. + This request replaces the existing network ACL for a subnet with the network ACL + specified in the request body. :param str id: The subnet identifier. :param NetworkACLIdentity network_acl_identity: The network ACL identity. @@ -2152,7 +2201,7 @@ def replace_subnet_network_acl(self, :rtype: DetailedResponse with `dict` result representing a `NetworkACL` object """ - if id is None: + if not id: raise ValueError('id must be provided') if network_acl_identity is None: raise ValueError('network_acl_identity must be provided') @@ -2174,6 +2223,7 @@ def replace_subnet_network_acl(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -2206,7 +2256,7 @@ def unset_subnet_public_gateway(self, :rtype: DetailedResponse """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -2221,6 +2271,7 @@ def unset_subnet_public_gateway(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['id'] path_param_values = self.encode_path_vars(id) @@ -2251,7 +2302,7 @@ def get_subnet_public_gateway(self, :rtype: DetailedResponse with `dict` result representing a `PublicGateway` object """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -2266,6 +2317,7 @@ def get_subnet_public_gateway(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -2301,7 +2353,7 @@ def set_subnet_public_gateway(self, :rtype: DetailedResponse with `dict` result representing a `PublicGateway` object """ - if id is None: + if not id: raise ValueError('id must be provided') if public_gateway_identity is None: raise ValueError('public_gateway_identity must be provided') @@ -2323,6 +2375,7 @@ def set_subnet_public_gateway(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -2355,7 +2408,7 @@ def get_subnet_routing_table(self, :rtype: DetailedResponse with `dict` result representing a `RoutingTable` object """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -2370,6 +2423,7 @@ def get_subnet_routing_table(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -2391,11 +2445,10 @@ def replace_subnet_routing_table(self, **kwargs ) -> DetailedResponse: """ - Attach a routing table to a subnet. + Replace the routing table for a subnet. - This request attaches the routing table, specified in the request body, to the - subnet specified by the subnet identifier in the URL. This replaces the existing - routing table on the subnet. + This request replaces the existing routing table for a subnet with the routing + table specified in the request body. For this request to succeed, the routing table `route_direct_link_ingress`, `route_transit_gateway_ingress`, and `route_vpc_zone_ingress` properties must be `false`. @@ -2408,7 +2461,7 @@ def replace_subnet_routing_table(self, :rtype: DetailedResponse with `dict` result representing a `RoutingTable` object """ - if id is None: + if not id: raise ValueError('id must be provided') if routing_table_identity is None: raise ValueError('routing_table_identity must be provided') @@ -2430,6 +2483,7 @@ def replace_subnet_routing_table(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -2474,7 +2528,7 @@ def list_subnet_reserved_ips(self, :rtype: DetailedResponse with `dict` result representing a `ReservedIPCollection` object """ - if subnet_id is None: + if not subnet_id: raise ValueError('subnet_id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -2492,6 +2546,7 @@ def list_subnet_reserved_ips(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['subnet_id'] @@ -2535,15 +2590,18 @@ def create_subnet_reserved_ip(self, 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. - :param ReservedIPTargetPrototype target: (optional) The target this - reserved IP is to be bound to. The target must be an endpoint gateway not - already bound to a reserved IP in the subnet's zone. + :param ReservedIPTargetPrototype target: (optional) The target to bind this + reserved IP to. The target must be in the same VPC. + At present, only endpoint gateway targets are supported. The endpoint + gateway must + not be already bound to a reserved IP in the subnet's zone. + If unspecified, the reserved IP will be created unbound. :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 subnet_id is None: + if not subnet_id: raise ValueError('subnet_id must be provided') if target is not None: target = convert_model(target) @@ -2570,6 +2628,7 @@ def create_subnet_reserved_ip(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['subnet_id'] @@ -2595,6 +2654,9 @@ def delete_subnet_reserved_ip(self, Delete a reserved IP. This request releases a reserved IP. This operation cannot be reversed. + For this request to succeed, the reserved IP must not be required by another + resource, such as a network interface for which it is the primary IP. A + provider-owned reserved IP is not allowed to be deleted. :param str subnet_id: The subnet identifier. :param str id: The reserved IP identifier. @@ -2603,9 +2665,9 @@ def delete_subnet_reserved_ip(self, :rtype: DetailedResponse """ - if subnet_id is None: + if not subnet_id: raise ValueError('subnet_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -2620,6 +2682,7 @@ def delete_subnet_reserved_ip(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['subnet_id', 'id'] path_param_values = self.encode_path_vars(subnet_id, id) @@ -2652,9 +2715,9 @@ def get_subnet_reserved_ip(self, :rtype: DetailedResponse with `dict` result representing a `ReservedIP` object """ - if subnet_id is None: + if not subnet_id: raise ValueError('subnet_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -2669,6 +2732,7 @@ def get_subnet_reserved_ip(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['subnet_id', 'id'] @@ -2696,6 +2760,7 @@ def update_subnet_reserved_ip(self, This request updates a reserved IP with the information in a provided reserved IP patch. The reserved IP patch object is structured in the same way as a retrieved reserved IP and contains only the information to be updated. + A provider-owned reserved IP is not allowed to be updated. :param str subnet_id: The subnet identifier. :param str id: The reserved IP identifier. @@ -2705,9 +2770,9 @@ def update_subnet_reserved_ip(self, :rtype: DetailedResponse with `dict` result representing a `ReservedIP` object """ - if subnet_id is None: + if not subnet_id: raise ValueError('subnet_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') if reserved_ip_patch is None: raise ValueError('reserved_ip_patch must be provided') @@ -2729,6 +2794,7 @@ def update_subnet_reserved_ip(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['subnet_id', 'id'] @@ -2763,7 +2829,7 @@ def list_images(self, This request lists all images available in the region. An image provides source data for a volume. Images are either system-provided, or created from another - source, such as importing from object storage. + source, such as importing from Cloud Object Storage. The images will be sorted by their `created_at` property values, with the newest first. Images with identical `created_at` values will be secondarily sorted by ascending `id` property values. @@ -2800,6 +2866,7 @@ def list_images(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' url = '/images' @@ -2851,6 +2918,7 @@ def create_image(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' url = '/images' @@ -2874,9 +2942,10 @@ def delete_image(self, This request deletes an image. This operation cannot be reversed. A system-provided image is not allowed to be deleted. Additionally, an image cannot be deleted if it: - - has a `status` of `tentative` or `deleting` + - has a `status` of `deleting` - has a `status` of `pending` with a `status_reasons` code of - `image_request_in_progress`. + `image_request_in_progress` + - has `catalog_offering.managed` set to `true`. :param str id: The image identifier. :param dict headers: A `dict` containing the request headers @@ -2884,7 +2953,7 @@ def delete_image(self, :rtype: DetailedResponse """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -2899,6 +2968,7 @@ def delete_image(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['id'] path_param_values = self.encode_path_vars(id) @@ -2928,7 +2998,7 @@ def get_image(self, :rtype: DetailedResponse with `dict` result representing a `Image` object """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -2943,6 +3013,7 @@ def get_image(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -2978,7 +3049,7 @@ def update_image(self, :rtype: DetailedResponse with `dict` result representing a `Image` object """ - if id is None: + if not id: raise ValueError('id must be provided') if image_patch is None: raise ValueError('image_patch must be provided') @@ -3000,6 +3071,7 @@ def update_image(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -3050,6 +3122,7 @@ def list_operating_systems(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' url = '/operating_systems' @@ -3077,7 +3150,7 @@ def get_operating_system(self, :rtype: DetailedResponse with `dict` result representing a `OperatingSystem` object """ - if name is None: + if not name: raise ValueError('name must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -3092,6 +3165,7 @@ def get_operating_system(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['name'] @@ -3146,6 +3220,7 @@ def list_keys(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' url = '/keys' @@ -3217,6 +3292,7 @@ def create_key(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' url = '/keys' @@ -3245,7 +3321,7 @@ def delete_key(self, :rtype: DetailedResponse """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -3260,6 +3336,7 @@ def delete_key(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['id'] path_param_values = self.encode_path_vars(id) @@ -3289,7 +3366,7 @@ def get_key(self, :rtype: DetailedResponse with `dict` result representing a `Key` object """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -3304,6 +3381,7 @@ def get_key(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -3336,7 +3414,7 @@ def update_key(self, :rtype: DetailedResponse with `dict` result representing a `Key` object """ - if id is None: + if not id: raise ValueError('id must be provided') if key_patch is None: raise ValueError('key_patch must be provided') @@ -3358,6 +3436,7 @@ def update_key(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -3384,9 +3463,10 @@ def list_instance_profiles(self, """ List all instance profiles. - This request lists provisionable instance profiles in the region. An instance - profile specifies the performance characteristics and pricing model for an - instance. + This request lists provisionable [instance + profiles](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) in the region. An + instance profile specifies the performance characteristics and pricing model for + an instance. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. @@ -3406,6 +3486,7 @@ def list_instance_profiles(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' url = '/instance/profiles' @@ -3433,7 +3514,7 @@ def get_instance_profile(self, :rtype: DetailedResponse with `dict` result representing a `InstanceProfile` object """ - if name is None: + if not name: raise ValueError('name must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -3448,6 +3529,7 @@ def get_instance_profile(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['name'] @@ -3489,6 +3571,7 @@ def list_instance_templates(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' url = '/instance/templates' @@ -3542,6 +3625,7 @@ def create_instance_template(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' url = '/instance/templates' @@ -3570,7 +3654,7 @@ def delete_instance_template(self, :rtype: DetailedResponse """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -3585,6 +3669,7 @@ def delete_instance_template(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['id'] path_param_values = self.encode_path_vars(id) @@ -3615,7 +3700,7 @@ def get_instance_template(self, :rtype: DetailedResponse with `dict` result representing a `InstanceTemplate` object """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -3630,6 +3715,7 @@ def get_instance_template(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -3666,7 +3752,7 @@ def update_instance_template(self, :rtype: DetailedResponse with `dict` result representing a `InstanceTemplate` object """ - if id is None: + if not id: raise ValueError('id must be provided') if instance_template_patch is None: raise ValueError('instance_template_patch must be provided') @@ -3688,6 +3774,7 @@ def update_instance_template(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -3782,6 +3869,7 @@ def list_instances(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' url = '/instances' @@ -3832,6 +3920,7 @@ def create_instance(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' url = '/instances' @@ -3863,7 +3952,7 @@ def delete_instance(self, :rtype: DetailedResponse """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -3878,6 +3967,7 @@ def delete_instance(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['id'] path_param_values = self.encode_path_vars(id) @@ -3907,7 +3997,7 @@ def get_instance(self, :rtype: DetailedResponse with `dict` result representing a `Instance` object """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -3922,6 +4012,7 @@ def get_instance(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -3956,7 +4047,7 @@ def update_instance(self, :rtype: DetailedResponse with `dict` result representing a `Instance` object """ - if id is None: + if not id: raise ValueError('id must be provided') if instance_patch is None: raise ValueError('instance_patch must be provided') @@ -3978,6 +4069,7 @@ def update_instance(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -4010,7 +4102,7 @@ def get_instance_initialization(self, :rtype: DetailedResponse with `dict` result representing a `InstanceInitialization` object """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -4025,6 +4117,7 @@ def get_instance_initialization(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -4062,7 +4155,7 @@ def create_instance_action(self, :rtype: DetailedResponse with `dict` result representing a `InstanceAction` object """ - if instance_id is None: + if not instance_id: raise ValueError('instance_id must be provided') if type is None: raise ValueError('type must be provided') @@ -4087,6 +4180,7 @@ def create_instance_action(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['instance_id'] @@ -4130,7 +4224,7 @@ def create_instance_console_access_token(self, :rtype: DetailedResponse with `dict` result representing a `InstanceConsoleAccessToken` object """ - if instance_id is None: + if not instance_id: raise ValueError('instance_id must be provided') if console_type is None: raise ValueError('console_type must be provided') @@ -4155,6 +4249,7 @@ def create_instance_console_access_token(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['instance_id'] @@ -4189,7 +4284,7 @@ def list_instance_disks(self, :rtype: DetailedResponse with `dict` result representing a `InstanceDiskCollection` object """ - if instance_id is None: + if not instance_id: raise ValueError('instance_id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -4204,6 +4299,7 @@ def list_instance_disks(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['instance_id'] @@ -4237,9 +4333,9 @@ def get_instance_disk(self, :rtype: DetailedResponse with `dict` result representing a `InstanceDisk` object """ - if instance_id is None: + if not instance_id: raise ValueError('instance_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -4254,6 +4350,7 @@ def get_instance_disk(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['instance_id', 'id'] @@ -4288,9 +4385,9 @@ def update_instance_disk(self, :rtype: DetailedResponse with `dict` result representing a `InstanceDisk` object """ - if instance_id is None: + if not instance_id: raise ValueError('instance_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') if instance_disk_patch is None: raise ValueError('instance_disk_patch must be provided') @@ -4312,6 +4409,7 @@ def update_instance_disk(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['instance_id', 'id'] @@ -4347,7 +4445,7 @@ def list_instance_network_interfaces(self, :rtype: DetailedResponse with `dict` result representing a `NetworkInterfaceUnpaginatedCollection` object """ - if instance_id is None: + if not instance_id: raise ValueError('instance_id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -4362,6 +4460,7 @@ def list_instance_network_interfaces(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['instance_id'] @@ -4423,7 +4522,7 @@ def create_instance_network_interface(self, :rtype: DetailedResponse with `dict` result representing a `NetworkInterface` object """ - if instance_id is None: + if not instance_id: raise ValueError('instance_id must be provided') if subnet is None: raise ValueError('subnet must be provided') @@ -4456,6 +4555,7 @@ def create_instance_network_interface(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['instance_id'] @@ -4493,9 +4593,9 @@ def delete_instance_network_interface(self, :rtype: DetailedResponse """ - if instance_id is None: + if not instance_id: raise ValueError('instance_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -4510,6 +4610,7 @@ def delete_instance_network_interface(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['instance_id', 'id'] path_param_values = self.encode_path_vars(instance_id, id) @@ -4542,9 +4643,9 @@ def get_instance_network_interface(self, :rtype: DetailedResponse with `dict` result representing a `NetworkInterface` object """ - if instance_id is None: + if not instance_id: raise ValueError('instance_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -4559,6 +4660,7 @@ def get_instance_network_interface(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['instance_id', 'id'] @@ -4597,9 +4699,9 @@ def update_instance_network_interface(self, :rtype: DetailedResponse with `dict` result representing a `NetworkInterface` object """ - if instance_id is None: + if not instance_id: raise ValueError('instance_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') if network_interface_patch is None: raise ValueError('network_interface_patch must be provided') @@ -4621,6 +4723,7 @@ def update_instance_network_interface(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['instance_id', 'id'] @@ -4654,9 +4757,9 @@ def list_instance_network_interface_floating_ips(self, :rtype: DetailedResponse with `dict` result representing a `FloatingIPUnpaginatedCollection` object """ - if instance_id is None: + if not instance_id: raise ValueError('instance_id must be provided') - if network_interface_id is None: + if not network_interface_id: raise ValueError('network_interface_id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -4671,6 +4774,7 @@ def list_instance_network_interface_floating_ips(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['instance_id', 'network_interface_id'] @@ -4706,11 +4810,11 @@ def remove_instance_network_interface_floating_ip(self, :rtype: DetailedResponse """ - if instance_id is None: + if not instance_id: raise ValueError('instance_id must be provided') - if network_interface_id is None: + if not network_interface_id: raise ValueError('network_interface_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -4725,6 +4829,7 @@ def remove_instance_network_interface_floating_ip(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['instance_id', 'network_interface_id', 'id'] path_param_values = self.encode_path_vars(instance_id, network_interface_id, id) @@ -4759,11 +4864,11 @@ def get_instance_network_interface_floating_ip(self, :rtype: DetailedResponse with `dict` result representing a `FloatingIP` object """ - if instance_id is None: + if not instance_id: raise ValueError('instance_id must be provided') - if network_interface_id is None: + if not network_interface_id: raise ValueError('network_interface_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -4778,6 +4883,7 @@ def get_instance_network_interface_floating_ip(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['instance_id', 'network_interface_id', 'id'] @@ -4815,11 +4921,11 @@ def add_instance_network_interface_floating_ip(self, :rtype: DetailedResponse with `dict` result representing a `FloatingIP` object """ - if instance_id is None: + if not instance_id: raise ValueError('instance_id must be provided') - if network_interface_id is None: + if not network_interface_id: raise ValueError('network_interface_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -4834,6 +4940,7 @@ def add_instance_network_interface_floating_ip(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['instance_id', 'network_interface_id', 'id'] @@ -4872,9 +4979,9 @@ def list_instance_network_interface_ips(self, :rtype: DetailedResponse with `dict` result representing a `ReservedIPCollectionNetworkInterfaceContext` object """ - if instance_id is None: + if not instance_id: raise ValueError('instance_id must be provided') - if network_interface_id is None: + if not network_interface_id: raise ValueError('network_interface_id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -4891,6 +4998,7 @@ def list_instance_network_interface_ips(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['instance_id', 'network_interface_id'] @@ -4926,11 +5034,11 @@ def get_instance_network_interface_ip(self, :rtype: DetailedResponse with `dict` result representing a `ReservedIP` object """ - if instance_id is None: + if not instance_id: raise ValueError('instance_id must be provided') - if network_interface_id is None: + if not network_interface_id: raise ValueError('network_interface_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -4945,6 +5053,7 @@ def get_instance_network_interface_ip(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['instance_id', 'network_interface_id', 'id'] @@ -4977,7 +5086,7 @@ def list_instance_volume_attachments(self, :rtype: DetailedResponse with `dict` result representing a `VolumeAttachmentCollection` object """ - if instance_id is None: + if not instance_id: raise ValueError('instance_id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -4992,6 +5101,7 @@ def list_instance_volume_attachments(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['instance_id'] @@ -5038,7 +5148,7 @@ def create_instance_volume_attachment(self, :rtype: DetailedResponse with `dict` result representing a `VolumeAttachment` object """ - if instance_id is None: + if not instance_id: raise ValueError('instance_id must be provided') if volume is None: raise ValueError('volume must be provided') @@ -5065,6 +5175,7 @@ def create_instance_volume_attachment(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['instance_id'] @@ -5100,9 +5211,9 @@ def delete_instance_volume_attachment(self, :rtype: DetailedResponse """ - if instance_id is None: + if not instance_id: raise ValueError('instance_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -5117,6 +5228,7 @@ def delete_instance_volume_attachment(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['instance_id', 'id'] path_param_values = self.encode_path_vars(instance_id, id) @@ -5149,9 +5261,9 @@ def get_instance_volume_attachment(self, :rtype: DetailedResponse with `dict` result representing a `VolumeAttachment` object """ - if instance_id is None: + if not instance_id: raise ValueError('instance_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -5166,6 +5278,7 @@ def get_instance_volume_attachment(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['instance_id', 'id'] @@ -5204,9 +5317,9 @@ def update_instance_volume_attachment(self, :rtype: DetailedResponse with `dict` result representing a `VolumeAttachment` object """ - if instance_id is None: + if not instance_id: raise ValueError('instance_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') if volume_attachment_patch is None: raise ValueError('volume_attachment_patch must be provided') @@ -5228,6 +5341,7 @@ def update_instance_volume_attachment(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['instance_id', 'id'] @@ -5282,6 +5396,7 @@ def list_instance_groups(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' url = '/instance_groups' @@ -5318,18 +5433,22 @@ def create_instance_group(self, `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 - balancer pool only. Used by the instance group when scaling up instances to - supply the port for the load balancer pool member. + :param int application_port: (optional) The port to use for new load + balancer pool members created by this instance group. + This property must be specified if and only if `load_balancer_pool` has + been specified. :param LoadBalancerIdentity load_balancer: (optional) The load balancer - associated with the specified load balancer pool. - Required if `load_balancer_pool` is specified. + associated with `load_balancer_pool`. + This property must be specified if and only if `load_balancer_pool` has + been + specified. At present, only load balancers in the `application` family are supported. :param LoadBalancerPoolIdentity load_balancer_pool: (optional) If - specified, the load balancer pool will be managed by this - group. Instances created by this group will have a new load - balancer pool member in that pool created. Must be used with - `application_port`. + specified, the load balancer pool this instance group will manage. A pool + member + will be created for each instance created by this group. + If specified, `load_balancer` and `application_port` must also be + specified. :param int membership_count: (optional) The number of instances in the instance group. :param str name: (optional) The unique user-defined name for this instance @@ -5383,6 +5502,7 @@ def create_instance_group(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' url = '/instance_groups' @@ -5412,7 +5532,7 @@ def delete_instance_group(self, :rtype: DetailedResponse """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -5427,6 +5547,7 @@ def delete_instance_group(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['id'] path_param_values = self.encode_path_vars(id) @@ -5456,7 +5577,7 @@ def get_instance_group(self, :rtype: DetailedResponse with `dict` result representing a `InstanceGroup` object """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -5471,6 +5592,7 @@ def get_instance_group(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -5505,7 +5627,7 @@ def update_instance_group(self, :rtype: DetailedResponse with `dict` result representing a `InstanceGroup` object """ - if id is None: + if not id: raise ValueError('id must be provided') if instance_group_patch is None: raise ValueError('instance_group_patch must be provided') @@ -5527,6 +5649,7 @@ def update_instance_group(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -5559,7 +5682,7 @@ def delete_instance_group_load_balancer(self, :rtype: DetailedResponse """ - if instance_group_id is None: + if not instance_group_id: raise ValueError('instance_group_id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -5574,6 +5697,7 @@ def delete_instance_group_load_balancer(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['instance_group_id'] path_param_values = self.encode_path_vars(instance_group_id) @@ -5609,7 +5733,7 @@ def list_instance_group_managers(self, :rtype: DetailedResponse with `dict` result representing a `InstanceGroupManagerCollection` object """ - if instance_group_id is None: + if not instance_group_id: raise ValueError('instance_group_id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -5626,6 +5750,7 @@ def list_instance_group_managers(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['instance_group_id'] @@ -5659,7 +5784,7 @@ def create_instance_group_manager(self, :rtype: DetailedResponse with `dict` result representing a `InstanceGroupManager` object """ - if instance_group_id is None: + if not instance_group_id: raise ValueError('instance_group_id must be provided') if instance_group_manager_prototype is None: raise ValueError('instance_group_manager_prototype must be provided') @@ -5681,6 +5806,7 @@ def create_instance_group_manager(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['instance_group_id'] @@ -5714,9 +5840,9 @@ def delete_instance_group_manager(self, :rtype: DetailedResponse """ - if instance_group_id is None: + if not instance_group_id: raise ValueError('instance_group_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -5731,6 +5857,7 @@ def delete_instance_group_manager(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['instance_group_id', 'id'] path_param_values = self.encode_path_vars(instance_group_id, id) @@ -5763,9 +5890,9 @@ def get_instance_group_manager(self, :rtype: DetailedResponse with `dict` result representing a `InstanceGroupManager` object """ - if instance_group_id is None: + if not instance_group_id: raise ValueError('instance_group_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -5780,6 +5907,7 @@ def get_instance_group_manager(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['instance_group_id', 'id'] @@ -5816,9 +5944,9 @@ def update_instance_group_manager(self, :rtype: DetailedResponse with `dict` result representing a `InstanceGroupManager` object """ - if instance_group_id is None: + if not instance_group_id: raise ValueError('instance_group_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') if instance_group_manager_patch is None: raise ValueError('instance_group_manager_patch must be provided') @@ -5840,6 +5968,7 @@ def update_instance_group_manager(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['instance_group_id', 'id'] @@ -5880,9 +6009,9 @@ def list_instance_group_manager_actions(self, :rtype: DetailedResponse with `dict` result representing a `InstanceGroupManagerActionsCollection` object """ - if instance_group_id is None: + if not instance_group_id: raise ValueError('instance_group_id must be provided') - if instance_group_manager_id is None: + if not instance_group_manager_id: raise ValueError('instance_group_manager_id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -5899,6 +6028,7 @@ def list_instance_group_manager_actions(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['instance_group_id', 'instance_group_manager_id'] @@ -5936,9 +6066,9 @@ def create_instance_group_manager_action(self, :rtype: DetailedResponse with `dict` result representing a `InstanceGroupManagerAction` object """ - if instance_group_id is None: + if not instance_group_id: raise ValueError('instance_group_id must be provided') - if instance_group_manager_id is None: + if not instance_group_manager_id: raise ValueError('instance_group_manager_id must be provided') if instance_group_manager_action_prototype is None: raise ValueError('instance_group_manager_action_prototype must be provided') @@ -5960,6 +6090,7 @@ def create_instance_group_manager_action(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['instance_group_id', 'instance_group_manager_id'] @@ -5997,11 +6128,11 @@ def delete_instance_group_manager_action(self, :rtype: DetailedResponse """ - if instance_group_id is None: + if not instance_group_id: raise ValueError('instance_group_id must be provided') - if instance_group_manager_id is None: + if not instance_group_manager_id: raise ValueError('instance_group_manager_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -6016,6 +6147,7 @@ def delete_instance_group_manager_action(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['instance_group_id', 'instance_group_manager_id', 'id'] path_param_values = self.encode_path_vars(instance_group_id, instance_group_manager_id, id) @@ -6051,11 +6183,11 @@ def get_instance_group_manager_action(self, :rtype: DetailedResponse with `dict` result representing a `InstanceGroupManagerAction` object """ - if instance_group_id is None: + if not instance_group_id: raise ValueError('instance_group_id must be provided') - if instance_group_manager_id is None: + if not instance_group_manager_id: raise ValueError('instance_group_manager_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -6070,6 +6202,7 @@ def get_instance_group_manager_action(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['instance_group_id', 'instance_group_manager_id', 'id'] @@ -6108,11 +6241,11 @@ def update_instance_group_manager_action(self, :rtype: DetailedResponse with `dict` result representing a `InstanceGroupManagerAction` object """ - if instance_group_id is None: + if not instance_group_id: raise ValueError('instance_group_id must be provided') - if instance_group_manager_id is None: + if not instance_group_manager_id: raise ValueError('instance_group_manager_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') if instance_group_manager_action_patch is None: raise ValueError('instance_group_manager_action_patch must be provided') @@ -6134,6 +6267,7 @@ def update_instance_group_manager_action(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['instance_group_id', 'instance_group_manager_id', 'id'] @@ -6174,9 +6308,9 @@ def list_instance_group_manager_policies(self, :rtype: DetailedResponse with `dict` result representing a `InstanceGroupManagerPolicyCollection` object """ - if instance_group_id is None: + if not instance_group_id: raise ValueError('instance_group_id must be provided') - if instance_group_manager_id is None: + if not instance_group_manager_id: raise ValueError('instance_group_manager_id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -6193,6 +6327,7 @@ def list_instance_group_manager_policies(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['instance_group_id', 'instance_group_manager_id'] @@ -6230,9 +6365,9 @@ def create_instance_group_manager_policy(self, :rtype: DetailedResponse with `dict` result representing a `InstanceGroupManagerPolicy` object """ - if instance_group_id is None: + if not instance_group_id: raise ValueError('instance_group_id must be provided') - if instance_group_manager_id is None: + if not instance_group_manager_id: raise ValueError('instance_group_manager_id must be provided') if instance_group_manager_policy_prototype is None: raise ValueError('instance_group_manager_policy_prototype must be provided') @@ -6254,6 +6389,7 @@ def create_instance_group_manager_policy(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['instance_group_id', 'instance_group_manager_id'] @@ -6291,11 +6427,11 @@ def delete_instance_group_manager_policy(self, :rtype: DetailedResponse """ - if instance_group_id is None: + if not instance_group_id: raise ValueError('instance_group_id must be provided') - if instance_group_manager_id is None: + if not instance_group_manager_id: raise ValueError('instance_group_manager_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -6310,6 +6446,7 @@ def delete_instance_group_manager_policy(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['instance_group_id', 'instance_group_manager_id', 'id'] path_param_values = self.encode_path_vars(instance_group_id, instance_group_manager_id, id) @@ -6345,11 +6482,11 @@ def get_instance_group_manager_policy(self, :rtype: DetailedResponse with `dict` result representing a `InstanceGroupManagerPolicy` object """ - if instance_group_id is None: + if not instance_group_id: raise ValueError('instance_group_id must be provided') - if instance_group_manager_id is None: + if not instance_group_manager_id: raise ValueError('instance_group_manager_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -6364,6 +6501,7 @@ def get_instance_group_manager_policy(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['instance_group_id', 'instance_group_manager_id', 'id'] @@ -6402,11 +6540,11 @@ def update_instance_group_manager_policy(self, :rtype: DetailedResponse with `dict` result representing a `InstanceGroupManagerPolicy` object """ - if instance_group_id is None: + if not instance_group_id: raise ValueError('instance_group_id must be provided') - if instance_group_manager_id is None: + if not instance_group_manager_id: raise ValueError('instance_group_manager_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') if instance_group_manager_policy_patch is None: raise ValueError('instance_group_manager_policy_patch must be provided') @@ -6428,6 +6566,7 @@ def update_instance_group_manager_policy(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['instance_group_id', 'instance_group_manager_id', 'id'] @@ -6462,7 +6601,7 @@ def delete_instance_group_memberships(self, :rtype: DetailedResponse """ - if instance_group_id is None: + if not instance_group_id: raise ValueError('instance_group_id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -6477,6 +6616,7 @@ def delete_instance_group_memberships(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['instance_group_id'] path_param_values = self.encode_path_vars(instance_group_id) @@ -6512,7 +6652,7 @@ def list_instance_group_memberships(self, :rtype: DetailedResponse with `dict` result representing a `InstanceGroupMembershipCollection` object """ - if instance_group_id is None: + if not instance_group_id: raise ValueError('instance_group_id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -6529,6 +6669,7 @@ def list_instance_group_memberships(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['instance_group_id'] @@ -6563,9 +6704,9 @@ def delete_instance_group_membership(self, :rtype: DetailedResponse """ - if instance_group_id is None: + if not instance_group_id: raise ValueError('instance_group_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -6580,6 +6721,7 @@ def delete_instance_group_membership(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['instance_group_id', 'id'] path_param_values = self.encode_path_vars(instance_group_id, id) @@ -6612,9 +6754,9 @@ def get_instance_group_membership(self, :rtype: DetailedResponse with `dict` result representing a `InstanceGroupMembership` object """ - if instance_group_id is None: + if not instance_group_id: raise ValueError('instance_group_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -6629,6 +6771,7 @@ def get_instance_group_membership(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['instance_group_id', 'id'] @@ -6665,9 +6808,9 @@ def update_instance_group_membership(self, :rtype: DetailedResponse with `dict` result representing a `InstanceGroupMembership` object """ - if instance_group_id is None: + if not instance_group_id: raise ValueError('instance_group_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') if instance_group_membership_patch is None: raise ValueError('instance_group_membership_patch must be provided') @@ -6689,6 +6832,7 @@ def update_instance_group_membership(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['instance_group_id', 'id'] @@ -6757,6 +6901,7 @@ def list_dedicated_host_groups(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' url = '/dedicated_host/groups' @@ -6829,6 +6974,7 @@ def create_dedicated_host_group(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' url = '/dedicated_host/groups' @@ -6857,7 +7003,7 @@ def delete_dedicated_host_group(self, :rtype: DetailedResponse """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -6872,6 +7018,7 @@ def delete_dedicated_host_group(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['id'] path_param_values = self.encode_path_vars(id) @@ -6902,7 +7049,7 @@ def get_dedicated_host_group(self, :rtype: DetailedResponse with `dict` result representing a `DedicatedHostGroup` object """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -6917,6 +7064,7 @@ def get_dedicated_host_group(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -6953,7 +7101,7 @@ def update_dedicated_host_group(self, :rtype: DetailedResponse with `dict` result representing a `DedicatedHostGroup` object """ - if id is None: + if not id: raise ValueError('id must be provided') if dedicated_host_group_patch is None: raise ValueError('dedicated_host_group_patch must be provided') @@ -6975,6 +7123,7 @@ def update_dedicated_host_group(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -7000,7 +7149,8 @@ def list_dedicated_host_profiles(self, """ List all dedicated host profiles. - This request lists all provisionable dedicated host profiles in the region. A + This request lists provisionable [dedicated host + profiles](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) in the region. A dedicated host profile specifies the hardware characteristics for a dedicated host. @@ -7027,6 +7177,7 @@ def list_dedicated_host_profiles(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' url = '/dedicated_host/profiles' @@ -7055,7 +7206,7 @@ def get_dedicated_host_profile(self, :rtype: DetailedResponse with `dict` result representing a `DedicatedHostProfile` object """ - if name is None: + if not name: raise ValueError('name must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -7070,6 +7221,7 @@ def get_dedicated_host_profile(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['name'] @@ -7135,6 +7287,7 @@ def list_dedicated_hosts(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' url = '/dedicated_hosts' @@ -7183,6 +7336,7 @@ def create_dedicated_host(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' url = '/dedicated_hosts' @@ -7214,7 +7368,7 @@ def list_dedicated_host_disks(self, :rtype: DetailedResponse with `dict` result representing a `DedicatedHostDiskCollection` object """ - if dedicated_host_id is None: + if not dedicated_host_id: raise ValueError('dedicated_host_id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -7229,6 +7383,7 @@ def list_dedicated_host_disks(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['dedicated_host_id'] @@ -7262,9 +7417,9 @@ def get_dedicated_host_disk(self, :rtype: DetailedResponse with `dict` result representing a `DedicatedHostDisk` object """ - if dedicated_host_id is None: + if not dedicated_host_id: raise ValueError('dedicated_host_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -7279,6 +7434,7 @@ def get_dedicated_host_disk(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['dedicated_host_id', 'id'] @@ -7315,9 +7471,9 @@ def update_dedicated_host_disk(self, :rtype: DetailedResponse with `dict` result representing a `DedicatedHostDisk` object """ - if dedicated_host_id is None: + if not dedicated_host_id: raise ValueError('dedicated_host_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') if dedicated_host_disk_patch is None: raise ValueError('dedicated_host_disk_patch must be provided') @@ -7339,6 +7495,7 @@ def update_dedicated_host_disk(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['dedicated_host_id', 'id'] @@ -7370,7 +7527,7 @@ def delete_dedicated_host(self, :rtype: DetailedResponse """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -7385,6 +7542,7 @@ def delete_dedicated_host(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['id'] path_param_values = self.encode_path_vars(id) @@ -7415,7 +7573,7 @@ def get_dedicated_host(self, :rtype: DetailedResponse with `dict` result representing a `DedicatedHost` object """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -7430,6 +7588,7 @@ def get_dedicated_host(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -7464,7 +7623,7 @@ def update_dedicated_host(self, :rtype: DetailedResponse with `dict` result representing a `DedicatedHost` object """ - if id is None: + if not id: raise ValueError('id must be provided') if dedicated_host_patch is None: raise ValueError('dedicated_host_patch must be provided') @@ -7486,6 +7645,7 @@ def update_dedicated_host(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -7554,6 +7714,7 @@ def list_backup_policies(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' url = '/backup_policies' @@ -7630,6 +7791,7 @@ def create_backup_policy(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' url = '/backup_policies' @@ -7663,7 +7825,7 @@ def list_backup_policy_plans(self, :rtype: DetailedResponse with `dict` result representing a `BackupPolicyPlanCollection` object """ - if backup_policy_id is None: + if not backup_policy_id: raise ValueError('backup_policy_id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -7679,6 +7841,7 @@ def list_backup_policy_plans(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['backup_policy_id'] @@ -7741,7 +7904,7 @@ def create_backup_policy_plan(self, :rtype: DetailedResponse with `dict` result representing a `BackupPolicyPlan` object """ - if backup_policy_id is None: + if not backup_policy_id: raise ValueError('backup_policy_id must be provided') if cron_spec is None: raise ValueError('cron_spec must be provided') @@ -7772,6 +7935,7 @@ def create_backup_policy_plan(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['backup_policy_id'] @@ -7815,9 +7979,9 @@ def delete_backup_policy_plan(self, :rtype: DetailedResponse with `dict` result representing a `BackupPolicyPlan` object """ - if backup_policy_id is None: + if not backup_policy_id: raise ValueError('backup_policy_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = { 'If-Match': if_match @@ -7834,6 +7998,7 @@ def delete_backup_policy_plan(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['backup_policy_id', 'id'] @@ -7867,9 +8032,9 @@ def get_backup_policy_plan(self, :rtype: DetailedResponse with `dict` result representing a `BackupPolicyPlan` object """ - if backup_policy_id is None: + if not backup_policy_id: raise ValueError('backup_policy_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -7884,6 +8049,7 @@ def get_backup_policy_plan(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['backup_policy_id', 'id'] @@ -7926,9 +8092,9 @@ def update_backup_policy_plan(self, :rtype: DetailedResponse with `dict` result representing a `BackupPolicyPlan` object """ - if backup_policy_id is None: + if not backup_policy_id: raise ValueError('backup_policy_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') if backup_policy_plan_patch is None: raise ValueError('backup_policy_plan_patch must be provided') @@ -7952,6 +8118,7 @@ def update_backup_policy_plan(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['backup_policy_id', 'id'] @@ -7990,7 +8157,7 @@ def delete_backup_policy(self, :rtype: DetailedResponse with `dict` result representing a `BackupPolicy` object """ - if id is None: + if not id: raise ValueError('id must be provided') headers = { 'If-Match': if_match @@ -8007,6 +8174,7 @@ def delete_backup_policy(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -8038,7 +8206,7 @@ def get_backup_policy(self, :rtype: DetailedResponse with `dict` result representing a `BackupPolicy` object """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -8053,6 +8221,7 @@ def get_backup_policy(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -8092,7 +8261,7 @@ def update_backup_policy(self, :rtype: DetailedResponse with `dict` result representing a `BackupPolicy` object """ - if id is None: + if not id: raise ValueError('id must be provided') if backup_policy_patch is None: raise ValueError('backup_policy_patch must be provided') @@ -8116,6 +8285,7 @@ def update_backup_policy(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -8170,6 +8340,7 @@ def list_placement_groups(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' url = '/placement_groups' @@ -8239,6 +8410,7 @@ def create_placement_group(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' url = '/placement_groups' @@ -8269,7 +8441,7 @@ def delete_placement_group(self, :rtype: DetailedResponse """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -8284,6 +8456,7 @@ def delete_placement_group(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['id'] path_param_values = self.encode_path_vars(id) @@ -8314,7 +8487,7 @@ def get_placement_group(self, :rtype: DetailedResponse with `dict` result representing a `PlacementGroup` object """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -8329,6 +8502,7 @@ def get_placement_group(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -8364,7 +8538,7 @@ def update_placement_group(self, :rtype: DetailedResponse with `dict` result representing a `PlacementGroup` object """ - if id is None: + if not id: raise ValueError('id must be provided') if placement_group_patch is None: raise ValueError('placement_group_patch must be provided') @@ -8386,6 +8560,7 @@ def update_placement_group(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -8415,9 +8590,10 @@ def list_bare_metal_server_profiles(self, """ List all bare metal server profiles. - This request lists all bare metal server profiles available in the region. A bare - metal server profile specifies the performance characteristics and pricing model - for a bare metal server. + This request lists all [bare metal server + profiles](https://cloud.ibm.com/docs/vpc?topic=vpc-bare-metal-servers-profile) + available in the region. A bare metal server profile specifies the performance + characteristics and pricing model for a bare metal server. :param str start: (optional) A server-provided token determining what resource to start the page on. @@ -8442,6 +8618,7 @@ def list_bare_metal_server_profiles(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' url = '/bare_metal_server/profiles' @@ -8470,7 +8647,7 @@ def get_bare_metal_server_profile(self, :rtype: DetailedResponse with `dict` result representing a `BareMetalServerProfile` object """ - if name is None: + if not name: raise ValueError('name must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -8485,6 +8662,7 @@ def get_bare_metal_server_profile(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['name'] @@ -8566,6 +8744,7 @@ def list_bare_metal_servers(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' url = '/bare_metal_servers' @@ -8602,8 +8781,9 @@ def create_bare_metal_server(self, :param BareMetalServerPrimaryNetworkInterfacePrototype primary_network_interface: Primary network interface for the bare metal server. - :param BareMetalServerProfileIdentity profile: The profile to use for this - bare metal server. + :param BareMetalServerProfileIdentity profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-bare-metal-servers-profile) + to use for this bare metal server. :param ZoneIdentity zone: The zone this bare metal server will reside in. :param str name: (optional) The unique user-defined name for this bare metal server (and default system hostname). If unspecified, the name will @@ -8615,9 +8795,10 @@ def create_bare_metal_server(self, to use. If unspecified, the account's [default resource group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. - :param VPCIdentity vpc: (optional) The VPC the bare metal server is to be a - part of. If specified, it must match the - VPC referenced by the subnets of the server's network interfaces. + :param VPCIdentity vpc: (optional) The VPC this bare metal server will + reside in. + If specified, it must match the VPC for the subnets of the server's network + interfaces. :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 `BareMetalServer` object @@ -8668,6 +8849,7 @@ def create_bare_metal_server(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' url = '/bare_metal_servers' @@ -8699,7 +8881,9 @@ def create_bare_metal_server_console_access_token(self, :param str bare_metal_server_id: The bare metal server identifier. :param str console_type: The bare metal server console type for which this - token may be used. + token may be used + Must be `serial` for bare metal servers with a `cpu.architecture` of + `s390x`. :param bool force: (optional) Indicates whether to disconnect an existing serial console session as the serial console cannot be shared. This has no effect on VNC consoles. @@ -8708,7 +8892,7 @@ def create_bare_metal_server_console_access_token(self, :rtype: DetailedResponse with `dict` result representing a `BareMetalServerConsoleAccessToken` object """ - if bare_metal_server_id is None: + if not bare_metal_server_id: raise ValueError('bare_metal_server_id must be provided') if console_type is None: raise ValueError('console_type must be provided') @@ -8733,6 +8917,7 @@ def create_bare_metal_server_console_access_token(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['bare_metal_server_id'] @@ -8766,7 +8951,7 @@ def list_bare_metal_server_disks(self, :rtype: DetailedResponse with `dict` result representing a `BareMetalServerDiskCollection` object """ - if bare_metal_server_id is None: + if not bare_metal_server_id: raise ValueError('bare_metal_server_id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -8781,6 +8966,7 @@ def list_bare_metal_server_disks(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['bare_metal_server_id'] @@ -8813,9 +8999,9 @@ def get_bare_metal_server_disk(self, :rtype: DetailedResponse with `dict` result representing a `BareMetalServerDisk` object """ - if bare_metal_server_id is None: + if not bare_metal_server_id: raise ValueError('bare_metal_server_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -8830,6 +9016,7 @@ def get_bare_metal_server_disk(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['bare_metal_server_id', 'id'] @@ -8866,9 +9053,9 @@ def update_bare_metal_server_disk(self, :rtype: DetailedResponse with `dict` result representing a `BareMetalServerDisk` object """ - if bare_metal_server_id is None: + if not bare_metal_server_id: raise ValueError('bare_metal_server_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') if bare_metal_server_disk_patch is None: raise ValueError('bare_metal_server_disk_patch must be provided') @@ -8890,6 +9077,7 @@ def update_bare_metal_server_disk(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['bare_metal_server_id', 'id'] @@ -8931,7 +9119,7 @@ def list_bare_metal_server_network_interfaces(self, :rtype: DetailedResponse with `dict` result representing a `BareMetalServerNetworkInterfaceCollection` object """ - if bare_metal_server_id is None: + if not bare_metal_server_id: raise ValueError('bare_metal_server_id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -8948,6 +9136,7 @@ def list_bare_metal_server_network_interfaces(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['bare_metal_server_id'] @@ -8987,7 +9176,7 @@ def create_bare_metal_server_network_interface(self, :rtype: DetailedResponse with `dict` result representing a `BareMetalServerNetworkInterface` object """ - if bare_metal_server_id is None: + if not bare_metal_server_id: raise ValueError('bare_metal_server_id must be provided') if bare_metal_server_network_interface_prototype is None: raise ValueError('bare_metal_server_network_interface_prototype must be provided') @@ -9009,6 +9198,7 @@ def create_bare_metal_server_network_interface(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['bare_metal_server_id'] @@ -9044,9 +9234,9 @@ def delete_bare_metal_server_network_interface(self, :rtype: DetailedResponse """ - if bare_metal_server_id is None: + if not bare_metal_server_id: raise ValueError('bare_metal_server_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -9061,6 +9251,7 @@ def delete_bare_metal_server_network_interface(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['bare_metal_server_id', 'id'] path_param_values = self.encode_path_vars(bare_metal_server_id, id) @@ -9093,9 +9284,9 @@ def get_bare_metal_server_network_interface(self, :rtype: DetailedResponse with `dict` result representing a `BareMetalServerNetworkInterface` object """ - if bare_metal_server_id is None: + if not bare_metal_server_id: raise ValueError('bare_metal_server_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -9110,6 +9301,7 @@ def get_bare_metal_server_network_interface(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['bare_metal_server_id', 'id'] @@ -9148,9 +9340,9 @@ def update_bare_metal_server_network_interface(self, :rtype: DetailedResponse with `dict` result representing a `BareMetalServerNetworkInterface` object """ - if bare_metal_server_id is None: + if not bare_metal_server_id: raise ValueError('bare_metal_server_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') if bare_metal_server_network_interface_patch is None: raise ValueError('bare_metal_server_network_interface_patch must be provided') @@ -9172,6 +9364,7 @@ def update_bare_metal_server_network_interface(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['bare_metal_server_id', 'id'] @@ -9205,9 +9398,9 @@ def list_bare_metal_server_network_interface_floating_ips(self, :rtype: DetailedResponse with `dict` result representing a `FloatingIPUnpaginatedCollection` object """ - if bare_metal_server_id is None: + if not bare_metal_server_id: raise ValueError('bare_metal_server_id must be provided') - if network_interface_id is None: + if not network_interface_id: raise ValueError('network_interface_id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -9222,6 +9415,7 @@ def list_bare_metal_server_network_interface_floating_ips(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['bare_metal_server_id', 'network_interface_id'] @@ -9257,11 +9451,11 @@ def remove_bare_metal_server_network_interface_floating_ip(self, :rtype: DetailedResponse """ - if bare_metal_server_id is None: + if not bare_metal_server_id: raise ValueError('bare_metal_server_id must be provided') - if network_interface_id is None: + if not network_interface_id: raise ValueError('network_interface_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -9276,6 +9470,7 @@ def remove_bare_metal_server_network_interface_floating_ip(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] 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) @@ -9310,11 +9505,11 @@ def get_bare_metal_server_network_interface_floating_ip(self, :rtype: DetailedResponse with `dict` result representing a `FloatingIP` object """ - if bare_metal_server_id is None: + if not bare_metal_server_id: raise ValueError('bare_metal_server_id must be provided') - if network_interface_id is None: + if not network_interface_id: raise ValueError('network_interface_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -9329,6 +9524,7 @@ def get_bare_metal_server_network_interface_floating_ip(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['bare_metal_server_id', 'network_interface_id', 'id'] @@ -9368,11 +9564,11 @@ def add_bare_metal_server_network_interface_floating_ip(self, :rtype: DetailedResponse with `dict` result representing a `FloatingIP` object """ - if bare_metal_server_id is None: + if not bare_metal_server_id: raise ValueError('bare_metal_server_id must be provided') - if network_interface_id is None: + if not network_interface_id: raise ValueError('network_interface_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -9387,6 +9583,7 @@ def add_bare_metal_server_network_interface_floating_ip(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['bare_metal_server_id', 'network_interface_id', 'id'] @@ -9402,6 +9599,111 @@ 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 not bare_metal_server_id: + raise ValueError('bare_metal_server_id must be provided') + if not network_interface_id: + 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')) + del kwargs['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 not bare_metal_server_id: + raise ValueError('bare_metal_server_id must be provided') + if not network_interface_id: + raise ValueError('network_interface_id must be provided') + if not id: + raise ValueError('id must be provided') + headers = {} + sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_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')) + del kwargs['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 @@ -9419,7 +9721,7 @@ def delete_bare_metal_server(self, :rtype: DetailedResponse """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -9434,6 +9736,7 @@ def delete_bare_metal_server(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['id'] path_param_values = self.encode_path_vars(id) @@ -9464,7 +9767,7 @@ def get_bare_metal_server(self, :rtype: DetailedResponse with `dict` result representing a `BareMetalServer` object """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -9479,6 +9782,7 @@ def get_bare_metal_server(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -9514,7 +9818,7 @@ def update_bare_metal_server(self, :rtype: DetailedResponse with `dict` result representing a `BareMetalServer` object """ - if id is None: + if not id: raise ValueError('id must be provided') if bare_metal_server_patch is None: raise ValueError('bare_metal_server_patch must be provided') @@ -9536,6 +9840,7 @@ def update_bare_metal_server(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -9570,7 +9875,7 @@ def get_bare_metal_server_initialization(self, :rtype: DetailedResponse with `dict` result representing a `BareMetalServerInitialization` object """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -9585,6 +9890,7 @@ def get_bare_metal_server_initialization(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -9616,7 +9922,7 @@ def restart_bare_metal_server(self, :rtype: DetailedResponse """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -9631,6 +9937,7 @@ def restart_bare_metal_server(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['id'] path_param_values = self.encode_path_vars(id) @@ -9661,7 +9968,7 @@ def start_bare_metal_server(self, :rtype: DetailedResponse """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -9676,6 +9983,7 @@ def start_bare_metal_server(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['id'] path_param_values = self.encode_path_vars(id) @@ -9711,7 +10019,7 @@ def stop_bare_metal_server(self, :rtype: DetailedResponse """ - if id is None: + if not id: raise ValueError('id must be provided') if type is None: raise ValueError('type must be provided') @@ -9735,6 +10043,7 @@ def stop_bare_metal_server(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['id'] path_param_values = self.encode_path_vars(id) @@ -9763,8 +10072,10 @@ def list_volume_profiles(self, """ List all volume profiles. - This request lists all volume profiles available in the region. A volume profile - specifies the performance characteristics and pricing model for a volume. + This request lists all [volume + profiles](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) + available in the region. A volume profile specifies the performance + characteristics and pricing model for a volume. :param str start: (optional) A server-provided token determining what resource to start the page on. @@ -9789,6 +10100,7 @@ def list_volume_profiles(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' url = '/volume/profiles' @@ -9816,7 +10128,7 @@ def get_volume_profile(self, :rtype: DetailedResponse with `dict` result representing a `VolumeProfile` object """ - if name is None: + if not name: raise ValueError('name must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -9831,6 +10143,7 @@ def get_volume_profile(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['name'] @@ -9889,6 +10202,7 @@ def list_volumes(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' url = '/volumes' @@ -9938,6 +10252,7 @@ def create_volume(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' url = '/volumes' @@ -9971,7 +10286,7 @@ def delete_volume(self, :rtype: DetailedResponse """ - if id is None: + if not id: raise ValueError('id must be provided') headers = { 'If-Match': if_match @@ -9988,6 +10303,7 @@ def delete_volume(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['id'] path_param_values = self.encode_path_vars(id) @@ -10017,7 +10333,7 @@ def get_volume(self, :rtype: DetailedResponse with `dict` result representing a `Volume` object """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -10032,6 +10348,7 @@ def get_volume(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -10071,7 +10388,7 @@ def update_volume(self, :rtype: DetailedResponse with `dict` result representing a `Volume` object """ - if id is None: + if not id: raise ValueError('id must be provided') if volume_patch is None: raise ValueError('volume_patch must be provided') @@ -10095,6 +10412,7 @@ def update_volume(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -10131,7 +10449,7 @@ def delete_snapshots(self, :rtype: DetailedResponse """ - if source_volume_id is None: + if not source_volume_id: raise ValueError('source_volume_id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -10147,6 +10465,7 @@ def delete_snapshots(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] url = '/snapshots' request = self.prepare_request(method='DELETE', @@ -10238,6 +10557,7 @@ def list_snapshots(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' url = '/snapshots' @@ -10287,6 +10607,7 @@ def create_snapshot(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' url = '/snapshots' @@ -10319,7 +10640,7 @@ def delete_snapshot(self, :rtype: DetailedResponse """ - if id is None: + if not id: raise ValueError('id must be provided') headers = { 'If-Match': if_match @@ -10336,6 +10657,7 @@ def delete_snapshot(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['id'] path_param_values = self.encode_path_vars(id) @@ -10365,7 +10687,7 @@ def get_snapshot(self, :rtype: DetailedResponse with `dict` result representing a `Snapshot` object """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -10380,6 +10702,7 @@ def get_snapshot(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -10417,7 +10740,7 @@ def update_snapshot(self, :rtype: DetailedResponse with `dict` result representing a `Snapshot` object """ - if id is None: + if not id: raise ValueError('id must be provided') if snapshot_patch is None: raise ValueError('snapshot_patch must be provided') @@ -10441,6 +10764,7 @@ def update_snapshot(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -10492,6 +10816,7 @@ def list_regions(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' url = '/regions' @@ -10519,7 +10844,7 @@ def get_region(self, :rtype: DetailedResponse with `dict` result representing a `Region` object """ - if name is None: + if not name: raise ValueError('name must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -10534,6 +10859,7 @@ def get_region(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['name'] @@ -10566,7 +10892,7 @@ def list_region_zones(self, :rtype: DetailedResponse with `dict` result representing a `ZoneCollection` object """ - if region_name is None: + if not region_name: raise ValueError('region_name must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -10581,6 +10907,7 @@ def list_region_zones(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['region_name'] @@ -10614,9 +10941,9 @@ def get_region_zone(self, :rtype: DetailedResponse with `dict` result representing a `Zone` object """ - if region_name is None: + if not region_name: raise ValueError('region_name must be provided') - if name is None: + if not name: raise ValueError('name must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -10631,6 +10958,7 @@ def get_region_zone(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['region_name', 'name'] @@ -10691,6 +11019,7 @@ def list_public_gateways(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' url = '/public_gateways' @@ -10723,7 +11052,7 @@ def create_public_gateway(self, gateway has been created, its floating IP cannot be unbound. A public gateway must be explicitly attached to each subnet it will provide connectivity for. - :param VPCIdentity vpc: The VPC this public gateway will serve. + :param VPCIdentity vpc: The VPC this public gateway will reside in. :param ZoneIdentity zone: The zone this public gateway will reside in. :param PublicGatewayFloatingIPPrototype floating_ip: (optional) :param str name: (optional) The user-defined name for this public gateway. @@ -10772,6 +11101,7 @@ def create_public_gateway(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' url = '/public_gateways' @@ -10803,7 +11133,7 @@ def delete_public_gateway(self, :rtype: DetailedResponse """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -10818,6 +11148,7 @@ def delete_public_gateway(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['id'] path_param_values = self.encode_path_vars(id) @@ -10848,7 +11179,7 @@ def get_public_gateway(self, :rtype: DetailedResponse with `dict` result representing a `PublicGateway` object """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -10863,6 +11194,7 @@ def get_public_gateway(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -10895,7 +11227,7 @@ def update_public_gateway(self, :rtype: DetailedResponse with `dict` result representing a `PublicGateway` object """ - if id is None: + if not id: raise ValueError('id must be provided') if public_gateway_patch is None: raise ValueError('public_gateway_patch must be provided') @@ -10917,6 +11249,7 @@ def update_public_gateway(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -10983,6 +11316,7 @@ def list_floating_ips(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' url = '/floating_ips' @@ -11031,6 +11365,7 @@ def create_floating_ip(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' url = '/floating_ips' @@ -11061,7 +11396,7 @@ def delete_floating_ip(self, :rtype: DetailedResponse """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -11076,6 +11411,7 @@ def delete_floating_ip(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['id'] path_param_values = self.encode_path_vars(id) @@ -11106,7 +11442,7 @@ def get_floating_ip(self, :rtype: DetailedResponse with `dict` result representing a `FloatingIP` object """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -11121,6 +11457,7 @@ def get_floating_ip(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -11153,7 +11490,7 @@ def update_floating_ip(self, :rtype: DetailedResponse with `dict` result representing a `FloatingIP` object """ - if id is None: + if not id: raise ValueError('id must be provided') if floating_ip_patch is None: raise ValueError('floating_ip_patch must be provided') @@ -11175,6 +11512,7 @@ def update_floating_ip(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -11236,6 +11574,7 @@ def list_network_acls(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' url = '/network_acls' @@ -11256,9 +11595,9 @@ def create_network_acl(self, """ Create a network ACL. - This request creates a new network ACL from a network ACL prototype object. The - prototype object is structured in the same way as a retrieved network ACL, and - contains the information necessary to create the new network ACL. + This request creates a new stateless network ACL from a network ACL prototype + object. The prototype object is structured in the same way as a retrieved network + ACL, and contains the information necessary to create the new network ACL. :param NetworkACLPrototype network_acl_prototype: (optional) The network ACL prototype object. @@ -11285,6 +11624,7 @@ def create_network_acl(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' url = '/network_acls' @@ -11315,7 +11655,7 @@ def delete_network_acl(self, :rtype: DetailedResponse """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -11330,6 +11670,7 @@ def delete_network_acl(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['id'] path_param_values = self.encode_path_vars(id) @@ -11360,7 +11701,7 @@ def get_network_acl(self, :rtype: DetailedResponse with `dict` result representing a `NetworkACL` object """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -11375,6 +11716,7 @@ def get_network_acl(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -11407,7 +11749,7 @@ def update_network_acl(self, :rtype: DetailedResponse with `dict` result representing a `NetworkACL` object """ - if id is None: + if not id: raise ValueError('id must be provided') if network_acl_patch is None: raise ValueError('network_acl_patch must be provided') @@ -11429,6 +11771,7 @@ def update_network_acl(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -11471,7 +11814,7 @@ def list_network_acl_rules(self, :rtype: DetailedResponse with `dict` result representing a `NetworkACLRuleCollection` object """ - if network_acl_id is None: + if not network_acl_id: raise ValueError('network_acl_id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -11489,6 +11832,7 @@ def list_network_acl_rules(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['network_acl_id'] @@ -11524,7 +11868,7 @@ def create_network_acl_rule(self, :rtype: DetailedResponse with `dict` result representing a `NetworkACLRule` object """ - if network_acl_id is None: + if not network_acl_id: raise ValueError('network_acl_id must be provided') if network_acl_rule_prototype is None: raise ValueError('network_acl_rule_prototype must be provided') @@ -11546,6 +11890,7 @@ def create_network_acl_rule(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['network_acl_id'] @@ -11579,9 +11924,9 @@ def delete_network_acl_rule(self, :rtype: DetailedResponse """ - if network_acl_id is None: + if not network_acl_id: raise ValueError('network_acl_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -11596,6 +11941,7 @@ def delete_network_acl_rule(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['network_acl_id', 'id'] path_param_values = self.encode_path_vars(network_acl_id, id) @@ -11627,9 +11973,9 @@ def get_network_acl_rule(self, :rtype: DetailedResponse with `dict` result representing a `NetworkACLRule` object """ - if network_acl_id is None: + if not network_acl_id: raise ValueError('network_acl_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -11644,6 +11990,7 @@ def get_network_acl_rule(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['network_acl_id', 'id'] @@ -11681,9 +12028,9 @@ def update_network_acl_rule(self, :rtype: DetailedResponse with `dict` result representing a `NetworkACLRule` object """ - if network_acl_id is None: + if not network_acl_id: raise ValueError('network_acl_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') if network_acl_rule_patch is None: raise ValueError('network_acl_rule_patch must be provided') @@ -11705,6 +12052,7 @@ def update_network_acl_rule(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['network_acl_id', 'id'] @@ -11780,6 +12128,7 @@ def list_security_groups(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' url = '/security_groups' @@ -11810,7 +12159,7 @@ def create_security_group(self, added to the security group. Each security group is scoped to one VPC. Only network interfaces on instances in that VPC can be added to the security group. - :param VPCIdentity vpc: The VPC this security group is to be a part of. + :param VPCIdentity vpc: The VPC this security group will reside in. :param str name: (optional) The user-defined name for this security group. If unspecified, the name will be a hyphenated list of randomly-selected words. Names must be unique within the VPC the security group resides in. @@ -11856,6 +12205,7 @@ def create_security_group(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' url = '/security_groups' @@ -11886,7 +12236,7 @@ def delete_security_group(self, :rtype: DetailedResponse """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -11901,6 +12251,7 @@ def delete_security_group(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['id'] path_param_values = self.encode_path_vars(id) @@ -11931,7 +12282,7 @@ def get_security_group(self, :rtype: DetailedResponse with `dict` result representing a `SecurityGroup` object """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -11946,6 +12297,7 @@ def get_security_group(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -11980,7 +12332,7 @@ def update_security_group(self, :rtype: DetailedResponse with `dict` result representing a `SecurityGroup` object """ - if id is None: + if not id: raise ValueError('id must be provided') if security_group_patch is None: raise ValueError('security_group_patch must be provided') @@ -12002,6 +12354,7 @@ def update_security_group(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -12035,7 +12388,7 @@ def list_security_group_rules(self, :rtype: DetailedResponse with `dict` result representing a `SecurityGroupRuleCollection` object """ - if security_group_id is None: + if not security_group_id: raise ValueError('security_group_id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -12050,6 +12403,7 @@ def list_security_group_rules(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['security_group_id'] @@ -12091,7 +12445,7 @@ def create_security_group_rule(self, :rtype: DetailedResponse with `dict` result representing a `SecurityGroupRule` object """ - if security_group_id is None: + if not security_group_id: raise ValueError('security_group_id must be provided') if security_group_rule_prototype is None: raise ValueError('security_group_rule_prototype must be provided') @@ -12113,6 +12467,7 @@ def create_security_group_rule(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['security_group_id'] @@ -12148,9 +12503,9 @@ def delete_security_group_rule(self, :rtype: DetailedResponse """ - if security_group_id is None: + if not security_group_id: raise ValueError('security_group_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -12165,6 +12520,7 @@ def delete_security_group_rule(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['security_group_id', 'id'] path_param_values = self.encode_path_vars(security_group_id, id) @@ -12197,9 +12553,9 @@ def get_security_group_rule(self, :rtype: DetailedResponse with `dict` result representing a `SecurityGroupRule` object """ - if security_group_id is None: + if not security_group_id: raise ValueError('security_group_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -12214,6 +12570,7 @@ def get_security_group_rule(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['security_group_id', 'id'] @@ -12251,9 +12608,9 @@ def update_security_group_rule(self, :rtype: DetailedResponse with `dict` result representing a `SecurityGroupRule` object """ - if security_group_id is None: + if not security_group_id: raise ValueError('security_group_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') if security_group_rule_patch is None: raise ValueError('security_group_rule_patch must be provided') @@ -12275,6 +12632,7 @@ def update_security_group_rule(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['security_group_id', 'id'] @@ -12313,7 +12671,7 @@ def list_security_group_targets(self, :rtype: DetailedResponse with `dict` result representing a `SecurityGroupTargetCollection` object """ - if security_group_id is None: + if not security_group_id: raise ValueError('security_group_id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -12330,6 +12688,7 @@ def list_security_group_targets(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['security_group_id'] @@ -12370,9 +12729,9 @@ def delete_security_group_target_binding(self, :rtype: DetailedResponse """ - if security_group_id is None: + if not security_group_id: raise ValueError('security_group_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -12387,6 +12746,7 @@ def delete_security_group_target_binding(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['security_group_id', 'id'] path_param_values = self.encode_path_vars(security_group_id, id) @@ -12419,9 +12779,9 @@ def get_security_group_target(self, :rtype: DetailedResponse with `dict` result representing a `SecurityGroupTargetReference` object """ - if security_group_id is None: + if not security_group_id: raise ValueError('security_group_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -12436,6 +12796,7 @@ def get_security_group_target(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['security_group_id', 'id'] @@ -12475,9 +12836,9 @@ def create_security_group_target_binding(self, :rtype: DetailedResponse with `dict` result representing a `SecurityGroupTargetReference` object """ - if security_group_id is None: + if not security_group_id: raise ValueError('security_group_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -12492,6 +12853,7 @@ def create_security_group_target_binding(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['security_group_id', 'id'] @@ -12545,6 +12907,7 @@ def list_ike_policies(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' url = '/ike_policies' @@ -12573,9 +12936,12 @@ def create_ike_policy(self, This request creates a new IKE policy. - :param str authentication_algorithm: The authentication algorithm. - :param int dh_group: The Diffie-Hellman group. - :param str encryption_algorithm: The encryption algorithm. + :param str authentication_algorithm: The authentication algorithm + The `md5` and `sha1` algorithms have been deprecated. + :param int dh_group: The Diffie-Hellman group + Groups `2` and `5` have been deprecated. + :param str encryption_algorithm: The encryption algorithm + The `triple_des` algorithm has been deprecated. :param int ike_version: The IKE protocol version. :param int key_lifetime: (optional) The key lifetime in seconds. :param str name: (optional) The user-defined name for this IKE policy. @@ -12624,6 +12990,7 @@ def create_ike_policy(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' url = '/ike_policies' @@ -12654,7 +13021,7 @@ def delete_ike_policy(self, :rtype: DetailedResponse """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -12669,6 +13036,7 @@ def delete_ike_policy(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['id'] path_param_values = self.encode_path_vars(id) @@ -12698,7 +13066,7 @@ def get_ike_policy(self, :rtype: DetailedResponse with `dict` result representing a `IKEPolicy` object """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -12713,6 +13081,7 @@ def get_ike_policy(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -12745,7 +13114,7 @@ def update_ike_policy(self, :rtype: DetailedResponse with `dict` result representing a `IKEPolicy` object """ - if id is None: + if not id: raise ValueError('id must be provided') if ike_policy_patch is None: raise ValueError('ike_policy_patch must be provided') @@ -12767,6 +13136,7 @@ def update_ike_policy(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -12798,7 +13168,7 @@ def list_ike_policy_connections(self, :rtype: DetailedResponse with `dict` result representing a `VPNGatewayConnectionCollection` object """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -12813,6 +13183,7 @@ def list_ike_policy_connections(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -12862,6 +13233,7 @@ def list_ipsec_policies(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' url = '/ipsec_policies' @@ -12889,9 +13261,17 @@ def create_ipsec_policy(self, This request creates a new IPsec policy. - :param str authentication_algorithm: The authentication algorithm. - :param str encryption_algorithm: The encryption algorithm. - :param str pfs: Perfect Forward Secrecy. + :param str authentication_algorithm: The authentication algorithm + The `md5` and `sha1` algorithms have been deprecated + Must be `disabled` if and only if the `encryption_algorithm` is + `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`. + :param str encryption_algorithm: The encryption algorithm + The `triple_des` algorithm has been deprecated + The `authentication_algorithm` must be `disabled` if and only if + `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or + `aes256gcm16`. + :param str pfs: Perfect Forward Secrecy + Groups `group_2` and `group_5` have been deprecated. :param int key_lifetime: (optional) The key lifetime in seconds. :param str name: (optional) The user-defined name for this IPsec policy. :param ResourceGroupIdentity resource_group: (optional) The resource group @@ -12936,6 +13316,7 @@ def create_ipsec_policy(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' url = '/ipsec_policies' @@ -12966,7 +13347,7 @@ def delete_ipsec_policy(self, :rtype: DetailedResponse """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -12981,6 +13362,7 @@ def delete_ipsec_policy(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['id'] path_param_values = self.encode_path_vars(id) @@ -13011,7 +13393,7 @@ def get_ipsec_policy(self, :rtype: DetailedResponse with `dict` result representing a `IPsecPolicy` object """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -13026,6 +13408,7 @@ def get_ipsec_policy(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -13058,7 +13441,7 @@ def update_ipsec_policy(self, :rtype: DetailedResponse with `dict` result representing a `IPsecPolicy` object """ - if id is None: + if not id: raise ValueError('id must be provided') if i_psec_policy_patch is None: raise ValueError('i_psec_policy_patch must be provided') @@ -13080,6 +13463,7 @@ def update_ipsec_policy(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -13111,7 +13495,7 @@ def list_ipsec_policy_connections(self, :rtype: DetailedResponse with `dict` result representing a `VPNGatewayConnectionCollection` object """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -13126,6 +13510,7 @@ def list_ipsec_policy_connections(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -13146,6 +13531,7 @@ def list_vpn_gateways(self, start: str = None, limit: int = None, resource_group_id: str = None, + sort: str = None, mode: str = None, **kwargs ) -> DetailedResponse: @@ -13159,6 +13545,11 @@ def list_vpn_gateways(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 str mode: (optional) Filters the collection to VPN gateways with the specified mode. :param dict headers: A `dict` containing the request headers @@ -13178,11 +13569,13 @@ def list_vpn_gateways(self, 'start': start, 'limit': limit, 'resource_group.id': resource_group_id, + 'sort': sort, 'mode': mode } if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' url = '/vpn_gateways' @@ -13231,6 +13624,7 @@ def create_vpn_gateway(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' url = '/vpn_gateways' @@ -13262,7 +13656,7 @@ def delete_vpn_gateway(self, :rtype: DetailedResponse """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -13277,6 +13671,7 @@ def delete_vpn_gateway(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['id'] path_param_values = self.encode_path_vars(id) @@ -13307,7 +13702,7 @@ def get_vpn_gateway(self, :rtype: DetailedResponse with `dict` result representing a `VPNGateway` object """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -13322,6 +13717,7 @@ def get_vpn_gateway(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -13354,7 +13750,7 @@ def update_vpn_gateway(self, :rtype: DetailedResponse with `dict` result representing a `VPNGateway` object """ - if id is None: + if not id: raise ValueError('id must be provided') if vpn_gateway_patch is None: raise ValueError('vpn_gateway_patch must be provided') @@ -13376,6 +13772,7 @@ def update_vpn_gateway(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -13411,7 +13808,7 @@ def list_vpn_gateway_connections(self, :rtype: DetailedResponse with `dict` result representing a `VPNGatewayConnectionCollection` object """ - if vpn_gateway_id is None: + if not vpn_gateway_id: raise ValueError('vpn_gateway_id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -13427,6 +13824,7 @@ def list_vpn_gateway_connections(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['vpn_gateway_id'] @@ -13460,7 +13858,7 @@ def create_vpn_gateway_connection(self, :rtype: DetailedResponse with `dict` result representing a `VPNGatewayConnection` object """ - if vpn_gateway_id is None: + if not vpn_gateway_id: raise ValueError('vpn_gateway_id must be provided') if vpn_gateway_connection_prototype is None: raise ValueError('vpn_gateway_connection_prototype must be provided') @@ -13482,6 +13880,7 @@ def create_vpn_gateway_connection(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['vpn_gateway_id'] @@ -13517,9 +13916,9 @@ def delete_vpn_gateway_connection(self, :rtype: DetailedResponse """ - if vpn_gateway_id is None: + if not vpn_gateway_id: raise ValueError('vpn_gateway_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -13534,6 +13933,7 @@ def delete_vpn_gateway_connection(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['vpn_gateway_id', 'id'] path_param_values = self.encode_path_vars(vpn_gateway_id, id) @@ -13566,9 +13966,9 @@ def get_vpn_gateway_connection(self, :rtype: DetailedResponse with `dict` result representing a `VPNGatewayConnection` object """ - if vpn_gateway_id is None: + if not vpn_gateway_id: raise ValueError('vpn_gateway_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -13583,6 +13983,7 @@ def get_vpn_gateway_connection(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['vpn_gateway_id', 'id'] @@ -13618,9 +14019,9 @@ def update_vpn_gateway_connection(self, :rtype: DetailedResponse with `dict` result representing a `VPNGatewayConnection` object """ - if vpn_gateway_id is None: + if not vpn_gateway_id: raise ValueError('vpn_gateway_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') if vpn_gateway_connection_patch is None: raise ValueError('vpn_gateway_connection_patch must be provided') @@ -13642,6 +14043,7 @@ def update_vpn_gateway_connection(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['vpn_gateway_id', 'id'] @@ -13676,9 +14078,9 @@ def list_vpn_gateway_connection_local_cidrs(self, :rtype: DetailedResponse with `dict` result representing a `VPNGatewayConnectionLocalCIDRs` object """ - if vpn_gateway_id is None: + if not vpn_gateway_id: raise ValueError('vpn_gateway_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -13693,6 +14095,7 @@ def list_vpn_gateway_connection_local_cidrs(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['vpn_gateway_id', 'id'] @@ -13730,13 +14133,13 @@ def remove_vpn_gateway_connection_local_cidr(self, :rtype: DetailedResponse """ - if vpn_gateway_id is None: + if not vpn_gateway_id: raise ValueError('vpn_gateway_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') - if cidr_prefix is None: + if not cidr_prefix: raise ValueError('cidr_prefix must be provided') - if prefix_length is None: + if not prefix_length: raise ValueError('prefix_length must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -13751,6 +14154,7 @@ def remove_vpn_gateway_connection_local_cidr(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['vpn_gateway_id', 'id', 'cidr_prefix', 'prefix_length'] path_param_values = self.encode_path_vars(vpn_gateway_id, id, cidr_prefix, prefix_length) @@ -13788,13 +14192,13 @@ def check_vpn_gateway_connection_local_cidr(self, :rtype: DetailedResponse """ - if vpn_gateway_id is None: + if not vpn_gateway_id: raise ValueError('vpn_gateway_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') - if cidr_prefix is None: + if not cidr_prefix: raise ValueError('cidr_prefix must be provided') - if prefix_length is None: + if not prefix_length: raise ValueError('prefix_length must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -13809,6 +14213,7 @@ def check_vpn_gateway_connection_local_cidr(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['vpn_gateway_id', 'id', 'cidr_prefix', 'prefix_length'] path_param_values = self.encode_path_vars(vpn_gateway_id, id, cidr_prefix, prefix_length) @@ -13847,13 +14252,13 @@ def add_vpn_gateway_connection_local_cidr(self, :rtype: DetailedResponse """ - if vpn_gateway_id is None: + if not vpn_gateway_id: raise ValueError('vpn_gateway_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') - if cidr_prefix is None: + if not cidr_prefix: raise ValueError('cidr_prefix must be provided') - if prefix_length is None: + if not prefix_length: raise ValueError('prefix_length must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -13868,6 +14273,7 @@ def add_vpn_gateway_connection_local_cidr(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['vpn_gateway_id', 'id', 'cidr_prefix', 'prefix_length'] path_param_values = self.encode_path_vars(vpn_gateway_id, id, cidr_prefix, prefix_length) @@ -13900,9 +14306,9 @@ def list_vpn_gateway_connection_peer_cidrs(self, :rtype: DetailedResponse with `dict` result representing a `VPNGatewayConnectionPeerCIDRs` object """ - if vpn_gateway_id is None: + if not vpn_gateway_id: raise ValueError('vpn_gateway_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -13917,6 +14323,7 @@ def list_vpn_gateway_connection_peer_cidrs(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['vpn_gateway_id', 'id'] @@ -13954,13 +14361,13 @@ def remove_vpn_gateway_connection_peer_cidr(self, :rtype: DetailedResponse """ - if vpn_gateway_id is None: + if not vpn_gateway_id: raise ValueError('vpn_gateway_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') - if cidr_prefix is None: + if not cidr_prefix: raise ValueError('cidr_prefix must be provided') - if prefix_length is None: + if not prefix_length: raise ValueError('prefix_length must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -13975,6 +14382,7 @@ def remove_vpn_gateway_connection_peer_cidr(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['vpn_gateway_id', 'id', 'cidr_prefix', 'prefix_length'] path_param_values = self.encode_path_vars(vpn_gateway_id, id, cidr_prefix, prefix_length) @@ -14012,13 +14420,13 @@ def check_vpn_gateway_connection_peer_cidr(self, :rtype: DetailedResponse """ - if vpn_gateway_id is None: + if not vpn_gateway_id: raise ValueError('vpn_gateway_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') - if cidr_prefix is None: + if not cidr_prefix: raise ValueError('cidr_prefix must be provided') - if prefix_length is None: + if not prefix_length: raise ValueError('prefix_length must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -14033,6 +14441,7 @@ def check_vpn_gateway_connection_peer_cidr(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['vpn_gateway_id', 'id', 'cidr_prefix', 'prefix_length'] path_param_values = self.encode_path_vars(vpn_gateway_id, id, cidr_prefix, prefix_length) @@ -14071,13 +14480,13 @@ def add_vpn_gateway_connection_peer_cidr(self, :rtype: DetailedResponse """ - if vpn_gateway_id is None: + if not vpn_gateway_id: raise ValueError('vpn_gateway_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') - if cidr_prefix is None: + if not cidr_prefix: raise ValueError('cidr_prefix must be provided') - if prefix_length is None: + if not prefix_length: raise ValueError('prefix_length must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -14092,6 +14501,7 @@ def add_vpn_gateway_connection_peer_cidr(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['vpn_gateway_id', 'id', 'cidr_prefix', 'prefix_length'] path_param_values = self.encode_path_vars(vpn_gateway_id, id, cidr_prefix, prefix_length) @@ -14159,6 +14569,7 @@ def list_vpn_servers(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' url = '/vpn_servers' @@ -14284,6 +14695,7 @@ def create_vpn_server(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' url = '/vpn_servers' @@ -14316,7 +14728,7 @@ def delete_vpn_server(self, :rtype: DetailedResponse """ - if id is None: + if not id: raise ValueError('id must be provided') headers = { 'If-Match': if_match @@ -14333,6 +14745,7 @@ def delete_vpn_server(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['id'] path_param_values = self.encode_path_vars(id) @@ -14362,7 +14775,7 @@ def get_vpn_server(self, :rtype: DetailedResponse with `dict` result representing a `VPNServer` object """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -14377,6 +14790,7 @@ def get_vpn_server(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -14416,7 +14830,7 @@ def update_vpn_server(self, :rtype: DetailedResponse with `dict` result representing a `VPNServer` object """ - if id is None: + if not id: raise ValueError('id must be provided') if vpn_server_patch is None: raise ValueError('vpn_server_patch must be provided') @@ -14440,6 +14854,7 @@ def update_vpn_server(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -14473,7 +14888,7 @@ def get_vpn_server_client_configuration(self, :rtype: DetailedResponse with `str` result """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -14488,6 +14903,7 @@ def get_vpn_server_client_configuration(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'text/plain' path_param_keys = ['id'] @@ -14530,7 +14946,7 @@ def list_vpn_server_clients(self, :rtype: DetailedResponse with `dict` result representing a `VPNServerClientCollection` object """ - if vpn_server_id is None: + if not vpn_server_id: raise ValueError('vpn_server_id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -14548,6 +14964,7 @@ def list_vpn_server_clients(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['vpn_server_id'] @@ -14582,9 +14999,9 @@ def delete_vpn_server_client(self, :rtype: DetailedResponse """ - if vpn_server_id is None: + if not vpn_server_id: raise ValueError('vpn_server_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -14599,6 +15016,7 @@ def delete_vpn_server_client(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['vpn_server_id', 'id'] path_param_values = self.encode_path_vars(vpn_server_id, id) @@ -14630,9 +15048,9 @@ def get_vpn_server_client(self, :rtype: DetailedResponse with `dict` result representing a `VPNServerClient` object """ - if vpn_server_id is None: + if not vpn_server_id: raise ValueError('vpn_server_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -14647,6 +15065,7 @@ def get_vpn_server_client(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['vpn_server_id', 'id'] @@ -14682,9 +15101,9 @@ def disconnect_vpn_client(self, :rtype: DetailedResponse """ - if vpn_server_id is None: + if not vpn_server_id: raise ValueError('vpn_server_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -14699,6 +15118,7 @@ def disconnect_vpn_client(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['vpn_server_id', 'id'] path_param_values = self.encode_path_vars(vpn_server_id, id) @@ -14743,7 +15163,7 @@ def list_vpn_server_routes(self, :rtype: DetailedResponse with `dict` result representing a `VPNServerRouteCollection` object """ - if vpn_server_id is None: + if not vpn_server_id: raise ValueError('vpn_server_id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -14761,6 +15181,7 @@ def list_vpn_server_routes(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['vpn_server_id'] @@ -14815,7 +15236,7 @@ def create_vpn_server_route(self, :rtype: DetailedResponse with `dict` result representing a `VPNServerRoute` object """ - if vpn_server_id is None: + if not vpn_server_id: raise ValueError('vpn_server_id must be provided') if destination is None: raise ValueError('destination must be provided') @@ -14841,6 +15262,7 @@ def create_vpn_server_route(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['vpn_server_id'] @@ -14874,9 +15296,9 @@ def delete_vpn_server_route(self, :rtype: DetailedResponse """ - if vpn_server_id is None: + if not vpn_server_id: raise ValueError('vpn_server_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -14891,6 +15313,7 @@ def delete_vpn_server_route(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['vpn_server_id', 'id'] path_param_values = self.encode_path_vars(vpn_server_id, id) @@ -14922,9 +15345,9 @@ def get_vpn_server_route(self, :rtype: DetailedResponse with `dict` result representing a `VPNServerRoute` object """ - if vpn_server_id is None: + if not vpn_server_id: raise ValueError('vpn_server_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -14939,6 +15362,7 @@ def get_vpn_server_route(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['vpn_server_id', 'id'] @@ -14975,9 +15399,9 @@ def update_vpn_server_route(self, :rtype: DetailedResponse with `dict` result representing a `VPNServerRoute` object """ - if vpn_server_id is None: + if not vpn_server_id: raise ValueError('vpn_server_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') if vpn_server_route_patch is None: raise ValueError('vpn_server_route_patch must be provided') @@ -14999,6 +15423,7 @@ def update_vpn_server_route(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['vpn_server_id', 'id'] @@ -15055,6 +15480,7 @@ def list_load_balancer_profiles(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' url = '/load_balancer/profiles' @@ -15082,7 +15508,7 @@ def get_load_balancer_profile(self, :rtype: DetailedResponse with `dict` result representing a `LoadBalancerProfile` object """ - if name is None: + if not name: raise ValueError('name must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -15097,6 +15523,7 @@ def get_load_balancer_profile(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['name'] @@ -15146,6 +15573,7 @@ def list_load_balancers(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' url = '/load_balancers' @@ -15177,30 +15605,30 @@ def create_load_balancer(self, This request creates and provisions a new load balancer. - :param bool is_public: Indicates whether this load balancer is public or - private. - At present, if route mode is enabled, the load balancer must be private. + :param bool is_public: Indicates whether this load balancer is public. + At present, if route mode is enabled, the load balancer must not be public. :param List[SubnetIdentity] subnets: The subnets to provision this load - balancer in. The load balancer's availability will depend on the - availability of the zones the specified subnets reside in. + balancer in. The subnets must be in the same VPC. The load balancer's + availability will depend on the availability of the zones that the subnets + reside in. Load balancers in the `network` family allow only one subnet to be specified. :param List[LoadBalancerListenerPrototypeLoadBalancerContext] listeners: (optional) The listeners of this load balancer. :param LoadBalancerLogging logging: (optional) The logging configuration to use for this load balancer. See [VPC Datapath - Logging](https://cloud.ibm.com/docs/vpc?topic=vpc-datapath-logging) - on the logging format, fields and permitted values. - To activate logging, the load balancer profile must support the specified + Logging](https://cloud.ibm.com/docs/vpc?topic=vpc-datapath-logging) on the logging - type. + format, fields and permitted values. + To activate logging, the load balancer profile must support the specified + logging type. :param str name: (optional) The user-defined name for this load balancer. If unspecified, the name will be a hyphenated list of randomly-selected words. :param List[LoadBalancerPoolPrototype] pools: (optional) The pools of this load balancer. :param LoadBalancerProfileIdentity profile: (optional) The profile to use - for this load balancer + for this load balancer. If unspecified, `application` will be used. :param ResourceGroupIdentity resource_group: (optional) The resource group to use. If unspecified, the account's [default resource @@ -15265,6 +15693,7 @@ def create_load_balancer(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' url = '/load_balancers' @@ -15280,6 +15709,8 @@ def create_load_balancer(self, def delete_load_balancer(self, id: str, + *, + if_match: str = None, **kwargs ) -> DetailedResponse: """ @@ -15289,14 +15720,18 @@ def delete_load_balancer(self, balancer cannot be deleted if its `provisioning_status` is `delete_pending`. :param str id: The load balancer identifier. + :param str if_match: (optional) If present, the request will fail if the + specified ETag value does not match the resource's current ETag value. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ - if id is None: + if not id: raise ValueError('id must be provided') - headers = {} + headers = { + 'If-Match': if_match + } sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='delete_load_balancer') @@ -15309,6 +15744,7 @@ def delete_load_balancer(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['id'] path_param_values = self.encode_path_vars(id) @@ -15339,7 +15775,7 @@ def get_load_balancer(self, :rtype: DetailedResponse with `dict` result representing a `LoadBalancer` object """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -15354,6 +15790,7 @@ def get_load_balancer(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -15372,27 +15809,37 @@ def get_load_balancer(self, def update_load_balancer(self, id: str, load_balancer_patch: 'LoadBalancerPatch', + *, + if_match: str = None, **kwargs ) -> DetailedResponse: """ Update a load balancer. - This request updates a load balancer. + This request updates a load balancer with the information in a provided load + balancer patch. The load balancer patch object is structured in the same way as a + retrieved load balancer and contains only the information to be updated. A load + balancer can only be updated if its `provisioning_status` is `active`. :param str id: The load balancer identifier. :param LoadBalancerPatch load_balancer_patch: The load balancer patch. + :param str if_match: (optional) If present, the request will fail if the + specified ETag value does not match the resource's current ETag value. + Required if the request body includes an array. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `LoadBalancer` object """ - if id is None: + if not id: raise ValueError('id must be provided') if load_balancer_patch is None: raise ValueError('load_balancer_patch must be provided') if isinstance(load_balancer_patch, LoadBalancerPatch): load_balancer_patch = convert_model(load_balancer_patch) - headers = {} + headers = { + 'If-Match': if_match + } sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='update_load_balancer') @@ -15408,6 +15855,7 @@ def update_load_balancer(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -15439,7 +15887,7 @@ def get_load_balancer_statistics(self, :rtype: DetailedResponse with `dict` result representing a `LoadBalancerStatistics` object """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -15454,6 +15902,7 @@ def get_load_balancer_statistics(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -15484,7 +15933,7 @@ def list_load_balancer_listeners(self, :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListenerCollection` object """ - if load_balancer_id is None: + if not load_balancer_id: raise ValueError('load_balancer_id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -15499,6 +15948,7 @@ def list_load_balancer_listeners(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['load_balancer_id'] @@ -15536,11 +15986,17 @@ def create_load_balancer_listener(self, :param str load_balancer_id: The load balancer identifier. :param str protocol: The listener protocol. Each listener in the load - balancer must have a unique `port` and `protocol` combination. Additional - restrictions: - - 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. + balancer must have a unique `port` and `protocol` combination. + Load balancers in the `network` family support `tcp` and `udp` (if + `udp_supported` is `true`). Load balancers in the `application` family + support `tcp`, `http` and + `https`. + Additional restrictions: + - If `default_pool` is set, the pool's protocol must match, or be + compatible with + the listener's protocol. At present, the compatible protocols are `http` + and + `https`. - If `https_redirect` is set, the protocol must be `http`. :param bool accept_proxy_protocol: (optional) If set to `true`, this listener will accept and forward PROXY protocol information. Supported by @@ -15554,17 +16010,19 @@ def create_load_balancer_listener(self, `accept_proxy_protocol` value must match that listener's `accept_proxy_protocol` value. :param CertificateInstanceIdentity certificate_instance: (optional) The - certificate instance used for SSL termination. It is applicable only to - `https` - protocol. + certificate instance to use for SSL termination. The listener must have a + `protocol` of `https`. :param int connection_limit: (optional) The connection limit of the listener. :param LoadBalancerPoolIdentity default_pool: (optional) The default pool - for this listener. The specified pool must: - - Belong to this load balancer + for this listener. If specified, the pool must: + - Belong to this load balancer. - Have the same `protocol` as this listener, or have a compatible protocol. At present, the compatible protocols are `http` and `https`. - Not already be the `default_pool` for another listener. + If unspecified, this listener will be created with no default pool, but one + may be + subsequently set. :param LoadBalancerListenerHTTPSRedirectPrototype https_redirect: (optional) The target listener that requests will be redirected to. This listener must have a @@ -15598,7 +16056,7 @@ def create_load_balancer_listener(self, :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListener` object """ - if load_balancer_id is None: + if not load_balancer_id: raise ValueError('load_balancer_id must be provided') if protocol is None: raise ValueError('protocol must be provided') @@ -15639,6 +16097,7 @@ def create_load_balancer_listener(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['load_balancer_id'] @@ -15674,9 +16133,9 @@ def delete_load_balancer_listener(self, :rtype: DetailedResponse """ - if load_balancer_id is None: + if not load_balancer_id: raise ValueError('load_balancer_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -15691,6 +16150,7 @@ def delete_load_balancer_listener(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['load_balancer_id', 'id'] path_param_values = self.encode_path_vars(load_balancer_id, id) @@ -15723,9 +16183,9 @@ def get_load_balancer_listener(self, :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListener` object """ - if load_balancer_id is None: + if not load_balancer_id: raise ValueError('load_balancer_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -15740,6 +16200,7 @@ def get_load_balancer_listener(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['load_balancer_id', 'id'] @@ -15775,9 +16236,9 @@ def update_load_balancer_listener(self, :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListener` object """ - if load_balancer_id is None: + if not load_balancer_id: raise ValueError('load_balancer_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') if load_balancer_listener_patch is None: raise ValueError('load_balancer_listener_patch must be provided') @@ -15799,6 +16260,7 @@ def update_load_balancer_listener(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['load_balancer_id', 'id'] @@ -15832,9 +16294,9 @@ def list_load_balancer_listener_policies(self, :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListenerPolicyCollection` object """ - if load_balancer_id is None: + if not load_balancer_id: raise ValueError('load_balancer_id must be provided') - if listener_id is None: + if not listener_id: raise ValueError('listener_id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -15849,6 +16311,7 @@ def list_load_balancer_listener_policies(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['load_balancer_id', 'listener_id'] @@ -15904,9 +16367,9 @@ def create_load_balancer_listener_policy(self, :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListenerPolicy` object """ - if load_balancer_id is None: + if not load_balancer_id: raise ValueError('load_balancer_id must be provided') - if listener_id is None: + if not listener_id: raise ValueError('listener_id must be provided') if action is None: raise ValueError('action must be provided') @@ -15940,6 +16403,7 @@ def create_load_balancer_listener_policy(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['load_balancer_id', 'listener_id'] @@ -15975,11 +16439,11 @@ def delete_load_balancer_listener_policy(self, :rtype: DetailedResponse """ - if load_balancer_id is None: + if not load_balancer_id: raise ValueError('load_balancer_id must be provided') - if listener_id is None: + if not listener_id: raise ValueError('listener_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -15994,6 +16458,7 @@ def delete_load_balancer_listener_policy(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['load_balancer_id', 'listener_id', 'id'] path_param_values = self.encode_path_vars(load_balancer_id, listener_id, id) @@ -16027,11 +16492,11 @@ def get_load_balancer_listener_policy(self, :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListenerPolicy` object """ - if load_balancer_id is None: + if not load_balancer_id: raise ValueError('load_balancer_id must be provided') - if listener_id is None: + if not listener_id: raise ValueError('listener_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -16046,6 +16511,7 @@ def get_load_balancer_listener_policy(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['load_balancer_id', 'listener_id', 'id'] @@ -16083,11 +16549,11 @@ def update_load_balancer_listener_policy(self, :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListenerPolicy` object """ - if load_balancer_id is None: + if not load_balancer_id: raise ValueError('load_balancer_id must be provided') - if listener_id is None: + if not listener_id: raise ValueError('listener_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') if load_balancer_listener_policy_patch is None: raise ValueError('load_balancer_listener_policy_patch must be provided') @@ -16109,6 +16575,7 @@ def update_load_balancer_listener_policy(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['load_balancer_id', 'listener_id', 'id'] @@ -16144,11 +16611,11 @@ def list_load_balancer_listener_policy_rules(self, :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListenerPolicyRuleCollection` object """ - if load_balancer_id is None: + if not load_balancer_id: raise ValueError('load_balancer_id must be provided') - if listener_id is None: + if not listener_id: raise ValueError('listener_id must be provided') - if policy_id is None: + if not policy_id: raise ValueError('policy_id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -16163,6 +16630,7 @@ def list_load_balancer_listener_policy_rules(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['load_balancer_id', 'listener_id', 'policy_id'] @@ -16216,11 +16684,11 @@ def create_load_balancer_listener_policy_rule(self, :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListenerPolicyRule` object """ - if load_balancer_id is None: + if not load_balancer_id: raise ValueError('load_balancer_id must be provided') - if listener_id is None: + if not listener_id: raise ValueError('listener_id must be provided') - if policy_id is None: + if not policy_id: raise ValueError('policy_id must be provided') if condition is None: raise ValueError('condition must be provided') @@ -16251,6 +16719,7 @@ def create_load_balancer_listener_policy_rule(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['load_balancer_id', 'listener_id', 'policy_id'] @@ -16289,13 +16758,13 @@ def delete_load_balancer_listener_policy_rule(self, :rtype: DetailedResponse """ - if load_balancer_id is None: + if not load_balancer_id: raise ValueError('load_balancer_id must be provided') - if listener_id is None: + if not listener_id: raise ValueError('listener_id must be provided') - if policy_id is None: + if not policy_id: raise ValueError('policy_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -16310,6 +16779,7 @@ def delete_load_balancer_listener_policy_rule(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['load_balancer_id', 'listener_id', 'policy_id', 'id'] path_param_values = self.encode_path_vars(load_balancer_id, listener_id, policy_id, id) @@ -16345,13 +16815,13 @@ def get_load_balancer_listener_policy_rule(self, :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListenerPolicyRule` object """ - if load_balancer_id is None: + if not load_balancer_id: raise ValueError('load_balancer_id must be provided') - if listener_id is None: + if not listener_id: raise ValueError('listener_id must be provided') - if policy_id is None: + if not policy_id: raise ValueError('policy_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -16366,6 +16836,7 @@ def get_load_balancer_listener_policy_rule(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['load_balancer_id', 'listener_id', 'policy_id', 'id'] @@ -16405,13 +16876,13 @@ def update_load_balancer_listener_policy_rule(self, :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListenerPolicyRule` object """ - if load_balancer_id is None: + if not load_balancer_id: raise ValueError('load_balancer_id must be provided') - if listener_id is None: + if not listener_id: raise ValueError('listener_id must be provided') - if policy_id is None: + if not policy_id: raise ValueError('policy_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') if load_balancer_listener_policy_rule_patch is None: raise ValueError('load_balancer_listener_policy_rule_patch must be provided') @@ -16433,6 +16904,7 @@ def update_load_balancer_listener_policy_rule(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['load_balancer_id', 'listener_id', 'policy_id', 'id'] @@ -16464,7 +16936,7 @@ def list_load_balancer_pools(self, :rtype: DetailedResponse with `dict` result representing a `LoadBalancerPoolCollection` object """ - if load_balancer_id is None: + if not load_balancer_id: raise ValueError('load_balancer_id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -16479,6 +16951,7 @@ def list_load_balancer_pools(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['load_balancer_id'] @@ -16540,7 +17013,7 @@ def create_load_balancer_pool(self, :rtype: DetailedResponse with `dict` result representing a `LoadBalancerPool` object """ - if load_balancer_id is None: + if not load_balancer_id: raise ValueError('load_balancer_id must be provided') if algorithm is None: raise ValueError('algorithm must be provided') @@ -16579,6 +17052,7 @@ def create_load_balancer_pool(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['load_balancer_id'] @@ -16613,9 +17087,9 @@ def delete_load_balancer_pool(self, :rtype: DetailedResponse """ - if load_balancer_id is None: + if not load_balancer_id: raise ValueError('load_balancer_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -16630,6 +17104,7 @@ def delete_load_balancer_pool(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['load_balancer_id', 'id'] path_param_values = self.encode_path_vars(load_balancer_id, id) @@ -16661,9 +17136,9 @@ def get_load_balancer_pool(self, :rtype: DetailedResponse with `dict` result representing a `LoadBalancerPool` object """ - if load_balancer_id is None: + if not load_balancer_id: raise ValueError('load_balancer_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -16678,6 +17153,7 @@ def get_load_balancer_pool(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['load_balancer_id', 'id'] @@ -16713,9 +17189,9 @@ def update_load_balancer_pool(self, :rtype: DetailedResponse with `dict` result representing a `LoadBalancerPool` object """ - if load_balancer_id is None: + if not load_balancer_id: raise ValueError('load_balancer_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') if load_balancer_pool_patch is None: raise ValueError('load_balancer_pool_patch must be provided') @@ -16737,6 +17213,7 @@ def update_load_balancer_pool(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['load_balancer_id', 'id'] @@ -16770,9 +17247,9 @@ def list_load_balancer_pool_members(self, :rtype: DetailedResponse with `dict` result representing a `LoadBalancerPoolMemberCollection` object """ - if load_balancer_id is None: + if not load_balancer_id: raise ValueError('load_balancer_id must be provided') - if pool_id is None: + if not pool_id: raise ValueError('pool_id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -16787,6 +17264,7 @@ def list_load_balancer_pool_members(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['load_balancer_id', 'pool_id'] @@ -16842,9 +17320,9 @@ def create_load_balancer_pool_member(self, :rtype: DetailedResponse with `dict` result representing a `LoadBalancerPoolMember` object """ - if load_balancer_id is None: + if not load_balancer_id: raise ValueError('load_balancer_id must be provided') - if pool_id is None: + if not pool_id: raise ValueError('pool_id must be provided') if port is None: raise ValueError('port must be provided') @@ -16873,6 +17351,7 @@ def create_load_balancer_pool_member(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['load_balancer_id', 'pool_id'] @@ -16910,9 +17389,9 @@ def replace_load_balancer_pool_members(self, :rtype: DetailedResponse with `dict` result representing a `LoadBalancerPoolMemberCollection` object """ - if load_balancer_id is None: + if not load_balancer_id: raise ValueError('load_balancer_id must be provided') - if pool_id is None: + if not pool_id: raise ValueError('pool_id must be provided') if members is None: raise ValueError('members must be provided') @@ -16937,6 +17416,7 @@ def replace_load_balancer_pool_members(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['load_balancer_id', 'pool_id'] @@ -16972,11 +17452,11 @@ def delete_load_balancer_pool_member(self, :rtype: DetailedResponse """ - if load_balancer_id is None: + if not load_balancer_id: raise ValueError('load_balancer_id must be provided') - if pool_id is None: + if not pool_id: raise ValueError('pool_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -16991,6 +17471,7 @@ def delete_load_balancer_pool_member(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['load_balancer_id', 'pool_id', 'id'] path_param_values = self.encode_path_vars(load_balancer_id, pool_id, id) @@ -17025,11 +17506,11 @@ def get_load_balancer_pool_member(self, :rtype: DetailedResponse with `dict` result representing a `LoadBalancerPoolMember` object """ - if load_balancer_id is None: + if not load_balancer_id: raise ValueError('load_balancer_id must be provided') - if pool_id is None: + if not pool_id: raise ValueError('pool_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -17044,6 +17525,7 @@ def get_load_balancer_pool_member(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['load_balancer_id', 'pool_id', 'id'] @@ -17081,11 +17563,11 @@ def update_load_balancer_pool_member(self, :rtype: DetailedResponse with `dict` result representing a `LoadBalancerPoolMember` object """ - if load_balancer_id is None: + if not load_balancer_id: raise ValueError('load_balancer_id must be provided') - if pool_id is None: + if not pool_id: raise ValueError('pool_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') if load_balancer_pool_member_patch is None: raise ValueError('load_balancer_pool_member_patch must be provided') @@ -17107,6 +17589,7 @@ def update_load_balancer_pool_member(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['load_balancer_id', 'pool_id', 'id'] @@ -17170,6 +17653,7 @@ def list_endpoint_gateways(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' url = '/endpoint_gateways' @@ -17198,9 +17682,10 @@ def create_endpoint_gateway(self, This request creates a new endpoint gateway. An endpoint gateway maps one or more reserved IPs in a VPC to a target outside the VPC. - :param EndpointGatewayTargetPrototype target: The target for this endpoint - gateway. - :param VPCIdentity vpc: The VPC this endpoint gateway will serve. + :param EndpointGatewayTargetPrototype target: The target to use for this + endpoint gateway. Must not already be the target of another + endpoint gateway in the VPC. + :param VPCIdentity vpc: The VPC this endpoint gateway will reside in. :param List[EndpointGatewayReservedIP] ips: (optional) The reserved IPs to bind to this endpoint gateway. At most one reserved IP per zone is allowed. :param str name: (optional) The user-defined name for this endpoint @@ -17256,6 +17741,7 @@ def create_endpoint_gateway(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' url = '/endpoint_gateways' @@ -17296,7 +17782,7 @@ def list_endpoint_gateway_ips(self, :rtype: DetailedResponse with `dict` result representing a `ReservedIPCollectionEndpointGatewayContext` object """ - if endpoint_gateway_id is None: + if not endpoint_gateway_id: raise ValueError('endpoint_gateway_id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -17314,6 +17800,7 @@ def list_endpoint_gateway_ips(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['endpoint_gateway_id'] @@ -17348,9 +17835,9 @@ def remove_endpoint_gateway_ip(self, :rtype: DetailedResponse """ - if endpoint_gateway_id is None: + if not endpoint_gateway_id: raise ValueError('endpoint_gateway_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -17365,6 +17852,7 @@ def remove_endpoint_gateway_ip(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['endpoint_gateway_id', 'id'] path_param_values = self.encode_path_vars(endpoint_gateway_id, id) @@ -17397,9 +17885,9 @@ def get_endpoint_gateway_ip(self, :rtype: DetailedResponse with `dict` result representing a `ReservedIP` object """ - if endpoint_gateway_id is None: + if not endpoint_gateway_id: raise ValueError('endpoint_gateway_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -17414,6 +17902,7 @@ def get_endpoint_gateway_ip(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['endpoint_gateway_id', 'id'] @@ -17450,9 +17939,9 @@ def add_endpoint_gateway_ip(self, :rtype: DetailedResponse with `dict` result representing a `ReservedIP` object """ - if endpoint_gateway_id is None: + if not endpoint_gateway_id: raise ValueError('endpoint_gateway_id must be provided') - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -17467,6 +17956,7 @@ def add_endpoint_gateway_ip(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['endpoint_gateway_id', 'id'] @@ -17499,7 +17989,7 @@ def delete_endpoint_gateway(self, :rtype: DetailedResponse """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -17514,6 +18004,7 @@ def delete_endpoint_gateway(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['id'] path_param_values = self.encode_path_vars(id) @@ -17544,7 +18035,7 @@ def get_endpoint_gateway(self, :rtype: DetailedResponse with `dict` result representing a `EndpointGateway` object """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -17559,6 +18050,7 @@ def get_endpoint_gateway(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -17592,7 +18084,7 @@ def update_endpoint_gateway(self, :rtype: DetailedResponse with `dict` result representing a `EndpointGateway` object """ - if id is None: + if not id: raise ValueError('id must be provided') if endpoint_gateway_patch is None: raise ValueError('endpoint_gateway_patch must be provided') @@ -17614,6 +18106,7 @@ def update_endpoint_gateway(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -17698,6 +18191,7 @@ def list_flow_log_collectors(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' url = '/flow_log_collectors' @@ -17784,6 +18278,7 @@ def create_flow_log_collector(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' url = '/flow_log_collectors' @@ -17815,7 +18310,7 @@ def delete_flow_log_collector(self, :rtype: DetailedResponse """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -17830,6 +18325,7 @@ def delete_flow_log_collector(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] path_param_keys = ['id'] path_param_values = self.encode_path_vars(id) @@ -17860,7 +18356,7 @@ def get_flow_log_collector(self, :rtype: DetailedResponse with `dict` result representing a `FlowLogCollector` object """ - if id is None: + if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, @@ -17875,6 +18371,7 @@ def get_flow_log_collector(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -17911,7 +18408,7 @@ def update_flow_log_collector(self, :rtype: DetailedResponse with `dict` result representing a `FlowLogCollector` object """ - if id is None: + if not id: raise ValueError('id must be provided') if flow_log_collector_patch is None: raise ValueError('flow_log_collector_patch must be provided') @@ -17933,6 +18430,7 @@ def update_flow_log_collector(self, if 'headers' in kwargs: headers.update(kwargs.get('headers')) + del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['id'] @@ -18032,6 +18530,16 @@ class ListVpnGatewaysEnums: Enums for list_vpn_gateways parameters. """ + class Sort(str, Enum): + """ + Sorts the returned collection by the specified property name in ascending order. A + `-` may be prepended to the name to sort in descending order. For example, the + value `-created_at` sorts the collection by the `created_at` property in + descending order, and the value `name` sorts it by the `name` property in + ascending order. + """ + CREATED_AT = 'created_at' + NAME = 'name' class Mode(str, Enum): """ Filters the collection to VPN gateways with the specified mode. @@ -19742,7 +20250,7 @@ class BackupPolicyPlanReference(): BackupPolicyPlanReference. :attr BackupPolicyPlanReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted and provides + property indicates the referenced resource has been deleted, and provides some supplementary information. :attr str href: The URL for this backup policy plan. :attr str id: The unique identifier for this backup policy plan. @@ -19765,7 +20273,7 @@ def __init__(self, :param str name: The unique user-defined name for this backup policy plan. :param str resource_type: The resource type. :param BackupPolicyPlanReferenceDeleted deleted: (optional) If present, - this property indicates the referenced resource has been deleted and + this property indicates the referenced resource has been deleted, and provides some supplementary information. """ @@ -19846,7 +20354,7 @@ class ResourceTypeEnum(str, Enum): class BackupPolicyPlanReferenceDeleted(): """ - If present, this property indicates the referenced resource has been deleted and + 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. @@ -19928,8 +20436,9 @@ class BareMetalServer(): interface. :attr NetworkInterfaceBareMetalServerContextReference primary_network_interface: Primary network interface. - :attr BareMetalServerProfileReference profile: The profile this bare metal - server uses. + :attr BareMetalServerProfileReference profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-bare-metal-servers-profile) + for this bare metal server. :attr ResourceGroupReference resource_group: The resource group for this bare metal server. :attr str resource_type: The resource type. @@ -19994,8 +20503,9 @@ def __init__(self, including the primary network interface. :param NetworkInterfaceBareMetalServerContextReference primary_network_interface: Primary network interface. - :param BareMetalServerProfileReference profile: The profile this bare metal - server uses. + :param BareMetalServerProfileReference profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-bare-metal-servers-profile) + for this bare metal server. :param ResourceGroupReference resource_group: The resource group for this bare metal server. :param str resource_type: The resource type. @@ -20667,6 +21177,9 @@ class BareMetalServerDisk(): :attr str href: The URL for this bare metal server disk. :attr str id: The unique identifier for this bare metal server disk. :attr str interface_type: The disk interface used for attaching the disk. + - `fcp`: Attached using Fiber Channel Protocol + - `sata`: Attached using Serial Advanced Technology Attachment + - `nvme`: Attached using Non-Volatile Memory Express 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 resource on which the unexpected @@ -20691,6 +21204,9 @@ def __init__(self, :param str href: The URL for this bare metal server disk. :param str id: The unique identifier for this bare metal server disk. :param str interface_type: The disk interface used for attaching the disk. + - `fcp`: Attached using Fiber Channel Protocol + - `sata`: Attached using Serial Advanced Technology Attachment + - `nvme`: Attached using Non-Volatile Memory Express 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 resource on @@ -20786,11 +21302,15 @@ def __ne__(self, other: 'BareMetalServerDisk') -> bool: class InterfaceTypeEnum(str, Enum): """ The disk interface used for attaching the disk. + - `fcp`: Attached using Fiber Channel Protocol + - `sata`: Attached using Serial Advanced Technology Attachment + - `nvme`: Attached using Non-Volatile Memory Express 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 resource on which the unexpected property value was encountered. """ + FCP = 'fcp' NVME = 'nvme' SATA = 'sata' @@ -20917,7 +21437,7 @@ def __ne__(self, other: 'BareMetalServerDiskPatch') -> bool: class BareMetalServerDiskReferenceDeleted(): """ - If present, this property indicates the referenced resource has been deleted and + 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. @@ -21190,15 +21710,19 @@ class BareMetalServerNetworkInterface(): - The VPC infrastructure performs any needed NAT operations. - A single floating IP can be assigned to the network interface. If `false`: - - Packets are passed unmodified to/from the network interface, + - Packets are passed unchanged to/from the network interface, allowing the workload to perform any needed NAT operations. - Multiple floating IPs can be assigned to the network interface. - `allow_ip_spoofing` must be set to `false`. + This must be `true` when `interface_type` is `hipersocket`. :attr List[FloatingIPReference] floating_ips: (optional) The floating IPs associated with this network interface. :attr str href: The URL for this network interface. :attr str id: The unique identifier for this network interface. :attr str interface_type: The network interface type: + - `hipersocket`: a virtual network device that provides high-speed TCP/IP + connectivity + within a `s390x` based system - `pci`: a physical PCI device which can only be created or deleted when the bare metal server is stopped @@ -21213,6 +21737,10 @@ class BareMetalServerNetworkInterface(): - Has its own security groups and does not inherit those of the PCI device through which traffic flows. + 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 resource on which the unexpected + property value was encountered. :attr str mac_address: The MAC address of the interface. If absent, the value is not known. :attr str name: The user-defined name for this network interface. @@ -21256,13 +21784,17 @@ def __init__(self, - The VPC infrastructure performs any needed NAT operations. - A single floating IP can be assigned to the network interface. If `false`: - - Packets are passed unmodified to/from the network interface, + - Packets are passed unchanged to/from the network interface, allowing the workload to perform any needed NAT operations. - Multiple floating IPs can be assigned to the network interface. - `allow_ip_spoofing` must be set to `false`. + This must be `true` when `interface_type` is `hipersocket`. :param str href: The URL for this network interface. :param str id: The unique identifier for this network interface. :param str interface_type: The network interface type: + - `hipersocket`: a virtual network device that provides high-speed TCP/IP + connectivity + within a `s390x` based system - `pci`: a physical PCI device which can only be created or deleted when the bare metal server is stopped @@ -21277,6 +21809,10 @@ def __init__(self, - Has its own security groups and does not inherit those of the PCI device through which traffic flows. + 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 resource on + which the unexpected property value was encountered. :param str mac_address: The MAC address of the interface. If absent, the value is not known. :param str name: The user-defined name for this network interface. @@ -21292,7 +21828,7 @@ def __init__(self, associated with this network interface. """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['BareMetalServerNetworkInterfaceByPCI', 'BareMetalServerNetworkInterfaceByVLAN'])) + ", ".join(['BareMetalServerNetworkInterfaceByHiperSocket', 'BareMetalServerNetworkInterfaceByPCI', 'BareMetalServerNetworkInterfaceByVLAN'])) raise Exception(msg) @classmethod @@ -21303,7 +21839,7 @@ def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterface': return disc_class.from_dict(_dict) msg = ("Cannot convert dictionary into an instance of base class 'BareMetalServerNetworkInterface'. " + "The discriminator value should map to a valid subclass: {1}").format( - ", ".join(['BareMetalServerNetworkInterfaceByPCI', 'BareMetalServerNetworkInterfaceByVLAN'])) + ", ".join(['BareMetalServerNetworkInterfaceByHiperSocket', 'BareMetalServerNetworkInterfaceByPCI', 'BareMetalServerNetworkInterfaceByVLAN'])) raise Exception(msg) @classmethod @@ -21314,6 +21850,7 @@ def _from_dict(cls, _dict: Dict): @classmethod def _get_class_by_discriminator(cls, _dict: Dict) -> object: mapping = {} + mapping['hipersocket'] = 'BareMetalServerNetworkInterfaceByHiperSocket' mapping['pci'] = 'BareMetalServerNetworkInterfaceByPCI' mapping['vlan'] = 'BareMetalServerNetworkInterfaceByVLAN' disc_value = _dict.get('interface_type') @@ -21331,6 +21868,9 @@ def _get_class_by_discriminator(cls, _dict: Dict) -> object: class InterfaceTypeEnum(str, Enum): """ The network interface type: + - `hipersocket`: a virtual network device that provides high-speed TCP/IP + connectivity + within a `s390x` based system - `pci`: a physical PCI device which can only be created or deleted when the bare metal server is stopped @@ -21344,7 +21884,12 @@ class InterfaceTypeEnum(str, Enum): - Has its own security groups and does not inherit those of the PCI device through which traffic flows. + 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 resource on which the unexpected + property value was encountered. """ + HIPERSOCKET = 'hipersocket' PCI = 'pci' VLAN = 'vlan' @@ -21600,16 +22145,16 @@ class BareMetalServerNetworkInterfacePatch(): allowed on this interface. If false, source IP spoofing is prevented on this interface. If true, source IP spoofing is allowed on this interface. :attr List[int] allowed_vlans: (optional) Indicates what VLAN IDs (for VLAN type - only) can use this physical (PCI type) interface. A given VLAN can only be in - the `allowed_vlans` array for one PCI type adapter per bare metal server. + only) can use this physical (PCI type) interface. :attr bool enable_infrastructure_nat: (optional) If `true`: - The VPC infrastructure performs any needed NAT operations. - A single floating IP can be assigned to the network interface. If `false`: - - Packets are passed unmodified to/from the network interface, + - Packets are passed unchanged to/from the network interface, allowing the workload to perform any needed NAT operations. - Multiple floating IPs can be assigned to the network interface. - `allow_ip_spoofing` must be set to `false`. + This must be `true` when `interface_type` is `hipersocket`. :attr str name: (optional) The user-defined name for network interface. Names must be unique within the instance the network interface resides in. """ @@ -21628,17 +22173,16 @@ def __init__(self, prevented on this interface. If true, source IP spoofing is allowed on this interface. :param List[int] allowed_vlans: (optional) Indicates what VLAN IDs (for - VLAN type only) can use this physical (PCI type) interface. A given VLAN - can only be in the `allowed_vlans` array for one PCI type adapter per bare - metal server. + VLAN type only) can use this physical (PCI type) interface. :param bool enable_infrastructure_nat: (optional) If `true`: - The VPC infrastructure performs any needed NAT operations. - A single floating IP can be assigned to the network interface. If `false`: - - Packets are passed unmodified to/from the network interface, + - Packets are passed unchanged to/from the network interface, allowing the workload to perform any needed NAT operations. - Multiple floating IPs can be assigned to the network interface. - `allow_ip_spoofing` must be set to `false`. + This must be `true` when `interface_type` is `hipersocket`. :param str name: (optional) The user-defined name for network interface. Names must be unique within the instance the network interface resides in. """ @@ -21708,11 +22252,16 @@ class BareMetalServerNetworkInterfacePrototype(): - The VPC infrastructure performs any needed NAT operations. - A single floating IP can be assigned to the network interface. If `false`: - - Packets are passed unmodified to/from the network interface, + - Packets are passed unchanged to/from the network interface, allowing the workload to perform any needed NAT operations. - Multiple floating IPs can be assigned to the network interface. - `allow_ip_spoofing` must be set to `false`. + This must be `true` when `interface_type` is `hipersocket`. :attr str interface_type: The network interface type: + - `hipersocket`: a virtual network device that provides high-speed TCP/IP + connectivity + within a `s390x` based system + - Not supported on bare metal servers with a `cpu.architecture` of `amd64` - `pci`: a physical PCI device which can only be created or deleted when the bare metal server is stopped @@ -21720,6 +22269,7 @@ class BareMetalServerNetworkInterfacePrototype(): permitted to use the PCI interface - Cannot directly use an IEEE 802.1q VLAN tag. + - Not supported on bare metal servers with a `cpu.architecture` of `s390x` - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its array of `allowed_vlans`. @@ -21727,6 +22277,7 @@ class BareMetalServerNetworkInterfacePrototype(): - Has its own security groups and does not inherit those of the PCI device through which traffic flows. + - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. :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. @@ -21757,6 +22308,11 @@ def __init__(self, Initialize a BareMetalServerNetworkInterfacePrototype object. :param str interface_type: The network interface type: + - `hipersocket`: a virtual network device that provides high-speed TCP/IP + connectivity + within a `s390x` based system + - Not supported on bare metal servers with a `cpu.architecture` of + `amd64` - `pci`: a physical PCI device which can only be created or deleted when the bare metal server is stopped @@ -21764,6 +22320,8 @@ def __init__(self, permitted to use the PCI interface - Cannot directly use an IEEE 802.1q VLAN tag. + - Not supported on bare metal servers with a `cpu.architecture` of + `s390x` - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its array of `allowed_vlans`. @@ -21771,6 +22329,8 @@ def __init__(self, - Has its own security groups and does not inherit those of the PCI device through which traffic flows. + - Not supported on bare metal servers with a `cpu.architecture` of + `s390x`. :param SubnetIdentity subnet: The associated subnet. :param bool allow_ip_spoofing: (optional) Indicates whether source IP spoofing is allowed on this interface. If false, source IP spoofing is @@ -21780,10 +22340,11 @@ def __init__(self, - The VPC infrastructure performs any needed NAT operations. - A single floating IP can be assigned to the network interface. If `false`: - - Packets are passed unmodified to/from the network interface, + - Packets are passed unchanged to/from the network interface, allowing the workload to perform any needed NAT operations. - Multiple floating IPs can be assigned to the network interface. - `allow_ip_spoofing` must be set to `false`. + This must be `true` when `interface_type` is `hipersocket`. :param 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 @@ -21801,7 +22362,7 @@ def __init__(self, security group is used. """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype', 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype'])) + ", ".join(['BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype', 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype', 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype'])) raise Exception(msg) @classmethod @@ -21812,7 +22373,7 @@ def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfacePrototype': return disc_class.from_dict(_dict) msg = ("Cannot convert dictionary into an instance of base class 'BareMetalServerNetworkInterfacePrototype'. " + "The discriminator value should map to a valid subclass: {1}").format( - ", ".join(['BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype', 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype'])) + ", ".join(['BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype', 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype', 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype'])) raise Exception(msg) @classmethod @@ -21823,6 +22384,7 @@ def _from_dict(cls, _dict: Dict): @classmethod def _get_class_by_discriminator(cls, _dict: Dict) -> object: mapping = {} + mapping['hipersocket'] = 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype' mapping['pci'] = 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype' mapping['vlan'] = 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype' disc_value = _dict.get('interface_type') @@ -21840,6 +22402,10 @@ def _get_class_by_discriminator(cls, _dict: Dict) -> object: class InterfaceTypeEnum(str, Enum): """ The network interface type: + - `hipersocket`: a virtual network device that provides high-speed TCP/IP + connectivity + within a `s390x` based system + - Not supported on bare metal servers with a `cpu.architecture` of `amd64` - `pci`: a physical PCI device which can only be created or deleted when the bare metal server is stopped @@ -21847,13 +22413,16 @@ class InterfaceTypeEnum(str, Enum): permitted to use the PCI interface - Cannot directly use an IEEE 802.1q VLAN tag. + - Not supported on bare metal servers with a `cpu.architecture` of `s390x` - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its array of `allowed_vlans`. - Must use an IEEE 802.1q tag. - Has its own security groups and does not inherit those of the PCI device through which traffic flows. + - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. """ + HIPERSOCKET = 'hipersocket' PCI = 'pci' VLAN = 'vlan' @@ -21923,17 +22492,21 @@ class BareMetalServerPrimaryNetworkInterfacePrototype(): allowed on this interface. If false, source IP spoofing is prevented on this interface. If true, source IP spoofing is allowed on this interface. :attr List[int] allowed_vlans: (optional) Indicates what VLAN IDs (for VLAN type - only) can use this physical (PCI type) interface. A given VLAN can only be in - the `allowed_vlans` array for one PCI type adapter per bare metal server. + only) can use this physical (PCI type) interface. :attr bool enable_infrastructure_nat: (optional) If `true`: - The VPC infrastructure performs any needed NAT operations. - A single floating IP can be assigned to the network interface. If `false`: - - Packets are passed unmodified to/from the network interface, + - Packets are passed unchanged to/from the network interface, allowing the workload to perform any needed NAT operations. - Multiple floating IPs can be assigned to the network interface. - `allow_ip_spoofing` must be set to `false`. + This must be `true` when `interface_type` is `hipersocket`. :attr str interface_type: (optional) The network interface type: + - `hipersocket`: a virtual network device that provides high-speed TCP/IP + connectivity + within a `s390x` based system. + - Not supported on bare metal servers with a `cpu.architecture` of `amd64` - `pci`: a physical PCI device which can only be created or deleted when the bare metal server is stopped @@ -21941,6 +22514,7 @@ class BareMetalServerPrimaryNetworkInterfacePrototype(): permitted to use the PCI interface - Cannot directly use an IEEE 802.1q VLAN tag. + - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. :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. @@ -21977,18 +22551,22 @@ def __init__(self, prevented on this interface. If true, source IP spoofing is allowed on this interface. :param List[int] allowed_vlans: (optional) Indicates what VLAN IDs (for - VLAN type only) can use this physical (PCI type) interface. A given VLAN - can only be in the `allowed_vlans` array for one PCI type adapter per bare - metal server. + VLAN type only) can use this physical (PCI type) interface. :param bool enable_infrastructure_nat: (optional) If `true`: - The VPC infrastructure performs any needed NAT operations. - A single floating IP can be assigned to the network interface. If `false`: - - Packets are passed unmodified to/from the network interface, + - Packets are passed unchanged to/from the network interface, allowing the workload to perform any needed NAT operations. - Multiple floating IPs can be assigned to the network interface. - `allow_ip_spoofing` must be set to `false`. + This must be `true` when `interface_type` is `hipersocket`. :param str interface_type: (optional) The network interface type: + - `hipersocket`: a virtual network device that provides high-speed TCP/IP + connectivity + within a `s390x` based system. + - Not supported on bare metal servers with a `cpu.architecture` of + `amd64` - `pci`: a physical PCI device which can only be created or deleted when the bare metal server is stopped @@ -21996,6 +22574,8 @@ def __init__(self, permitted to use the PCI interface - Cannot directly use an IEEE 802.1q VLAN tag. + - Not supported on bare metal servers with a `cpu.architecture` of + `s390x`. :param 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 @@ -22104,6 +22684,10 @@ def __ne__(self, other: 'BareMetalServerPrimaryNetworkInterfacePrototype') -> bo class InterfaceTypeEnum(str, Enum): """ The network interface type: + - `hipersocket`: a virtual network device that provides high-speed TCP/IP + connectivity + within a `s390x` based system. + - Not supported on bare metal servers with a `cpu.architecture` of `amd64` - `pci`: a physical PCI device which can only be created or deleted when the bare metal server is stopped @@ -22111,7 +22695,9 @@ class InterfaceTypeEnum(str, Enum): permitted to use the PCI interface - Cannot directly use an IEEE 802.1q VLAN tag. + - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. """ + HIPERSOCKET = 'hipersocket' PCI = 'pci' @@ -22773,6 +23359,9 @@ class BareMetalServerProfileDiskSupportedInterfaces(): BareMetalServerProfileDiskSupportedInterfaces. :attr str default: The disk interface used for attaching the disk. + - `fcp`: Attached using Fiber Channel Protocol + - `sata`: Attached using Serial Advanced Technology Attachment + - `nvme`: Attached using Non-Volatile Memory Express 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 resource on which the unexpected @@ -22790,6 +23379,9 @@ def __init__(self, Initialize a BareMetalServerProfileDiskSupportedInterfaces object. :param str default: The disk interface used for attaching the disk. + - `fcp`: Attached using Fiber Channel Protocol + - `sata`: Attached using Serial Advanced Technology Attachment + - `nvme`: Attached using Non-Volatile Memory Express 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 resource on @@ -22857,11 +23449,15 @@ def __ne__(self, other: 'BareMetalServerProfileDiskSupportedInterfaces') -> bool class DefaultEnum(str, Enum): """ The disk interface used for attaching the disk. + - `fcp`: Attached using Fiber Channel Protocol + - `sata`: Attached using Serial Advanced Technology Attachment + - `nvme`: Attached using Non-Volatile Memory Express 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 resource on which the unexpected property value was encountered. """ + FCP = 'fcp' NVME = 'nvme' SATA = 'sata' @@ -22876,11 +23472,15 @@ class TypeEnum(str, Enum): class ValuesEnum(str, Enum): """ The disk interface used for attaching the disk. + - `fcp`: Attached using Fiber Channel Protocol + - `sata`: Attached using Serial Advanced Technology Attachment + - `nvme`: Attached using Non-Volatile Memory Express 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 resource on which the unexpected property value was encountered. """ + FCP = 'fcp' NVME = 'nvme' SATA = 'sata' @@ -23371,6 +23971,100 @@ class ModeEnum(str, Enum): TPM_2_WITH_TXT = 'tpm_2_with_txt' +class CatalogOfferingIdentity(): + """ + Identifies a + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering + by a unique property. + + """ + + def __init__(self) -> None: + """ + Initialize a CatalogOfferingIdentity object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['CatalogOfferingIdentityCatalogOfferingByCRN'])) + raise Exception(msg) + +class CatalogOfferingVersionIdentity(): + """ + Identifies a version of a + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering + by a unique property. + + """ + + def __init__(self) -> None: + """ + Initialize a CatalogOfferingVersionIdentity object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN'])) + raise Exception(msg) + +class CatalogOfferingVersionReference(): + """ + CatalogOfferingVersionReference. + + :attr str crn: The CRN for this version of a + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + offering. + """ + + def __init__(self, + crn: str) -> None: + """ + Initialize a CatalogOfferingVersionReference object. + + :param str crn: The CRN for this version of a + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + offering. + """ + self.crn = crn + + @classmethod + def from_dict(cls, _dict: Dict) -> 'CatalogOfferingVersionReference': + """Initialize a CatalogOfferingVersionReference object from a json dictionary.""" + args = {} + if 'crn' in _dict: + args['crn'] = _dict.get('crn') + else: + raise ValueError('Required property \'crn\' not present in CatalogOfferingVersionReference JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a CatalogOfferingVersionReference object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, '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 CatalogOfferingVersionReference object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'CatalogOfferingVersionReference') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'CatalogOfferingVersionReference') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + class CertificateInstanceIdentity(): """ Identifies a certificate instance by a unique property. @@ -23464,8 +24158,9 @@ class DedicatedHost(): :attr str lifecycle_state: The lifecycle state of the dedicated host. :attr int memory: The total amount of memory in gibibytes for this host. :attr str name: The unique user-defined name for this dedicated host. - :attr DedicatedHostProfileReference profile: The profile this dedicated host - uses. + :attr DedicatedHostProfileReference profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) for this + dedicated host. :attr bool provisionable: Indicates whether this dedicated host is available for instance creation. :attr ResourceGroupReference resource_group: The resource group for this @@ -23528,8 +24223,9 @@ def __init__(self, :param str lifecycle_state: The lifecycle state of the dedicated host. :param int memory: The total amount of memory in gibibytes for this host. :param str name: The unique user-defined name for this dedicated host. - :param DedicatedHostProfileReference profile: The profile this dedicated - host uses. + :param DedicatedHostProfileReference profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) for this + dedicated host. :param bool provisionable: Indicates whether this dedicated host is available for instance creation. :param ResourceGroupReference resource_group: The resource group for this @@ -24880,7 +25576,7 @@ class DedicatedHostGroupReference(): :attr str crn: The CRN for this dedicated host group. :attr DedicatedHostGroupReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted and provides + property indicates the referenced resource has been deleted, and provides some supplementary information. :attr str href: The URL for this dedicated host group. :attr str id: The unique identifier for this dedicated host group. @@ -24906,7 +25602,7 @@ def __init__(self, group. :param str resource_type: The resource type. :param DedicatedHostGroupReferenceDeleted deleted: (optional) If present, - this property indicates the referenced resource has been deleted and + this property indicates the referenced resource has been deleted, and provides some supplementary information. """ @@ -24994,7 +25690,7 @@ class ResourceTypeEnum(str, Enum): class DedicatedHostGroupReferenceDeleted(): """ - If present, this property indicates the referenced resource has been deleted and + 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. @@ -26142,7 +26838,8 @@ class DedicatedHostPrototype(): be placed on this dedicated host. :attr str name: (optional) The unique user-defined name for this dedicated host. If unspecified, the name will be a hyphenated list of randomly-selected words. - :attr DedicatedHostProfileIdentity profile: The profile to use for this + :attr DedicatedHostProfileIdentity profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) to use for this dedicated host. :attr ResourceGroupIdentity resource_group: (optional) The resource group to use. If unspecified, the account's [default resource @@ -26158,7 +26855,9 @@ def __init__(self, """ Initialize a DedicatedHostPrototype object. - :param DedicatedHostProfileIdentity profile: The profile to use for this + :param DedicatedHostProfileIdentity profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) to use for + this dedicated host. :param bool instance_placement_enabled: (optional) If set to true, instances can be placed on this dedicated host. @@ -26180,7 +26879,7 @@ class DedicatedHostReference(): :attr str crn: The CRN for this dedicated host. :attr DedicatedHostReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted and provides + property indicates the referenced resource has been deleted, and provides some supplementary information. :attr str href: The URL for this dedicated host. :attr str id: The unique identifier for this dedicated host. @@ -26205,7 +26904,7 @@ def __init__(self, :param str name: The unique user-defined name for this dedicated host. :param str resource_type: The resource type. :param DedicatedHostReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted and provides + property indicates the referenced resource has been deleted, and provides some supplementary information. """ self.crn = crn @@ -26292,7 +26991,7 @@ class ResourceTypeEnum(str, Enum): class DedicatedHostReferenceDeleted(): """ - If present, this property indicates the referenced resource has been deleted and + 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. @@ -26367,7 +27066,7 @@ class DefaultNetworkACL(): or removed. :attr List[SubnetReference] subnets: The subnets to which this network ACL is attached. - :attr VPCReference vpc: The VPC this network ACL is a part of. + :attr VPCReference vpc: The VPC this network ACL resides in. """ def __init__(self, @@ -26400,7 +27099,7 @@ def __init__(self, changed, added, or removed. :param List[SubnetReference] subnets: The subnets to which this network ACL is attached. - :param VPCReference vpc: The VPC this network ACL is a part of. + :param VPCReference vpc: The VPC this network ACL resides in. """ self.created_at = created_at self.crn = crn @@ -26522,16 +27221,28 @@ class DefaultRoutingTable(): :attr str resource_type: The resource type. :attr bool route_direct_link_ingress: Indicates whether this routing table is used to route traffic that originates from - [Direct Link](https://cloud.ibm.com/docs/dl/) to this VPC. + [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 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_internet_ingress: Indicates whether this routing table is used + to route traffic that originates from the internet. + Incoming traffic will be routed according to the routing table with two + exceptions: + - Traffic destined for IP addresses associated with public gateways will not be + subject to routes in this routing table. + - Routes with an action of deliver are treated as drop 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. :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. + Gateway](https://cloud.ibm.com/docs/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 bound to a network interface on a subnet in the @@ -26563,6 +27274,7 @@ def __init__(self, name: str, resource_type: str, route_direct_link_ingress: bool, + route_internet_ingress: bool, route_transit_gateway_ingress: bool, route_vpc_zone_ingress: bool, routes: List['RouteReference'], @@ -26588,16 +27300,30 @@ def __init__(self, :param str resource_type: The resource type. :param bool route_direct_link_ingress: Indicates whether this routing table is used to route traffic that originates from - [Direct Link](https://cloud.ibm.com/docs/dl/) to this VPC. + [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 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_internet_ingress: Indicates whether this routing table is + used to route traffic that originates from the internet. + Incoming traffic will be routed according to the routing table with two + exceptions: + - Traffic destined for IP addresses associated with public gateways will + not be + subject to routes in this routing table. + - Routes with an action of deliver are treated as drop 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. + Gateway](https://cloud.ibm.com/docs/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 bound to a network interface on a @@ -26628,6 +27354,7 @@ def __init__(self, self.name = name self.resource_type = resource_type self.route_direct_link_ingress = route_direct_link_ingress + self.route_internet_ingress = route_internet_ingress self.route_transit_gateway_ingress = route_transit_gateway_ingress self.route_vpc_zone_ingress = route_vpc_zone_ingress self.routes = routes @@ -26673,6 +27400,10 @@ def from_dict(cls, _dict: Dict) -> 'DefaultRoutingTable': args['route_direct_link_ingress'] = _dict.get('route_direct_link_ingress') else: raise ValueError('Required property \'route_direct_link_ingress\' not present in DefaultRoutingTable JSON') + if 'route_internet_ingress' in _dict: + args['route_internet_ingress'] = _dict.get('route_internet_ingress') + else: + raise ValueError('Required property \'route_internet_ingress\' not present in DefaultRoutingTable JSON') if 'route_transit_gateway_ingress' in _dict: args['route_transit_gateway_ingress'] = _dict.get('route_transit_gateway_ingress') else: @@ -26717,6 +27448,8 @@ def to_dict(self) -> Dict: _dict['resource_type'] = self.resource_type if hasattr(self, 'route_direct_link_ingress') and self.route_direct_link_ingress is not None: _dict['route_direct_link_ingress'] = self.route_direct_link_ingress + if hasattr(self, 'route_internet_ingress') and self.route_internet_ingress is not None: + _dict['route_internet_ingress'] = self.route_internet_ingress if hasattr(self, 'route_transit_gateway_ingress') and self.route_transit_gateway_ingress is not None: _dict['route_transit_gateway_ingress'] = self.route_transit_gateway_ingress if hasattr(self, 'route_vpc_zone_ingress') and self.route_vpc_zone_ingress is not None: @@ -26785,7 +27518,7 @@ class DefaultSecurityGroup(): default security group may be changed, added or removed. :attr List[SecurityGroupTargetReference] targets: The targets for this security group. - :attr VPCReference vpc: The VPC this security group is a part of. + :attr VPCReference vpc: The VPC this security group resides in. """ def __init__(self, @@ -26818,7 +27551,7 @@ def __init__(self, removed. :param List[SecurityGroupTargetReference] targets: The targets for this security group. - :param VPCReference vpc: The VPC this security group is a part of. + :param VPCReference vpc: The VPC this security group resides in. """ self.created_at = created_at self.crn = crn @@ -27035,7 +27768,7 @@ class EndpointGateway(): :attr List[str] service_endpoints: The fully qualified domain names for the target service. :attr EndpointGatewayTarget target: The target for this endpoint gateway. - :attr VPCReference vpc: The VPC this endpoint gateway is serving. + :attr VPCReference vpc: The VPC this endpoint gateway resides in. """ def __init__(self, @@ -27085,7 +27818,7 @@ def __init__(self, :param List[str] service_endpoints: The fully qualified domain names for the target service. :param EndpointGatewayTarget target: The target for this endpoint gateway. - :param VPCReference vpc: The VPC this endpoint gateway is serving. + :param VPCReference vpc: The VPC this endpoint gateway resides in. :param str service_endpoint: (optional) The fully qualified domain name for the target service. """ @@ -27544,7 +28277,7 @@ def __ne__(self, other: 'EndpointGatewayPatch') -> bool: class EndpointGatewayReferenceDeleted(): """ - If present, this property indicates the referenced resource has been deleted and + 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. @@ -27634,7 +28367,8 @@ def __init__(self) -> None: class EndpointGatewayTargetPrototype(): """ - The target for this endpoint gateway. + The target to use for this endpoint gateway. Must not already be the target of another + endpoint gateway in the VPC. :attr str resource_type: The type of target for this endpoint gateway. """ @@ -28088,10 +28822,9 @@ class FloatingIPPatch(): :attr str name: (optional) The unique user-defined name for this floating IP. :attr FloatingIPTargetPatch target: (optional) The network interface to bind the - floating IP to, replacing any existing binding. For - this request to succeed, the floating IP must not be required by another - resource, such - as a public gateway. + floating IP to, replacing any existing binding. + The floating IP must not be required by another resource, such as a public + gateway. """ def __init__(self, @@ -28104,10 +28837,9 @@ def __init__(self, :param str name: (optional) The unique user-defined name for this floating IP. :param FloatingIPTargetPatch target: (optional) The network interface to - bind the floating IP to, replacing any existing binding. For - this request to succeed, the floating IP must not be required by another - resource, such - as a public gateway. + bind the floating IP to, replacing any existing binding. + The floating IP must not be required by another resource, such as a public + gateway. """ self.name = name self.target = target @@ -28194,7 +28926,7 @@ class FloatingIPReference(): :attr str address: The globally unique IP address. :attr str crn: The CRN for this floating IP. :attr FloatingIPReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted and provides + indicates the referenced resource has been deleted, and provides some supplementary information. :attr str href: The URL for this floating IP. :attr str id: The unique identifier for this floating IP. @@ -28218,7 +28950,7 @@ def __init__(self, :param str id: The unique identifier for this floating IP. :param str name: The unique user-defined name for this floating IP. :param FloatingIPReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted and provides + property indicates the referenced resource has been deleted, and provides some supplementary information. """ self.address = address @@ -28298,7 +29030,7 @@ def __ne__(self, other: 'FloatingIPReference') -> bool: class FloatingIPReferenceDeleted(): """ - If present, this property indicates the referenced resource has been deleted and + 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. @@ -28370,9 +29102,8 @@ def __init__(self) -> None: class FloatingIPTargetPatch(): """ - The network interface to bind the floating IP to, replacing any existing binding. For - this request to succeed, the floating IP must not be required by another resource, - such as a public gateway. + The network interface to bind the floating IP to, replacing any existing binding. The + floating IP must not be required by another resource, such as a public gateway. """ @@ -28461,11 +29192,19 @@ class FlowLogCollector(): :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 - within the - target that are themselves the target of a more specific flow log collector. - :attr VPCReference vpc: The VPC this flow log collector is associated with. + flow logs for. + - If the target is a network interface, flow logs will be collected + for that network interface. + - If the target is a virtual server instance, flow logs will be collected + for all network interfaces attached to that instance. + - If the target is a subnet, flow logs will be collected + for all network interfaces attached to that subnet. + - If the target is a VPC, flow logs will be collected for network interfaces + attached to all subnets within that VPC. + If the target is an instance, subnet, or VPC, flow logs will not be collected + for any network interfaces within the target that are themselves the target of + a more specific flow log collector. + :attr VPCReference vpc: The VPC this flow log collector resides in. """ def __init__(self, @@ -28500,13 +29239,22 @@ def __init__(self, :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 - within the - target that are themselves the target of a more specific flow log - collector. - :param VPCReference vpc: The VPC this flow log collector is associated - with. + collecting flow logs for. + - If the target is a network interface, flow logs will be collected + for that network interface. + - If the target is a virtual server instance, flow logs will be collected + for all network interfaces attached to that instance. + - If the target is a subnet, flow logs will be collected + for all network interfaces attached to that subnet. + - If the target is a VPC, flow logs will be collected for network + interfaces + attached to all subnets within that VPC. + If the target is an instance, subnet, or VPC, flow logs will not be + collected + for any network interfaces within the target that are themselves the target + of + a more specific flow log collector. + :param VPCReference vpc: The VPC this flow log collector resides in. """ self.active = active self.auto_delete = auto_delete @@ -28932,9 +29680,17 @@ def __ne__(self, other: 'FlowLogCollectorPatch') -> bool: class FlowLogCollectorTarget(): """ - 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 within the - target that are themselves the target of a more specific flow log collector. + The target this collector is collecting flow logs for. + - If the target is a network interface, flow logs will be collected + for that network interface. + - If the target is a virtual server instance, flow logs will be collected + for all network interfaces attached to that instance. + - If the target is a subnet, flow logs will be collected + for all network interfaces attached to that subnet. + - If the target is a VPC, flow logs will be collected for network interfaces + attached to all subnets within that VPC. If the target is an instance, subnet, or + VPC, flow logs will not be collected for any network interfaces within the target that + are themselves the target of a more specific flow log collector. """ @@ -28966,7 +29722,7 @@ def __init__(self) -> None: class GenericResourceReferenceDeleted(): """ - If present, this property indicates the referenced resource has been deleted and + 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. @@ -29025,12 +29781,15 @@ class IKEPolicy(): """ IKEPolicy. - :attr str authentication_algorithm: The authentication algorithm. + :attr str authentication_algorithm: The authentication algorithm + The `md5` and `sha1` algorithms have been deprecated. :attr List[VPNGatewayConnectionReference] connections: The VPN gateway connections that use this IKE policy. :attr datetime created_at: The date and time that this IKE policy was created. - :attr int dh_group: The Diffie-Hellman group. - :attr str encryption_algorithm: The encryption algorithm. + :attr int dh_group: The Diffie-Hellman group + Groups `2` and `5` have been deprecated. + :attr str encryption_algorithm: The encryption algorithm + The `triple_des` algorithm has been deprecated. :attr str href: The IKE policy's canonical URL. :attr str id: The unique identifier for this IKE policy. :attr int ike_version: The IKE protocol version. @@ -29059,13 +29818,16 @@ def __init__(self, """ Initialize a IKEPolicy object. - :param str authentication_algorithm: The authentication algorithm. + :param str authentication_algorithm: The authentication algorithm + The `md5` and `sha1` algorithms have been deprecated. :param List[VPNGatewayConnectionReference] connections: The VPN gateway connections that use this IKE policy. :param datetime created_at: The date and time that this IKE policy was created. - :param int dh_group: The Diffie-Hellman group. - :param str encryption_algorithm: The encryption algorithm. + :param int dh_group: The Diffie-Hellman group + Groups `2` and `5` have been deprecated. + :param str encryption_algorithm: The encryption algorithm + The `triple_des` algorithm has been deprecated. :param str href: The IKE policy's canonical URL. :param str id: The unique identifier for this IKE policy. :param int ike_version: The IKE protocol version. @@ -29205,19 +29967,23 @@ def __ne__(self, other: 'IKEPolicy') -> bool: class AuthenticationAlgorithmEnum(str, Enum): """ - The authentication algorithm. + The authentication algorithm + The `md5` and `sha1` algorithms have been deprecated. """ MD5 = 'md5' SHA1 = 'sha1' SHA256 = 'sha256' + SHA384 = 'sha384' SHA512 = 'sha512' class EncryptionAlgorithmEnum(str, Enum): """ - The encryption algorithm. + The encryption algorithm + The `triple_des` algorithm has been deprecated. """ AES128 = 'aes128' + AES192 = 'aes192' AES256 = 'aes256' TRIPLE_DES = 'triple_des' @@ -29455,9 +30221,12 @@ class IKEPolicyPatch(): """ IKEPolicyPatch. - :attr str authentication_algorithm: (optional) The authentication algorithm. - :attr int dh_group: (optional) The Diffie-Hellman group. - :attr str encryption_algorithm: (optional) The encryption algorithm. + :attr str authentication_algorithm: (optional) The authentication algorithm + The `md5` and `sha1` algorithms have been deprecated. + :attr int dh_group: (optional) The Diffie-Hellman group + Groups `2` and `5` have been deprecated. + :attr str encryption_algorithm: (optional) The encryption algorithm + The `triple_des` algorithm has been deprecated. :attr int ike_version: (optional) The IKE protocol version. :attr int key_lifetime: (optional) The key lifetime in seconds. :attr str name: (optional) The user-defined name for this IKE policy. @@ -29475,9 +30244,12 @@ def __init__(self, Initialize a IKEPolicyPatch object. :param str authentication_algorithm: (optional) The authentication - algorithm. - :param int dh_group: (optional) The Diffie-Hellman group. - :param str encryption_algorithm: (optional) The encryption algorithm. + algorithm + The `md5` and `sha1` algorithms have been deprecated. + :param int dh_group: (optional) The Diffie-Hellman group + Groups `2` and `5` have been deprecated. + :param str encryption_algorithm: (optional) The encryption algorithm + The `triple_des` algorithm has been deprecated. :param int ike_version: (optional) The IKE protocol version. :param int key_lifetime: (optional) The key lifetime in seconds. :param str name: (optional) The user-defined name for this IKE policy. @@ -29549,19 +30321,23 @@ def __ne__(self, other: 'IKEPolicyPatch') -> bool: class AuthenticationAlgorithmEnum(str, Enum): """ - The authentication algorithm. + The authentication algorithm + The `md5` and `sha1` algorithms have been deprecated. """ MD5 = 'md5' SHA1 = 'sha1' SHA256 = 'sha256' + SHA384 = 'sha384' SHA512 = 'sha512' class EncryptionAlgorithmEnum(str, Enum): """ - The encryption algorithm. + The encryption algorithm + The `triple_des` algorithm has been deprecated. """ AES128 = 'aes128' + AES192 = 'aes192' AES256 = 'aes256' TRIPLE_DES = 'triple_des' @@ -29571,7 +30347,7 @@ class IKEPolicyReference(): IKEPolicyReference. :attr IKEPolicyReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted and provides + indicates the referenced resource has been deleted, and provides some supplementary information. :attr str href: The IKE policy's canonical URL. :attr str id: The unique identifier for this IKE policy. @@ -29594,7 +30370,7 @@ def __init__(self, :param str name: The user-defined name for this IKE policy. :param str resource_type: The resource type. :param IKEPolicyReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted and provides + property indicates the referenced resource has been deleted, and provides some supplementary information. """ self.deleted = deleted @@ -29674,7 +30450,7 @@ class ResourceTypeEnum(str, Enum): class IKEPolicyReferenceDeleted(): """ - If present, this property indicates the referenced resource has been deleted and + 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. @@ -29798,18 +30574,26 @@ class IPsecPolicy(): """ IPsecPolicy. - :attr str authentication_algorithm: The authentication algorithm. + :attr str authentication_algorithm: The authentication algorithm + The `md5` and `sha1` algorithms have been deprecated + Must be `disabled` if and only if the `encryption_algorithm` is + `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`. :attr List[VPNGatewayConnectionReference] connections: The VPN gateway connections that use this IPsec policy. :attr datetime created_at: The date and time that this IPsec policy was created. :attr str encapsulation_mode: The encapsulation mode used. Only `tunnel` is supported. - :attr str encryption_algorithm: The encryption algorithm. + :attr str encryption_algorithm: The encryption algorithm + The `triple_des` algorithm has been deprecated + The `authentication_algorithm` must be `disabled` if and only if + `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or + `aes256gcm16`. :attr str href: The IPsec policy's canonical URL. :attr str id: The unique identifier for this IPsec policy. :attr int key_lifetime: The key lifetime in seconds. :attr str name: The user-defined name for this IPsec policy. - :attr str pfs: Perfect Forward Secrecy. + :attr str pfs: Perfect Forward Secrecy + Groups `group_2` and `group_5` have been deprecated. :attr ResourceGroupReference resource_group: The resource group for this IPsec policy. :attr str resource_type: The resource type. @@ -29834,19 +30618,27 @@ def __init__(self, """ Initialize a IPsecPolicy object. - :param str authentication_algorithm: The authentication algorithm. + :param str authentication_algorithm: The authentication algorithm + The `md5` and `sha1` algorithms have been deprecated + Must be `disabled` if and only if the `encryption_algorithm` is + `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`. :param List[VPNGatewayConnectionReference] connections: The VPN gateway connections that use this IPsec policy. :param datetime created_at: The date and time that this IPsec policy was created. :param str encapsulation_mode: The encapsulation mode used. Only `tunnel` is supported. - :param str encryption_algorithm: The encryption algorithm. + :param str encryption_algorithm: The encryption algorithm + The `triple_des` algorithm has been deprecated + The `authentication_algorithm` must be `disabled` if and only if + `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or + `aes256gcm16`. :param str href: The IPsec policy's canonical URL. :param str id: The unique identifier for this IPsec policy. :param int key_lifetime: The key lifetime in seconds. :param str name: The user-defined name for this IPsec policy. - :param str pfs: Perfect Forward Secrecy. + :param str pfs: Perfect Forward Secrecy + Groups `group_2` and `group_5` have been deprecated. :param ResourceGroupReference resource_group: The resource group for this IPsec policy. :param str resource_type: The resource type. @@ -29981,11 +30773,16 @@ def __ne__(self, other: 'IPsecPolicy') -> bool: class AuthenticationAlgorithmEnum(str, Enum): """ - The authentication algorithm. + The authentication algorithm + The `md5` and `sha1` algorithms have been deprecated + Must be `disabled` if and only if the `encryption_algorithm` is + `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`. """ + DISABLED = 'disabled' MD5 = 'md5' SHA1 = 'sha1' SHA256 = 'sha256' + SHA384 = 'sha384' SHA512 = 'sha512' @@ -29998,21 +30795,40 @@ class EncapsulationModeEnum(str, Enum): class EncryptionAlgorithmEnum(str, Enum): """ - The encryption algorithm. + The encryption algorithm + The `triple_des` algorithm has been deprecated + The `authentication_algorithm` must be `disabled` if and only if + `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or + `aes256gcm16`. """ AES128 = 'aes128' + AES128GCM16 = 'aes128gcm16' + AES192 = 'aes192' + AES192GCM16 = 'aes192gcm16' AES256 = 'aes256' + AES256GCM16 = 'aes256gcm16' TRIPLE_DES = 'triple_des' class PfsEnum(str, Enum): """ - Perfect Forward Secrecy. + Perfect Forward Secrecy + Groups `group_2` and `group_5` have been deprecated. """ DISABLED = 'disabled' GROUP_14 = 'group_14' + GROUP_15 = 'group_15' + GROUP_16 = 'group_16' + GROUP_17 = 'group_17' + GROUP_18 = 'group_18' GROUP_19 = 'group_19' GROUP_2 = 'group_2' + GROUP_20 = 'group_20' + GROUP_21 = 'group_21' + GROUP_22 = 'group_22' + GROUP_23 = 'group_23' + GROUP_24 = 'group_24' + GROUP_31 = 'group_31' GROUP_5 = 'group_5' @@ -30249,11 +31065,19 @@ class IPsecPolicyPatch(): """ IPsecPolicyPatch. - :attr str authentication_algorithm: (optional) The authentication algorithm. - :attr str encryption_algorithm: (optional) The encryption algorithm. + :attr str authentication_algorithm: (optional) The authentication algorithm + The `md5` and `sha1` algorithms have been deprecated + Must be `disabled` if and only if the `encryption_algorithm` is + `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`. + :attr str encryption_algorithm: (optional) The encryption algorithm + The `triple_des` algorithm has been deprecated + The `authentication_algorithm` must be `disabled` if and only if + `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or + `aes256gcm16`. :attr int key_lifetime: (optional) The key lifetime in seconds. :attr str name: (optional) The user-defined name for this IPsec policy. - :attr str pfs: (optional) Perfect Forward Secrecy. + :attr str pfs: (optional) Perfect Forward Secrecy + Groups `group_2` and `group_5` have been deprecated. """ def __init__(self, @@ -30267,11 +31091,19 @@ def __init__(self, Initialize a IPsecPolicyPatch object. :param str authentication_algorithm: (optional) The authentication - algorithm. - :param str encryption_algorithm: (optional) The encryption algorithm. + algorithm + The `md5` and `sha1` algorithms have been deprecated + Must be `disabled` if and only if the `encryption_algorithm` is + `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`. + :param str encryption_algorithm: (optional) The encryption algorithm + The `triple_des` algorithm has been deprecated + The `authentication_algorithm` must be `disabled` if and only if + `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or + `aes256gcm16`. :param int key_lifetime: (optional) The key lifetime in seconds. :param str name: (optional) The user-defined name for this IPsec policy. - :param str pfs: (optional) Perfect Forward Secrecy. + :param str pfs: (optional) Perfect Forward Secrecy + Groups `group_2` and `group_5` have been deprecated. """ self.authentication_algorithm = authentication_algorithm self.encryption_algorithm = encryption_algorithm @@ -30335,31 +31167,55 @@ def __ne__(self, other: 'IPsecPolicyPatch') -> bool: class AuthenticationAlgorithmEnum(str, Enum): """ - The authentication algorithm. + The authentication algorithm + The `md5` and `sha1` algorithms have been deprecated + Must be `disabled` if and only if the `encryption_algorithm` is + `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`. """ + DISABLED = 'disabled' MD5 = 'md5' SHA1 = 'sha1' SHA256 = 'sha256' + SHA384 = 'sha384' SHA512 = 'sha512' class EncryptionAlgorithmEnum(str, Enum): """ - The encryption algorithm. + The encryption algorithm + The `triple_des` algorithm has been deprecated + The `authentication_algorithm` must be `disabled` if and only if + `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or + `aes256gcm16`. """ AES128 = 'aes128' + AES128GCM16 = 'aes128gcm16' + AES192 = 'aes192' + AES192GCM16 = 'aes192gcm16' AES256 = 'aes256' + AES256GCM16 = 'aes256gcm16' TRIPLE_DES = 'triple_des' class PfsEnum(str, Enum): """ - Perfect Forward Secrecy. + Perfect Forward Secrecy + Groups `group_2` and `group_5` have been deprecated. """ DISABLED = 'disabled' GROUP_14 = 'group_14' + GROUP_15 = 'group_15' + GROUP_16 = 'group_16' + GROUP_17 = 'group_17' + GROUP_18 = 'group_18' GROUP_19 = 'group_19' GROUP_2 = 'group_2' + GROUP_20 = 'group_20' + GROUP_21 = 'group_21' + GROUP_22 = 'group_22' + GROUP_23 = 'group_23' + GROUP_24 = 'group_24' + GROUP_31 = 'group_31' GROUP_5 = 'group_5' @@ -30368,7 +31224,7 @@ class IPsecPolicyReference(): IPsecPolicyReference. :attr IPsecPolicyReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted and provides + indicates the referenced resource has been deleted, and provides some supplementary information. :attr str href: The IPsec policy's canonical URL. :attr str id: The unique identifier for this IPsec policy. @@ -30391,7 +31247,7 @@ def __init__(self, :param str name: The user-defined name for this IPsec policy. :param str resource_type: The resource type. :param IPsecPolicyReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted and provides + property indicates the referenced resource has been deleted, and provides some supplementary information. """ self.deleted = deleted @@ -30471,7 +31327,7 @@ class ResourceTypeEnum(str, Enum): class IPsecPolicyReferenceDeleted(): """ - If present, this property indicates the referenced resource has been deleted and + 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. @@ -30530,6 +31386,7 @@ class Image(): """ Image. + :attr ImageCatalogOffering catalog_offering: :attr datetime created_at: The date and time that the image was created. :attr str crn: The CRN for this image. :attr str encryption: The type of encryption used on the image. @@ -30543,8 +31400,7 @@ class Image(): :attr str id: The unique identifier for this image. :attr int minimum_provisioned_size: (optional) The minimum size (in gigabytes) of a volume onto which this image may be provisioned. - This property may be absent if the image has a `status` of `pending`, - `tentative`, or + This property may be absent if the image has a `status` of `pending` or `failed`. :attr str name: The user-defined or system-provided name for this image. :attr OperatingSystem operating_system: (optional) The operating system included @@ -30558,12 +31414,9 @@ class Image(): - available: image can be used (provisionable) - deleting: image is being deleted, and can no longer be used to provision new resources - - deprecated: image can be used, but is slated to become `obsolete` - (provisionable) + - deprecated: image is administratively slated to be deleted - failed: image is corrupt or did not pass validation - - obsolete: image can no longer be used to provision new resources - pending: image is being imported and is not yet `available` - - tentative: image import has timed out (contact support) - unusable: image cannot be used (see `status_reasons[]` for possible remediation) The enumerated values for this property are expected to expand in the future. @@ -30571,7 +31424,23 @@ class Image(): processing and surface the error, or bypass the image on which the unexpected property value was encountered. :attr List[ImageStatusReason] status_reasons: The reasons for the current status - (if any). + (if any): + - `encrypted_data_key_invalid`: image cannot be decrypted with the specified + `encryption_key` + - `encryption_key_deleted`: image unusable because its `encryption_key` was + deleted + - `encryption_key_disabled`: image unusable until its `encryption_key` is + re-enabled + - `image_data_corrupted`: image data is corrupt, or is not in the specified + format + - `image_provisioned_size_unsupported`: image requires a boot volume size + greater + than the maximum supported value + - `image_request_in_progress`: image operation is in progress (such as an import + from + Cloud Object Storage) + - `image_request_queued`: image request has been accepted but the requested + operation has not started The enumerated reason code values for this property will expand in the 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 @@ -30581,6 +31450,7 @@ class Image(): """ def __init__(self, + catalog_offering: 'ImageCatalogOffering', created_at: datetime, crn: str, encryption: str, @@ -30600,6 +31470,7 @@ def __init__(self, """ Initialize a Image object. + :param ImageCatalogOffering catalog_offering: :param datetime created_at: The date and time that the image was created. :param str crn: The CRN for this image. :param str encryption: The type of encryption used on the image. @@ -30614,12 +31485,9 @@ def __init__(self, - deleting: image is being deleted, and can no longer be used to provision new resources - - deprecated: image can be used, but is slated to become `obsolete` - (provisionable) + - deprecated: image is administratively slated to be deleted - failed: image is corrupt or did not pass validation - - obsolete: image can no longer be used to provision new resources - pending: image is being imported and is not yet `available` - - tentative: image import has timed out (contact support) - unusable: image cannot be used (see `status_reasons[]` for possible remediation) The enumerated values for this property are expected to expand in the @@ -30627,7 +31495,24 @@ def __init__(self, Optionally halt processing and surface the error, or bypass the image on which the unexpected property value was encountered. :param List[ImageStatusReason] status_reasons: The reasons for the current - status (if any). + status (if any): + - `encrypted_data_key_invalid`: image cannot be decrypted with the + specified + `encryption_key` + - `encryption_key_deleted`: image unusable because its `encryption_key` was + deleted + - `encryption_key_disabled`: image unusable until its `encryption_key` is + re-enabled + - `image_data_corrupted`: image data is corrupt, or is not in the specified + format + - `image_provisioned_size_unsupported`: image requires a boot volume size + greater + than the maximum supported value + - `image_request_in_progress`: image operation is in progress (such as an + import from + Cloud Object Storage) + - `image_request_queued`: image request has been accepted but the requested + operation has not started The enumerated reason code values for this property will expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on @@ -30641,8 +31526,7 @@ def __init__(self, `user_managed`. :param int minimum_provisioned_size: (optional) The minimum size (in gigabytes) of a volume onto which this image may be provisioned. - This property may be absent if the image has a `status` of `pending`, - `tentative`, or + This property may be absent if the image has a `status` of `pending` or `failed`. :param OperatingSystem operating_system: (optional) The operating system included in this image. @@ -30651,6 +31535,7 @@ def __init__(self, [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). If absent, this image was not created from a volume. """ + self.catalog_offering = catalog_offering self.created_at = created_at self.crn = crn self.encryption = encryption @@ -30671,6 +31556,10 @@ def __init__(self, def from_dict(cls, _dict: Dict) -> 'Image': """Initialize a Image object from a json dictionary.""" args = {} + if 'catalog_offering' in _dict: + args['catalog_offering'] = ImageCatalogOffering.from_dict(_dict.get('catalog_offering')) + else: + raise ValueError('Required property \'catalog_offering\' not present in Image JSON') if 'created_at' in _dict: args['created_at'] = string_to_datetime(_dict.get('created_at')) else: @@ -30733,6 +31622,8 @@ def _from_dict(cls, _dict): def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'catalog_offering') and self.catalog_offering is not None: + _dict['catalog_offering'] = self.catalog_offering.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: @@ -30797,12 +31688,9 @@ class StatusEnum(str, Enum): - available: image can be used (provisionable) - deleting: image is being deleted, and can no longer be used to provision new resources - - deprecated: image can be used, but is slated to become `obsolete` - (provisionable) + - deprecated: image is administratively slated to be deleted - failed: image is corrupt or did not pass validation - - obsolete: image can no longer be used to provision new resources - pending: image is being imported and is not yet `available` - - tentative: image import has timed out (contact support) - unusable: image cannot be used (see `status_reasons[]` for possible remediation) 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 @@ -30814,7 +31702,6 @@ class StatusEnum(str, Enum): DEPRECATED = 'deprecated' FAILED = 'failed' PENDING = 'pending' - TENTATIVE = 'tentative' UNUSABLE = 'unusable' @@ -30826,6 +31713,87 @@ class VisibilityEnum(str, Enum): PUBLIC = 'public' +class ImageCatalogOffering(): + """ + ImageCatalogOffering. + + :attr bool managed: Indicates whether this image is managed as part of a + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + offering. If an image is managed, accounts in the same + [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise) + with access to that catalog can specify the image's catalog offering version CRN + to provision virtual server instances using the image. + :attr CatalogOfferingVersionReference version: (optional) The + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + offering version associated with this image. + If absent, this image is not associated with a cloud catalog offering. + """ + + def __init__(self, + managed: bool, + *, + version: 'CatalogOfferingVersionReference' = None) -> None: + """ + Initialize a ImageCatalogOffering object. + + :param bool managed: Indicates whether this image is managed as part of a + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + offering. If an image is managed, accounts in the same + [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise) + with access to that catalog can specify the image's catalog offering + version CRN to provision virtual server instances using the image. + :param CatalogOfferingVersionReference version: (optional) The + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + offering version associated with this image. + If absent, this image is not associated with a cloud catalog offering. + """ + self.managed = managed + self.version = version + + @classmethod + def from_dict(cls, _dict: Dict) -> 'ImageCatalogOffering': + """Initialize a ImageCatalogOffering object from a json dictionary.""" + args = {} + if 'managed' in _dict: + args['managed'] = _dict.get('managed') + else: + raise ValueError('Required property \'managed\' not present in ImageCatalogOffering JSON') + if 'version' in _dict: + args['version'] = CatalogOfferingVersionReference.from_dict(_dict.get('version')) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a ImageCatalogOffering object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'managed') and self.managed is not None: + _dict['managed'] = self.managed + if hasattr(self, 'version') and self.version is not None: + _dict['version'] = self.version.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 ImageCatalogOffering object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ImageCatalogOffering') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'ImageCatalogOffering') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + class ImageCollection(): """ ImageCollection. @@ -31168,6 +32136,8 @@ class ImageFilePrototype(): ImageFilePrototype. :attr str href: The Cloud Object Storage location of the image file. + The image file format is specified by the file's extension, which must be either + `qcow2` or `vhd`. """ def __init__(self, @@ -31176,6 +32146,9 @@ def __init__(self, Initialize a ImageFilePrototype object. :param str href: The Cloud Object Storage location of the image file. + The image file format is specified by the file's extension, which must be + either + `qcow2` or `vhd`. """ self.href = href @@ -31328,7 +32301,7 @@ class ImageReference(): :attr str crn: The CRN for this image. :attr ImageReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted and provides + indicates the referenced resource has been deleted, and provides some supplementary information. :attr str href: The URL for this image. :attr str id: The unique identifier for this image. @@ -31350,7 +32323,7 @@ def __init__(self, :param str id: The unique identifier for this image. :param str name: The user-defined or system-provided name for this image. :param ImageReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted and provides + indicates the referenced resource has been deleted, and provides some supplementary information. """ self.crn = crn @@ -31423,7 +32396,7 @@ def __ne__(self, other: 'ImageReference') -> bool: class ImageReferenceDeleted(): """ - If present, this property indicates the referenced resource has been deleted and + 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. @@ -31559,8 +32532,11 @@ class CodeEnum(str, Enum): """ A snake case string succinctly identifying the status reason. """ + ENCRYPTED_DATA_KEY_INVALID = 'encrypted_data_key_invalid' ENCRYPTION_KEY_DELETED = 'encryption_key_deleted' ENCRYPTION_KEY_DISABLED = 'encryption_key_disabled' + IMAGE_DATA_CORRUPTED = 'image_data_corrupted' + IMAGE_PROVISIONED_SIZE_UNSUPPORTED = 'image_provisioned_size_unsupported' IMAGE_REQUEST_IN_PROGRESS = 'image_request_in_progress' IMAGE_REQUEST_QUEUED = 'image_request_queued' @@ -31575,6 +32551,9 @@ class Instance(): the virtual server instance's network interfaces and storage volumes. :attr VolumeAttachmentReferenceInstanceContext boot_volume_attachment: Boot volume attachment. + :attr InstanceCatalogOffering catalog_offering: (optional) If present, this + virtual server instance was provisioned from a + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user). :attr datetime created_at: The date and time that the virtual server instance was created. :attr str crn: The CRN for this virtual server instance. @@ -31587,6 +32566,13 @@ class Instance(): :attr str id: The unique identifier for this virtual server instance. :attr ImageReference image: (optional) The image the virtual server instance was provisioned from. + :attr List[LifecycleReason] lifecycle_reasons: The reasons for the current + `lifecycle_state` (if any). + The enumerated reason code values for this property will expand in the 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. + :attr str lifecycle_state: The lifecycle state of the virtual server instance. :attr int memory: The amount of memory, truncated to whole gibibytes. :attr InstanceMetadataService metadata_service: The metadata service configuration. @@ -31599,14 +32585,19 @@ class Instance(): restrictions for the virtual server instance. :attr NetworkInterfaceInstanceContextReference primary_network_interface: Primary network interface. - :attr InstanceProfileReference profile: The profile for this virtual server - instance. + :attr InstanceProfileReference profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) for this virtual + server instance. :attr ResourceGroupReference resource_group: The resource group for this instance. :attr str resource_type: The resource type. :attr bool startable: Indicates whether the state of the virtual server instance permits a start request. :attr str status: The status of the virtual server instance. + The enumerated values for this property will 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. :attr List[InstanceStatusReason] status_reasons: The reasons for the current status (if any). The enumerated reason code values for this property will expand in the future. @@ -31636,6 +32627,8 @@ def __init__(self, disks: List['InstanceDisk'], href: str, id: str, + lifecycle_reasons: List['LifecycleReason'], + lifecycle_state: str, memory: int, metadata_service: 'InstanceMetadataService', name: str, @@ -31654,6 +32647,7 @@ def __init__(self, vpc: 'VPCReference', zone: 'ZoneReference', *, + catalog_offering: 'InstanceCatalogOffering' = None, dedicated_host: 'DedicatedHostReference' = None, gpu: 'InstanceGPU' = None, image: 'ImageReference' = None, @@ -31675,6 +32669,14 @@ def __init__(self, instance. :param str href: The URL for this virtual server instance. :param str id: The unique identifier for this virtual server instance. + :param List[LifecycleReason] lifecycle_reasons: The reasons for the current + `lifecycle_state` (if any). + The enumerated reason code values for this property will expand in the + 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 str lifecycle_state: The lifecycle state of the virtual server + instance. :param int memory: The amount of memory, truncated to whole gibibytes. :param InstanceMetadataService metadata_service: The metadata service configuration. @@ -31685,7 +32687,9 @@ def __init__(self, primary network interface. :param NetworkInterfaceInstanceContextReference primary_network_interface: Primary network interface. - :param InstanceProfileReference profile: The profile for this virtual + :param InstanceProfileReference profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) for this + virtual server instance. :param ResourceGroupReference resource_group: The resource group for this instance. @@ -31693,6 +32697,10 @@ def __init__(self, :param bool startable: Indicates whether the state of the virtual server instance permits a start request. :param str status: The status of the virtual server instance. + The enumerated values for this property will 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. :param List[InstanceStatusReason] status_reasons: The reasons for the current status (if any). The enumerated reason code values for this property will expand in the @@ -31712,6 +32720,9 @@ def __init__(self, :param VPCReference vpc: The VPC this virtual server instance resides in. :param ZoneReference zone: The zone this virtual server instance resides in. + :param InstanceCatalogOffering catalog_offering: (optional) If present, + this virtual server instance was provisioned from a + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user). :param DedicatedHostReference dedicated_host: (optional) If present, the dedicated host this virtual server instance has been placed on. :param InstanceGPU gpu: (optional) The virtual server instance GPU @@ -31724,6 +32735,7 @@ def __init__(self, self.availability_policy = availability_policy self.bandwidth = bandwidth self.boot_volume_attachment = boot_volume_attachment + self.catalog_offering = catalog_offering self.created_at = created_at self.crn = crn self.dedicated_host = dedicated_host @@ -31732,6 +32744,8 @@ def __init__(self, self.href = href self.id = id self.image = image + self.lifecycle_reasons = lifecycle_reasons + self.lifecycle_state = lifecycle_state self.memory = memory self.metadata_service = metadata_service self.name = name @@ -31767,6 +32781,8 @@ def from_dict(cls, _dict: Dict) -> 'Instance': args['boot_volume_attachment'] = VolumeAttachmentReferenceInstanceContext.from_dict(_dict.get('boot_volume_attachment')) else: raise ValueError('Required property \'boot_volume_attachment\' not present in Instance JSON') + if 'catalog_offering' in _dict: + args['catalog_offering'] = InstanceCatalogOffering.from_dict(_dict.get('catalog_offering')) if 'created_at' in _dict: args['created_at'] = string_to_datetime(_dict.get('created_at')) else: @@ -31793,6 +32809,14 @@ def from_dict(cls, _dict: Dict) -> 'Instance': raise ValueError('Required property \'id\' not present in Instance JSON') if 'image' in _dict: args['image'] = ImageReference.from_dict(_dict.get('image')) + if 'lifecycle_reasons' in _dict: + args['lifecycle_reasons'] = [LifecycleReason.from_dict(x) for x in _dict.get('lifecycle_reasons')] + else: + raise ValueError('Required property \'lifecycle_reasons\' not present in Instance JSON') + if 'lifecycle_state' in _dict: + args['lifecycle_state'] = _dict.get('lifecycle_state') + else: + raise ValueError('Required property \'lifecycle_state\' not present in Instance JSON') if 'memory' in _dict: args['memory'] = _dict.get('memory') else: @@ -31879,6 +32903,8 @@ def to_dict(self) -> Dict: _dict['bandwidth'] = self.bandwidth 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, 'catalog_offering') and self.catalog_offering is not None: + _dict['catalog_offering'] = self.catalog_offering.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: @@ -31895,6 +32921,10 @@ def to_dict(self) -> Dict: _dict['id'] = self.id if hasattr(self, 'image') and self.image is not None: _dict['image'] = self.image.to_dict() + if hasattr(self, 'lifecycle_reasons') and self.lifecycle_reasons is not None: + _dict['lifecycle_reasons'] = [x.to_dict() for x in self.lifecycle_reasons] + if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None: + _dict['lifecycle_state'] = self.lifecycle_state if hasattr(self, 'memory') and self.memory is not None: _dict['memory'] = self.memory if hasattr(self, 'metadata_service') and self.metadata_service is not None: @@ -31954,6 +32984,19 @@ def __ne__(self, other: 'Instance') -> 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 virtual server instance. + """ + DELETING = 'deleting' + FAILED = 'failed' + PENDING = 'pending' + STABLE = 'stable' + SUSPENDED = 'suspended' + UPDATING = 'updating' + WAITING = 'waiting' + + class ResourceTypeEnum(str, Enum): """ The resource type. @@ -31964,14 +33007,15 @@ class ResourceTypeEnum(str, Enum): class StatusEnum(str, Enum): """ The status of the virtual server instance. + The enumerated values for this property will 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. """ DELETING = 'deleting' FAILED = 'failed' - PAUSED = 'paused' - PAUSING = 'pausing' PENDING = 'pending' RESTARTING = 'restarting' - RESUMING = 'resuming' RUNNING = 'running' STARTING = 'starting' STOPPED = 'stopped' @@ -32380,6 +33424,98 @@ class HostFailureEnum(str, Enum): STOP = 'stop' +class InstanceCatalogOffering(): + """ + InstanceCatalogOffering. + + :attr CatalogOfferingVersionReference version: The catalog offering version this + virtual server instance was provisioned from. + The catalog offering version is not managed by the IBM VPC service, and may no + longer + exist, or may refer to a different image CRN than the `image.crn` for this + virtual + server instance. However, all images associated with a catalog offering version + will + have the same checksum, and therefore will have the same data. + """ + + def __init__(self, + version: 'CatalogOfferingVersionReference') -> None: + """ + Initialize a InstanceCatalogOffering object. + + :param CatalogOfferingVersionReference version: The catalog offering + version this virtual server instance was provisioned from. + The catalog offering version is not managed by the IBM VPC service, and may + no longer + exist, or may refer to a different image CRN than the `image.crn` for this + virtual + server instance. However, all images associated with a catalog offering + version will + have the same checksum, and therefore will have the same data. + """ + self.version = version + + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstanceCatalogOffering': + """Initialize a InstanceCatalogOffering object from a json dictionary.""" + args = {} + if 'version' in _dict: + args['version'] = CatalogOfferingVersionReference.from_dict(_dict.get('version')) + else: + raise ValueError('Required property \'version\' not present in InstanceCatalogOffering JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceCatalogOffering object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'version') and self.version is not None: + _dict['version'] = self.version.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 InstanceCatalogOffering object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstanceCatalogOffering') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'InstanceCatalogOffering') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + +class InstanceCatalogOfferingPrototype(): + """ + The [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + offering or offering version to use when provisioning this virtual server instance. + If an offering is specified, the latest version of that offering will be used. + The specified offering or offering version may be in a different account in the same + [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise), + subject to IAM policies. + + """ + + def __init__(self) -> None: + """ + Initialize a InstanceCatalogOfferingPrototype object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['InstanceCatalogOfferingPrototypeCatalogOfferingByOffering', 'InstanceCatalogOfferingPrototypeCatalogOfferingByVersion'])) + raise Exception(msg) + class InstanceCollection(): """ InstanceCollection. @@ -33055,7 +34191,7 @@ class InstanceDiskReference(): InstanceDiskReference. :attr InstanceDiskReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted and provides + indicates the referenced resource has been deleted, and provides some supplementary information. :attr str href: The URL for this instance disk. :attr str id: The unique identifier for this instance disk. @@ -33078,7 +34214,7 @@ def __init__(self, :param str name: The user-defined name for this disk. :param str resource_type: The resource type. :param InstanceDiskReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted and provides + property indicates the referenced resource has been deleted, and provides some supplementary information. """ self.deleted = deleted @@ -33158,7 +34294,7 @@ class ResourceTypeEnum(str, Enum): class InstanceDiskReferenceDeleted(): """ - If present, this property indicates the referenced resource has been deleted and + 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. @@ -33303,9 +34439,9 @@ class InstanceGroup(): """ InstanceGroup. - :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 int application_port: (optional) The port used for new load balancer pool + members created by this instance group. + This property will be present if and only if `load_balancer_pool` is present. :attr datetime created_at: The date and time that the instance group was created. :attr str crn: The CRN for this instance group. @@ -33313,10 +34449,9 @@ class InstanceGroup(): :attr str id: The unique identifier for this instance group. :attr InstanceTemplateReference instance_template: The template used to create new instances for this group. - :attr LoadBalancerPoolReference load_balancer_pool: (optional) The load balancer - pool managed by this group. Instances created - by this group will have a new load balancer pool member in that - pool created. + :attr LoadBalancerPoolReference load_balancer_pool: (optional) If present, the + load balancer pool this instance group manages. A pool member will + be created for each instance created by this group. :attr List[InstanceGroupManagerReference] managers: The managers for the instance group. :attr int membership_count: The number of instances in the instance group. @@ -33378,13 +34513,13 @@ def __init__(self, :param datetime updated_at: The date and time that the instance group was updated. :param VPCReference vpc: The VPC the instance group resides in. - :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 LoadBalancerPoolReference load_balancer_pool: (optional) The load - balancer pool managed by this group. Instances created - by this group will have a new load balancer pool member in that - pool created. + :param int application_port: (optional) The port used for new load balancer + pool members created by this instance group. + This property will be present if and only if `load_balancer_pool` is + present. + :param LoadBalancerPoolReference load_balancer_pool: (optional) If present, + the load balancer pool this instance group manages. A pool member will + be created for each instance created by this group. """ self.application_port = application_port self.created_at = created_at @@ -33816,7 +34951,7 @@ class InstanceGroupManagerAction(): - `incompatible`: Action parameters are not compatible with the group or manager - `omitted`: Action was not applied because this action's manager was disabled. :attr datetime updated_at: The date and time that the instance group manager - action was modified. + action was updated. """ def __init__(self, @@ -33857,7 +34992,7 @@ def __init__(self, - `omitted`: Action was not applied because this action's manager was disabled. :param datetime updated_at: The date and time that the instance group - manager action was modified. + manager action was updated. """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( ", ".join(['InstanceGroupManagerActionScheduledAction'])) @@ -34132,7 +35267,7 @@ class InstanceGroupManagerActionReference(): InstanceGroupManagerActionReference. :attr InstanceGroupManagerActionReferenceDeleted deleted: (optional) If present, - this property indicates the referenced resource has been deleted and provides + this property indicates the referenced resource has been deleted, and provides some supplementary information. :attr str href: The URL for this instance group manager action. :attr str id: The unique identifier for this instance group manager action. @@ -34157,7 +35292,7 @@ def __init__(self, action. :param str resource_type: The resource type. :param InstanceGroupManagerActionReferenceDeleted deleted: (optional) If - present, this property indicates the referenced resource has been deleted + present, this property indicates the referenced resource has been deleted, and provides some supplementary information. """ @@ -34238,7 +35373,7 @@ class ResourceTypeEnum(str, Enum): class InstanceGroupManagerActionReferenceDeleted(): """ - If present, this property indicates the referenced resource has been deleted and + 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. @@ -35219,7 +36354,7 @@ class InstanceGroupManagerPolicyReference(): InstanceGroupManagerPolicyReference. :attr InstanceGroupManagerPolicyReferenceDeleted deleted: (optional) If present, - this property indicates the referenced resource has been deleted and provides + this property indicates the referenced resource has been deleted, and provides some supplementary information. :attr str href: The URL for this instance group manager policy. :attr str id: The unique identifier for this instance group manager policy. @@ -35241,7 +36376,7 @@ def __init__(self, :param str name: The user-defined name for this instance group manager policy. :param InstanceGroupManagerPolicyReferenceDeleted deleted: (optional) If - present, this property indicates the referenced resource has been deleted + present, this property indicates the referenced resource has been deleted, and provides some supplementary information. """ @@ -35308,7 +36443,7 @@ def __ne__(self, other: 'InstanceGroupManagerPolicyReference') -> bool: class InstanceGroupManagerPolicyReferenceDeleted(): """ - If present, this property indicates the referenced resource has been deleted and + 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. @@ -35396,7 +36531,7 @@ class InstanceGroupManagerReference(): InstanceGroupManagerReference. :attr InstanceGroupManagerReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted and provides + property indicates the referenced resource has been deleted, and provides some supplementary information. :attr str href: The URL for this instance group manager. :attr str id: The unique identifier for this instance group manager. @@ -35416,7 +36551,7 @@ def __init__(self, :param str id: The unique identifier for this instance group manager. :param str name: The user-defined name for this instance group manager. :param InstanceGroupManagerReferenceDeleted deleted: (optional) If present, - this property indicates the referenced resource has been deleted and + this property indicates the referenced resource has been deleted, and provides some supplementary information. """ @@ -35483,7 +36618,7 @@ def __ne__(self, other: 'InstanceGroupManagerReference') -> bool: class InstanceGroupManagerReferenceDeleted(): """ - If present, this property indicates the referenced resource has been deleted and + 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. @@ -36143,23 +37278,23 @@ class InstanceGroupPatch(): To add or update load balancer specification for an instance group the `membership_count` must first be set to 0. - :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 int application_port: (optional) The port to use for new load balancer + pool members created by this instance group. + This property must be set if and only if `load_balancer_pool` has been set. :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 - associated with the specified load balancer pool. - Required if `load_balancer_pool` is specified. + associated with `load_balancer_pool`. + This property must be specified if and only if `load_balancer_pool` has been + specified. At present, only load balancers in the `application` family are supported. :attr LoadBalancerPoolIdentity load_balancer_pool: (optional) If specified, the - load balancer pool will be managed by this - group. Instances created by this group will have a new load - balancer pool member in that pool created. Must be used with - `application_port`. + load balancer pool this instance group will manage. A pool member + will be created for each instance created by this group. + If specified, `load_balancer` and `application_port` must also be specified. :attr int membership_count: (optional) The number of instances in the instance group. :attr str name: (optional) The user-defined name for this instance group. @@ -36179,23 +37314,26 @@ def __init__(self, """ Initialize a InstanceGroupPatch object. - :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 int application_port: (optional) The port to use for new load + balancer pool members created by this instance group. + This property must be set if and only if `load_balancer_pool` has been set. :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 - associated with the specified load balancer pool. - Required if `load_balancer_pool` is specified. + associated with `load_balancer_pool`. + This property must be specified if and only if `load_balancer_pool` has + been + specified. At present, only load balancers in the `application` family are supported. :param LoadBalancerPoolIdentity load_balancer_pool: (optional) If - specified, the load balancer pool will be managed by this - group. Instances created by this group will have a new load - balancer pool member in that pool created. Must be used with - `application_port`. + specified, the load balancer pool this instance group will manage. A pool + member + will be created for each instance created by this group. + If specified, `load_balancer` and `application_port` must also be + specified. :param int membership_count: (optional) The number of instances in the instance group. :param str name: (optional) The user-defined name for this instance group. @@ -36293,7 +37431,7 @@ class InstanceGroupReference(): :attr str crn: The CRN for this instance group. :attr InstanceGroupReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted and provides + property indicates the referenced resource has been deleted, and provides some supplementary information. :attr str href: The URL for this instance group. :attr str id: The unique identifier for this instance group. @@ -36315,7 +37453,7 @@ def __init__(self, :param str id: The unique identifier for this instance group. :param str name: The user-defined name for this instance group. :param InstanceGroupReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted and provides + property indicates the referenced resource has been deleted, and provides some supplementary information. """ self.crn = crn @@ -36388,7 +37526,7 @@ def __ne__(self, other: 'InstanceGroupReference') -> bool: class InstanceGroupReferenceDeleted(): """ - If present, this property indicates the referenced resource has been deleted and + 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. @@ -36867,6 +38005,7 @@ class InstancePatch(): - Be compatible with any `placement_target` constraints. For example, if the instance is placed on a dedicated host, the requested profile `family` must be the same as the dedicated host `family`. + - Have the same `vcpu.architecture`. :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 @@ -36910,6 +38049,7 @@ def __init__(self, instance is placed on a dedicated host, the requested profile `family` must be the same as the dedicated host `family`. + - Have the same `vcpu.architecture`. :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 @@ -36997,6 +38137,7 @@ class InstancePatchProfile(): - Be compatible with any `placement_target` constraints. For example, if the instance is placed on a dedicated host, the requested profile `family` must be the same as the dedicated host `family`. + - Have the same `vcpu.architecture`. """ @@ -38101,9 +39242,12 @@ class InstancePrototype(): 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. If unspecified, `bx2-2x8` will - be used, but this default value is expected to change in the future. + :attr InstanceProfileIdentity profile: (optional) The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this + 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. @@ -38117,9 +39261,10 @@ class InstancePrototype(): :attr List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: (optional) The additional volume attachments to create for the 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 VPCIdentity vpc: (optional) The VPC this virtual server instance will + reside in. + If specified, it must match the VPC for the subnets of the instance's network + interfaces. """ def __init__(self, @@ -38175,9 +39320,13 @@ def __init__(self, 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. If unspecified, `bx2-2x8` will - be used, but this default value is expected to change in the future. + :param InstanceProfileIdentity profile: (optional) The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for + 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 @@ -38192,12 +39341,14 @@ def __init__(self, :param List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: (optional) The additional volume attachments to create for the 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 VPCIdentity vpc: (optional) The VPC this virtual server instance + will reside in. + If specified, it must match the VPC for the subnets of the instance's + network + interfaces. """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['InstancePrototypeInstanceByImage', 'InstancePrototypeInstanceBySourceSnapshot', 'InstancePrototypeInstanceBySourceTemplate'])) + ", ".join(['InstancePrototypeInstanceByImage', 'InstancePrototypeInstanceByCatalogOffering', 'InstancePrototypeInstanceBySourceSnapshot', 'InstancePrototypeInstanceBySourceTemplate'])) raise Exception(msg) class InstanceReference(): @@ -38206,7 +39357,7 @@ class InstanceReference(): :attr str crn: The CRN for this virtual server instance. :attr InstanceReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted and provides + indicates the referenced resource has been deleted, and provides some supplementary information. :attr str href: The URL for this virtual server instance. :attr str id: The unique identifier for this virtual server instance. @@ -38230,7 +39381,7 @@ def __init__(self, :param str name: The user-defined name for this virtual server instance (and default system hostname). :param InstanceReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted and provides + property indicates the referenced resource has been deleted, and provides some supplementary information. """ self.crn = crn @@ -38303,7 +39454,7 @@ def __ne__(self, other: 'InstanceReference') -> bool: class InstanceReferenceDeleted(): """ - If present, this property indicates the referenced resource has been deleted and + 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. @@ -38491,9 +39642,12 @@ class InstanceTemplate(): 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. If unspecified, `bx2-2x8` will - be used, but this default value is expected to change in the future. + :attr InstanceProfileIdentity profile: (optional) The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this + 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 @@ -38506,9 +39660,10 @@ class InstanceTemplate(): :attr List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: (optional) The additional volume attachments to create for the 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 VPCIdentity vpc: (optional) The VPC this virtual server instance will + reside in. + If specified, it must match the VPC for the subnets of the instance's network + interfaces. """ def __init__(self, @@ -38573,9 +39728,13 @@ def __init__(self, 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. If unspecified, `bx2-2x8` will - be used, but this default value is expected to change in the future. + :param InstanceProfileIdentity profile: (optional) The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for + 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 @@ -38586,12 +39745,14 @@ def __init__(self, :param List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: (optional) The additional volume attachments to create for the 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 VPCIdentity vpc: (optional) The VPC this virtual server instance + will reside in. + If specified, it must match the VPC for the subnets of the instance's + network + interfaces. """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['InstanceTemplateInstanceByImage', 'InstanceTemplateInstanceBySourceSnapshot'])) + ", ".join(['InstanceTemplateInstanceByImage', 'InstanceTemplateInstanceBySourceSnapshot', 'InstanceTemplateInstanceByCatalogOffering'])) raise Exception(msg) class InstanceTemplateCollection(): @@ -38925,9 +40086,12 @@ class InstanceTemplatePrototype(): 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. If unspecified, `bx2-2x8` will - be used, but this default value is expected to change in the future. + :attr InstanceProfileIdentity profile: (optional) The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this + 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. @@ -38941,9 +40105,10 @@ class InstanceTemplatePrototype(): :attr List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: (optional) The additional volume attachments to create for the 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 VPCIdentity vpc: (optional) The VPC this virtual server instance will + reside in. + If specified, it must match the VPC for the subnets of the instance's network + interfaces. """ def __init__(self, @@ -38999,9 +40164,13 @@ def __init__(self, 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. If unspecified, `bx2-2x8` will - be used, but this default value is expected to change in the future. + :param InstanceProfileIdentity profile: (optional) The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for + 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 @@ -39016,12 +40185,14 @@ def __init__(self, :param List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: (optional) The additional volume attachments to create for the 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 VPCIdentity vpc: (optional) The VPC this virtual server instance + will reside in. + If specified, it must match the VPC for the subnets of the instance's + network + interfaces. """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['InstanceTemplatePrototypeInstanceByImage', 'InstanceTemplatePrototypeInstanceBySourceTemplate'])) + ", ".join(['InstanceTemplatePrototypeInstanceByImage', 'InstanceTemplatePrototypeInstanceBySourceTemplate', 'InstanceTemplatePrototypeInstanceBySourceSnapshot', 'InstanceTemplatePrototypeInstanceByCatalogOffering'])) raise Exception(msg) class InstanceTemplateReference(): @@ -39030,7 +40201,7 @@ class InstanceTemplateReference(): :attr str crn: The CRN for this instance template. :attr InstanceTemplateReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted and provides + property indicates the referenced resource has been deleted, and provides some supplementary information. :attr str href: The URL for this instance template. :attr str id: The unique identifier for this instance template. @@ -39052,7 +40223,7 @@ def __init__(self, :param str id: The unique identifier for this instance template. :param str name: The unique user-defined name for this instance template. :param InstanceTemplateReferenceDeleted deleted: (optional) If present, - this property indicates the referenced resource has been deleted and + this property indicates the referenced resource has been deleted, and provides some supplementary information. """ @@ -39126,7 +40297,7 @@ def __ne__(self, other: 'InstanceTemplateReference') -> bool: class InstanceTemplateReferenceDeleted(): """ - If present, this property indicates the referenced resource has been deleted and + 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. @@ -39698,7 +40869,7 @@ class KeyReference(): :attr str crn: The CRN for this key. :attr KeyReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted and provides + indicates the referenced resource has been deleted, and provides some supplementary information. :attr str fingerprint: The fingerprint for this key. The value is returned base64-encoded and prefixed with the hash algorithm (always `SHA256`). @@ -39726,7 +40897,7 @@ def __init__(self, :param str id: The unique identifier for this key. :param str name: The user-defined name for this key. :param KeyReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted and provides + indicates the referenced resource has been deleted, and provides some supplementary information. """ self.crn = crn @@ -39806,7 +40977,7 @@ def __ne__(self, other: 'KeyReference') -> bool: class KeyReferenceDeleted(): """ - If present, this property indicates the referenced resource has been deleted and + 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. @@ -39933,6 +41104,92 @@ def __ne__(self, other: 'LegacyCloudObjectStorageBucketReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other +class LifecycleReason(): + """ + LifecycleReason. + + :attr str code: A snake case string succinctly identifying the reason for this + lifecycle state. + :attr str message: An explanation of the reason for this lifecycle state. + :attr str more_info: (optional) Link to documentation about the reason for this + lifecycle state. + """ + + def __init__(self, + code: str, + message: str, + *, + more_info: str = None) -> None: + """ + Initialize a LifecycleReason object. + + :param str code: A snake case string succinctly identifying the reason for + this lifecycle state. + :param str message: An explanation of the reason for this lifecycle state. + :param str more_info: (optional) Link to documentation about the reason for + this lifecycle state. + """ + self.code = code + self.message = message + self.more_info = more_info + + @classmethod + def from_dict(cls, _dict: Dict) -> 'LifecycleReason': + """Initialize a LifecycleReason object from a json dictionary.""" + args = {} + if 'code' in _dict: + args['code'] = _dict.get('code') + else: + raise ValueError('Required property \'code\' not present in LifecycleReason JSON') + if 'message' in _dict: + args['message'] = _dict.get('message') + else: + raise ValueError('Required property \'message\' not present in LifecycleReason JSON') + if 'more_info' in _dict: + args['more_info'] = _dict.get('more_info') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a LifecycleReason object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'code') and self.code is not None: + _dict['code'] = self.code + if hasattr(self, 'message') and self.message is not None: + _dict['message'] = self.message + if hasattr(self, 'more_info') and self.more_info is not None: + _dict['more_info'] = self.more_info + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this LifecycleReason object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'LifecycleReason') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'LifecycleReason') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class CodeEnum(str, Enum): + """ + A snake case string succinctly identifying the reason for this lifecycle state. + """ + RESOURCE_SUSPENDED_BY_PROVIDER = 'resource_suspended_by_provider' + + class LoadBalancer(): """ LoadBalancer. @@ -39954,7 +41211,22 @@ class LoadBalancer(): :attr List[LoadBalancerPrivateIpsItem] private_ips: The private IP addresses assigned to this load balancer. :attr LoadBalancerProfileReference profile: The profile for this load balancer. - :attr str provisioning_status: The provisioning status of this load balancer. + :attr str provisioning_status: The provisioning status of this load balancer: + - `active`: The load balancer is running. + - `create_pending`: The load balancer is being created. + - `delete_pending`: The load balancer is being deleted. + - `maintenance_pending`: The load balancer is unavailable due to an internal + error (contact IBM support). + - `migrate_pending`: The load balancer is migrating to the requested + configuration. + Performance may be degraded. + - `update_pending`: The load balancer is being updated + to the requested configuration. + 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 load balancer on which the + unexpected property value was encountered. :attr List[IP] public_ips: The public IP addresses assigned to this load balancer. Applicable only for public load balancers. @@ -39969,7 +41241,10 @@ class LoadBalancer(): Applicable only for load balancers that support security groups. :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 List[SubnetReference] subnets: The subnets this load balancer is + provisioned in. The load balancer's availability depends on the availability of + the zones that the subnets reside in. + All subnets will be in the same VPC. :attr bool udp_supported: Indicates whether this load balancer supports UDP. """ @@ -40020,7 +41295,25 @@ def __init__(self, :param LoadBalancerProfileReference profile: The profile for this load balancer. :param str provisioning_status: The provisioning status of this load - balancer. + balancer: + - `active`: The load balancer is running. + - `create_pending`: The load balancer is being created. + - `delete_pending`: The load balancer is being deleted. + - `maintenance_pending`: The load balancer is unavailable due to an + internal + error (contact IBM support). + - `migrate_pending`: The load balancer is migrating to the requested + configuration. + Performance may be degraded. + - `update_pending`: The load balancer is being updated + to the requested configuration. + 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 load balancer on which + the + unexpected property value was encountered. :param List[IP] public_ips: The public IP addresses assigned to this load balancer. Applicable only for public load balancers. @@ -40037,7 +41330,9 @@ def __init__(self, :param bool security_groups_supported: Indicates whether this load balancer supports security groups. :param List[SubnetReference] subnets: The subnets this load balancer is - part of. + provisioned in. The load balancer's availability depends on the + availability of the zones that the subnets reside in. + All subnets will be in the same VPC. :param bool udp_supported: Indicates whether this load balancer supports UDP. """ @@ -40240,13 +41535,29 @@ class OperatingStatusEnum(str, Enum): class ProvisioningStatusEnum(str, Enum): """ - The provisioning status of this load balancer. + The provisioning status of this load balancer: + - `active`: The load balancer is running. + - `create_pending`: The load balancer is being created. + - `delete_pending`: The load balancer is being deleted. + - `maintenance_pending`: The load balancer is unavailable due to an internal + error (contact IBM support). + - `migrate_pending`: The load balancer is migrating to the requested + configuration. + Performance may be degraded. + - `update_pending`: The load balancer is being updated + to the requested configuration. + 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 load balancer on which the + unexpected property value was encountered. """ ACTIVE = 'active' CREATE_PENDING = 'create_pending' DELETE_PENDING = 'delete_pending' FAILED = 'failed' MAINTENANCE_PENDING = 'maintenance_pending' + MIGRATE_PENDING = 'migrate_pending' UPDATE_PENDING = 'update_pending' @@ -40501,14 +41812,14 @@ class LoadBalancerListener(): `accept_proxy_protocol` value must match that listener's `accept_proxy_protocol` value. :attr CertificateInstanceReference certificate_instance: (optional) The - certificate instance used for SSL termination. It is applicable only to `https` - protocol. + certificate instance used for SSL termination. + If absent, this listener is not using a certificate instance. :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 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, + :attr LoadBalancerListenerHTTPSRedirect https_redirect: (optional) If present, the target listener that requests are redirected to. :attr str id: The unique identifier for this load balancer listener. :attr List[LoadBalancerListenerPolicyReference] policies: (optional) The @@ -40523,16 +41834,16 @@ class LoadBalancerListener(): listener. 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` 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. + :attr str protocol: The listener protocol. + 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 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. """ def __init__(self, @@ -40579,26 +41890,25 @@ def __init__(self, by this listener. 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` 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. + :param str protocol: The listener protocol. + 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 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 - `https` - protocol. + certificate instance used for SSL termination. + If absent, this listener is not using a certificate instance. :param int connection_limit: (optional) The connection limit of the listener. :param LoadBalancerPoolReference default_pool: (optional) The default pool 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. + present, the target listener that requests are redirected to. :param List[LoadBalancerListenerPolicyReference] policies: (optional) The policies for this listener. """ @@ -40727,10 +42037,7 @@ def __ne__(self, other: 'LoadBalancerListener') -> bool: class ProtocolEnum(str, Enum): """ - 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 listener protocol. 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 @@ -40744,13 +42051,16 @@ class ProtocolEnum(str, Enum): class ProvisioningStatusEnum(str, Enum): """ - The provisioning status of this listener. + The provisioning status of this listener + 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. """ ACTIVE = 'active' CREATE_PENDING = 'create_pending' DELETE_PENDING = 'delete_pending' FAILED = 'failed' - MAINTENANCE_PENDING = 'maintenance_pending' UPDATE_PENDING = 'update_pending' @@ -41071,8 +42381,8 @@ class LoadBalancerListenerPatch(): `accept_proxy_protocol` value must match that listener's `accept_proxy_protocol` value. :attr CertificateInstanceIdentity certificate_instance: (optional) The - certificate instance used for SSL termination. It is applicable only to `https` - protocol. + certificate instance to use for SSL termination. The listener must have a + `protocol` of `https`. :attr int connection_limit: (optional) The connection limit of the listener. :attr LoadBalancerPoolIdentity default_pool: (optional) The default pool for this listener. The specified pool must: @@ -41106,14 +42416,17 @@ class LoadBalancerListenerPatch(): 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: (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` - or `udp` (if `udp_supported` is `true`) , and it cannot be changed while - `default_pool` is set. + balancer must have a unique `port` and `protocol` combination. + Load balancers in the `network` family support `tcp` and `udp` (if + `udp_supported` is `true`). Load balancers in the `application` family support + `tcp`, `http` and + `https`. + Additional restrictions: + - If `default_pool` is set, the protocol cannot be changed. - 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`. + - If another listener's `https_redirect` targets this listener, the protocol + must be + `https`. """ def __init__(self, @@ -41142,9 +42455,8 @@ def __init__(self, `accept_proxy_protocol` value must match that listener's `accept_proxy_protocol` value. :param CertificateInstanceIdentity certificate_instance: (optional) The - certificate instance used for SSL termination. It is applicable only to - `https` - protocol. + certificate instance to use for SSL termination. The listener must have a + `protocol` of `https`. :param int connection_limit: (optional) The connection limit of the listener. :param LoadBalancerPoolIdentity default_pool: (optional) The default pool @@ -41183,15 +42495,16 @@ def __init__(self, listeners for this load balancer using the same protocol. :param str protocol: (optional) The listener protocol. Each listener in the load balancer must have a unique `port` and `protocol` combination. + Load balancers in the `network` family support `tcp` and `udp` (if + `udp_supported` is `true`). Load balancers in the `application` family + support `tcp`, `http` and + `https`. Additional restrictions: - - If 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 `default_pool` is set, the protocol cannot be changed. - 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`. + - If another listener's `https_redirect` targets this listener, the + protocol must be + `https`. """ self.accept_proxy_protocol = accept_proxy_protocol self.certificate_instance = certificate_instance @@ -41282,13 +42595,16 @@ def __ne__(self, other: 'LoadBalancerListenerPatch') -> bool: 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` - or `udp` (if `udp_supported` is `true`) , and it cannot be changed while - `default_pool` is set. + `port` and `protocol` combination. + Load balancers in the `network` family support `tcp` and `udp` (if `udp_supported` + is `true`). Load balancers in the `application` family support `tcp`, `http` and + `https`. + Additional restrictions: + - If `default_pool` is set, the protocol cannot be changed. - 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`. + - If another listener's `https_redirect` targets this listener, the protocol must + be + `https`. """ HTTP = 'http' HTTPS = 'https' @@ -41311,7 +42627,11 @@ class LoadBalancerListenerPolicy(): :attr str name: The user-defined name for this policy. :attr int priority: Priority of the policy. Lower value indicates higher priority. - :attr str provisioning_status: The provisioning status of this policy. + :attr str provisioning_status: The provisioning status of this policy + 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 policy on which the unexpected + property value was encountered. :attr List[LoadBalancerListenerPolicyRuleReference] rules: The rules for this policy. :attr LoadBalancerListenerPolicyTarget target: (optional) - If `action` is @@ -41347,7 +42667,11 @@ def __init__(self, :param str name: The user-defined name for this policy. :param int priority: Priority of the policy. Lower value indicates higher priority. - :param str provisioning_status: The provisioning status of this policy. + :param str provisioning_status: The provisioning status of this policy + 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 policy on + which the unexpected property value was encountered. :param List[LoadBalancerListenerPolicyRuleReference] rules: The rules for this policy. :param LoadBalancerListenerPolicyTarget target: (optional) - If `action` is @@ -41472,13 +42796,16 @@ class ActionEnum(str, Enum): class ProvisioningStatusEnum(str, Enum): """ - The provisioning status of this policy. + The provisioning status of this policy + 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 policy on which the unexpected + property value was encountered. """ ACTIVE = 'active' CREATE_PENDING = 'create_pending' DELETE_PENDING = 'delete_pending' FAILED = 'failed' - MAINTENANCE_PENDING = 'maintenance_pending' UPDATE_PENDING = 'update_pending' @@ -41763,7 +43090,7 @@ class LoadBalancerListenerPolicyReference(): LoadBalancerListenerPolicyReference. :attr LoadBalancerListenerPolicyReferenceDeleted deleted: (optional) If present, - this property indicates the referenced resource has been deleted and provides + this property indicates the referenced resource has been deleted, and provides some supplementary information. :attr str href: The listener policy's canonical URL. :attr str id: The policy's unique identifier. @@ -41780,7 +43107,7 @@ def __init__(self, :param str href: The listener policy's canonical URL. :param str id: The policy's unique identifier. :param LoadBalancerListenerPolicyReferenceDeleted deleted: (optional) If - present, this property indicates the referenced resource has been deleted + present, this property indicates the referenced resource has been deleted, and provides some supplementary information. """ @@ -41840,7 +43167,7 @@ def __ne__(self, other: 'LoadBalancerListenerPolicyReference') -> bool: class LoadBalancerListenerPolicyReferenceDeleted(): """ - If present, this property indicates the referenced resource has been deleted and + 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. @@ -41910,7 +43237,11 @@ class LoadBalancerListenerPolicyRule(): If the rule type is `body`, this is optional. :attr str href: The rule's canonical URL. :attr str id: The rule's unique identifier. - :attr str provisioning_status: The provisioning status of this rule. + :attr str provisioning_status: The provisioning status of this rule + 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 rule on which the unexpected + property value was encountered. :attr str type: The type of the rule. Body rules are applied to form-encoded request bodies using the `UTF-8` character set. @@ -41936,7 +43267,11 @@ def __init__(self, :param datetime created_at: The date and time that this rule was created. :param str href: The rule's canonical URL. :param str id: The rule's unique identifier. - :param str provisioning_status: The provisioning status of this rule. + :param str provisioning_status: The provisioning status of this rule + 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 rule on + which the unexpected property value was encountered. :param str type: The type of the rule. Body rules are applied to form-encoded request bodies using the `UTF-8` character set. @@ -42051,13 +43386,16 @@ class ConditionEnum(str, Enum): class ProvisioningStatusEnum(str, Enum): """ - The provisioning status of this rule. + The provisioning status of this rule + 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 rule on which the unexpected + property value was encountered. """ ACTIVE = 'active' CREATE_PENDING = 'create_pending' DELETE_PENDING = 'delete_pending' FAILED = 'failed' - MAINTENANCE_PENDING = 'maintenance_pending' UPDATE_PENDING = 'update_pending' @@ -42383,7 +43721,7 @@ class LoadBalancerListenerPolicyRuleReference(): LoadBalancerListenerPolicyRuleReference. :attr LoadBalancerListenerPolicyRuleReferenceDeleted deleted: (optional) If - present, this property indicates the referenced resource has been deleted and + present, this property indicates the referenced resource has been deleted, and provides some supplementary information. :attr str href: The rule's canonical URL. @@ -42402,7 +43740,7 @@ def __init__(self, :param str id: The rule's unique identifier. :param LoadBalancerListenerPolicyRuleReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been - deleted and provides + deleted, and provides some supplementary information. """ self.deleted = deleted @@ -42461,7 +43799,7 @@ def __ne__(self, other: 'LoadBalancerListenerPolicyRuleReference') -> bool: class LoadBalancerListenerPolicyRuleReferenceDeleted(): """ - If present, this property indicates the referenced resource has been deleted and + 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. @@ -42584,15 +43922,22 @@ class LoadBalancerListenerPrototypeLoadBalancerContext(): - If this listener is the target of another listener's `https_redirect`, its `accept_proxy_protocol` value must match that listener's `accept_proxy_protocol` value. + :attr CertificateInstanceIdentity certificate_instance: (optional) The + certificate instance to use for SSL termination. The listener must have a + `protocol` of `https`. :attr int connection_limit: (optional) The connection limit of the listener. :attr LoadBalancerPoolIdentityByName default_pool: (optional) The default 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`. + for this listener. If specified, the pool must: + - Belong to this load balancer. + - Have the same `protocol` as this listener, or have a compatible protocol. + At present, the compatible protocols are `http` and `https`. + - Not already be the `default_pool` for another listener. If unspecified, this listener will be created with no default pool, but one may be subsequently set. + :attr LoadBalancerListenerHTTPSRedirectPrototype 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`. :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. @@ -42613,38 +43958,47 @@ class LoadBalancerListenerPrototypeLoadBalancerContext(): `port_max`. When route mode is enabled, the value `1` must be specified. The specified port range must not overlap with port ranges used by other listeners for this load balancer using the same protocol. - :attr str protocol: 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. + :attr str protocol: The listener protocol. Each listener in the load balancer + must have a unique `port` and `protocol` combination. + Load balancers in the `network` family support `tcp` and `udp` (if + `udp_supported` is `true`). Load balancers in the `application` family support + `tcp`, `http` and + `https`. + Additional restrictions: + - If `default_pool` is set, the pool's protocol must match, or be compatible + with + the listener's protocol. At present, the compatible protocols are `http` and + `https`. + - If `https_redirect` is set, the protocol must be `http`. """ def __init__(self, protocol: str, *, accept_proxy_protocol: bool = None, + certificate_instance: 'CertificateInstanceIdentity' = None, connection_limit: int = None, default_pool: 'LoadBalancerPoolIdentityByName' = None, + https_redirect: 'LoadBalancerListenerHTTPSRedirectPrototype' = None, port: int = None, port_max: int = None, port_min: int = None) -> None: """ Initialize a LoadBalancerListenerPrototypeLoadBalancerContext object. - :param str protocol: 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 + :param str protocol: The listener protocol. 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. + Load balancers in the `network` family support `tcp` and `udp` (if + `udp_supported` is `true`). Load balancers in the `application` family + support `tcp`, `http` and + `https`. + Additional restrictions: + - If `default_pool` is set, the pool's protocol must match, or be + compatible with + the listener's protocol. At present, the compatible protocols are `http` + and + `https`. + - If `https_redirect` is set, the protocol must be `http`. :param bool accept_proxy_protocol: (optional) If set to `true`, this listener will accept and forward PROXY protocol information. Supported by load balancers in the `application` family (otherwise always `false`). @@ -42656,16 +44010,26 @@ def __init__(self, its `accept_proxy_protocol` value must match that listener's `accept_proxy_protocol` value. + :param CertificateInstanceIdentity certificate_instance: (optional) The + certificate instance to use for SSL termination. The listener must have a + `protocol` of `https`. :param int connection_limit: (optional) The connection limit of the listener. :param LoadBalancerPoolIdentityByName default_pool: (optional) The default - 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`. + pool for this listener. If specified, the pool must: + - Belong to this load balancer. + - Have the same `protocol` as this listener, or have a compatible + protocol. + At present, the compatible protocols are `http` and `https`. + - Not already be the `default_pool` for another listener. If unspecified, this listener will be created with no default pool, but one may be subsequently set. + :param LoadBalancerListenerHTTPSRedirectPrototype https_redirect: + (optional) The target listener that requests will be redirected to. This + listener must have a + `protocol` of `http`, and the target listener must have a `protocol` of + `https`. :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. @@ -42689,8 +44053,10 @@ def __init__(self, listeners for this load balancer using the same protocol. """ self.accept_proxy_protocol = accept_proxy_protocol + self.certificate_instance = certificate_instance self.connection_limit = connection_limit self.default_pool = default_pool + self.https_redirect = https_redirect self.port = port self.port_max = port_max self.port_min = port_min @@ -42702,10 +44068,14 @@ def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPrototypeLoadBalancerCon args = {} if 'accept_proxy_protocol' in _dict: args['accept_proxy_protocol'] = _dict.get('accept_proxy_protocol') + if 'certificate_instance' in _dict: + args['certificate_instance'] = _dict.get('certificate_instance') if 'connection_limit' in _dict: args['connection_limit'] = _dict.get('connection_limit') if 'default_pool' in _dict: args['default_pool'] = LoadBalancerPoolIdentityByName.from_dict(_dict.get('default_pool')) + if 'https_redirect' in _dict: + args['https_redirect'] = LoadBalancerListenerHTTPSRedirectPrototype.from_dict(_dict.get('https_redirect')) if 'port' in _dict: args['port'] = _dict.get('port') if 'port_max' in _dict: @@ -42728,10 +44098,17 @@ def to_dict(self) -> Dict: _dict = {} if hasattr(self, 'accept_proxy_protocol') and self.accept_proxy_protocol is not None: _dict['accept_proxy_protocol'] = self.accept_proxy_protocol + if hasattr(self, 'certificate_instance') and self.certificate_instance is not None: + if isinstance(self.certificate_instance, dict): + _dict['certificate_instance'] = self.certificate_instance + else: + _dict['certificate_instance'] = self.certificate_instance.to_dict() if hasattr(self, 'connection_limit') and self.connection_limit is not None: _dict['connection_limit'] = self.connection_limit if hasattr(self, 'default_pool') and self.default_pool is not None: _dict['default_pool'] = self.default_pool.to_dict() + if hasattr(self, 'https_redirect') and self.https_redirect is not None: + _dict['https_redirect'] = self.https_redirect.to_dict() if hasattr(self, 'port') and self.port is not None: _dict['port'] = self.port if hasattr(self, 'port_max') and self.port_max is not None: @@ -42762,14 +44139,16 @@ def __ne__(self, other: 'LoadBalancerListenerPrototypeLoadBalancerContext') -> b class ProtocolEnum(str, Enum): """ - 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. + The listener protocol. Each listener in the load balancer must have a unique + `port` and `protocol` combination. + Load balancers in the `network` family support `tcp` and `udp` (if `udp_supported` + is `true`). Load balancers in the `application` family support `tcp`, `http` and + `https`. + Additional restrictions: + - If `default_pool` is set, the pool's protocol must match, or be compatible with + the listener's protocol. At present, the compatible protocols are `http` and + `https`. + - If `https_redirect` is set, the protocol must be `http`. """ HTTP = 'http' HTTPS = 'https' @@ -42782,7 +44161,7 @@ class LoadBalancerListenerReference(): LoadBalancerListenerReference. :attr LoadBalancerListenerReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted and provides + property indicates the referenced resource has been deleted, and provides some supplementary information. :attr str href: The listener's canonical URL. :attr str id: The unique identifier for this load balancer listener. @@ -42799,7 +44178,7 @@ def __init__(self, :param str href: The listener's canonical URL. :param str id: The unique identifier for this load balancer listener. :param LoadBalancerListenerReferenceDeleted deleted: (optional) If present, - this property indicates the referenced resource has been deleted and + this property indicates the referenced resource has been deleted, and provides some supplementary information. """ @@ -42859,7 +44238,7 @@ def __ne__(self, other: 'LoadBalancerListenerReference') -> bool: class LoadBalancerListenerReferenceDeleted(): """ - If present, this property indicates the referenced resource has been deleted and + 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. @@ -42916,7 +44295,7 @@ def __ne__(self, other: 'LoadBalancerListenerReferenceDeleted') -> bool: class LoadBalancerLogging(): """ - The logging configuration for this load balancer. + LoadBalancerLogging. :attr LoadBalancerLoggingDatapath datapath: (optional) The datapath logging configuration for this load balancer. @@ -43038,12 +44417,19 @@ class LoadBalancerPatch(): To activate logging, the load balancer profile must support the specified logging type. :attr str name: (optional) The unique user-defined name for this load balancer. + :attr List[SubnetIdentity] subnets: (optional) The subnets to provision this + load balancer in. The load balancer's availability will depend on the + availability of the zones that the subnets reside in. + The specified subnets must be in the same VPC as the existing subnets, and will + completely replace the existing subnets. + The load balancer must be in the `application` family. """ def __init__(self, *, logging: 'LoadBalancerLogging' = None, - name: str = None) -> None: + name: str = None, + subnets: List['SubnetIdentity'] = None) -> None: """ Initialize a LoadBalancerPatch object. @@ -43053,9 +44439,16 @@ def __init__(self, logging type. :param str name: (optional) The unique user-defined name for this load balancer. + :param List[SubnetIdentity] subnets: (optional) The subnets to provision + this load balancer in. The load balancer's availability will depend on the + availability of the zones that the subnets reside in. + The specified subnets must be in the same VPC as the existing subnets, and + will completely replace the existing subnets. + The load balancer must be in the `application` family. """ self.logging = logging self.name = name + self.subnets = subnets @classmethod def from_dict(cls, _dict: Dict) -> 'LoadBalancerPatch': @@ -43065,6 +44458,8 @@ def from_dict(cls, _dict: Dict) -> 'LoadBalancerPatch': args['logging'] = LoadBalancerLogging.from_dict(_dict.get('logging')) if 'name' in _dict: args['name'] = _dict.get('name') + if 'subnets' in _dict: + args['subnets'] = _dict.get('subnets') return cls(**args) @classmethod @@ -43079,6 +44474,14 @@ def to_dict(self) -> Dict: _dict['logging'] = self.logging.to_dict() if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name + if hasattr(self, 'subnets') and self.subnets is not None: + subnets_list = [] + for x in self.subnets: + if isinstance(x, dict): + subnets_list.append(x) + else: + subnets_list.append(x.to_dict()) + _dict['subnets'] = subnets_list return _dict def _to_dict(self): @@ -43114,12 +44517,16 @@ class LoadBalancerPool(): :attr List[LoadBalancerPoolMemberReference] members: (optional) The backend server members of the pool. :attr str name: The user-defined name for this load balancer pool. - :attr str protocol: The protocol used for this load balancer pool. + :attr str protocol: The protocol 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 provisioning_status: The provisioning status of this 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 provisioning_status: The provisioning status of this pool. :attr str proxy_protocol: The PROXY protocol setting for this pool: - `v1`: Enabled with version 1 (human-readable header format) - `v2`: Enabled with version 2 (binary header format) @@ -43159,12 +44566,16 @@ def __init__(self, :param str href: The pool's canonical URL. :param str id: The unique identifier for this load balancer pool. :param str name: The user-defined name for this load balancer pool. - :param str protocol: The protocol used for this load balancer pool. + :param str protocol: The protocol 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 provisioning_status: The provisioning status of this 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 provisioning_status: The provisioning status of this pool. :param str proxy_protocol: The PROXY protocol setting for this pool: - `v1`: Enabled with version 1 (human-readable header format) - `v2`: Enabled with version 2 (binary header format) @@ -43308,7 +44719,7 @@ class AlgorithmEnum(str, Enum): class ProtocolEnum(str, Enum): """ - The protocol used for this load balancer pool. + The protocol 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 @@ -43322,13 +44733,16 @@ class ProtocolEnum(str, Enum): class ProvisioningStatusEnum(str, Enum): """ - The provisioning status of this pool. + The provisioning status of this 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. """ ACTIVE = 'active' CREATE_PENDING = 'create_pending' DELETE_PENDING = 'delete_pending' FAILED = 'failed' - MAINTENANCE_PENDING = 'maintenance_pending' UPDATE_PENDING = 'update_pending' @@ -43406,20 +44820,19 @@ class LoadBalancerPoolHealthMonitor(): """ LoadBalancerPoolHealthMonitor. - :attr int delay: The health check interval in seconds. Interval must be greater - than timeout value. + :attr int delay: The seconds to wait between health checks. :attr int max_retries: The health check max retries. - :attr int port: (optional) The health check port number. If specified, this - overrides the ports specified in the server member resources. - :attr int timeout: The health check timeout in seconds. - :attr str type: The protocol type of this load balancer pool health monitor. + :attr int port: (optional) The health check port. + If present, this overrides the pool member port values. + :attr int timeout: The seconds to wait for a response to a health check. + :attr str type: The protocol type to use for health checks. 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 health monitor on which the unexpected property value was encountered. - :attr str url_path: (optional) The health check URL path. Applicable only if the - health monitor `type` is `http` or - `https`. This value must be in the format of an [origin-form request + :attr str url_path: (optional) The health check URL path. Applicable when `type` + is `http` or `https`. + Must be in the format of an [origin-form request target](https://tools.ietf.org/html/rfc7230#section-5.3.1). """ @@ -43434,21 +44847,19 @@ def __init__(self, """ Initialize a LoadBalancerPoolHealthMonitor object. - :param int delay: The health check interval in seconds. Interval must be - greater than timeout value. + :param int delay: The seconds to wait between health checks. :param int max_retries: The health check max retries. - :param int timeout: The health check timeout in seconds. - :param str type: The protocol type of this load balancer pool health - monitor. + :param int timeout: The seconds to wait for a response to a health check. + :param str type: The protocol type to use for health checks. 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 health monitor on which the unexpected property value was encountered. - :param int port: (optional) The health check port number. If specified, - this overrides the ports specified in the server member resources. - :param str url_path: (optional) The health check URL path. Applicable only - if the health monitor `type` is `http` or - `https`. This value must be in the format of an [origin-form request + :param int port: (optional) The health check port. + If present, this overrides the pool member port values. + :param str url_path: (optional) The health check URL path. Applicable when + `type` is `http` or `https`. + Must be in the format of an [origin-form request target](https://tools.ietf.org/html/rfc7230#section-5.3.1). """ self.delay = delay @@ -43526,7 +44937,7 @@ def __ne__(self, other: 'LoadBalancerPoolHealthMonitor') -> bool: class TypeEnum(str, Enum): """ - The protocol type of this load balancer pool health monitor. + The protocol type to use for health checks. 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 health monitor on which the @@ -43541,17 +44952,18 @@ class LoadBalancerPoolHealthMonitorPatch(): """ LoadBalancerPoolHealthMonitorPatch. - :attr int delay: The health check interval in seconds. Interval must be greater - than timeout value. + :attr int delay: The seconds to wait between health checks. Must be greater + than `timeout`. :attr int max_retries: The health check max retries. - :attr int port: (optional) The health check port number. If specified, this - overrides the ports specified in the server member resources. Specify `null` to - remove an existing port value. - :attr int timeout: The health check timeout in seconds. - :attr str type: The protocol type of this load balancer pool health monitor. - :attr str url_path: (optional) The health check URL path. Applicable only if the - health monitor `type` is `http` or - `https`. This value must be in the format of an [origin-form request + :attr int port: (optional) The health check port. + If set, this overrides the pool member port values. + Specify `null` to remove an existing health check port. + :attr int timeout: The seconds to wait for a response to a health check. Must + be less than `delay`. + :attr str type: The protocol type to use for health checks. + :attr str url_path: (optional) The health check URL path. Applicable when `type` + is `http` or `https`. + Must be in the format of an [origin-form request target](https://tools.ietf.org/html/rfc7230#section-5.3.1). """ @@ -43566,18 +44978,18 @@ def __init__(self, """ Initialize a LoadBalancerPoolHealthMonitorPatch object. - :param int delay: The health check interval in seconds. Interval must be - greater than timeout value. + :param int delay: The seconds to wait between health checks. Must be + greater than `timeout`. :param int max_retries: The health check max retries. - :param int timeout: The health check timeout in seconds. - :param str type: The protocol type of this load balancer pool health - monitor. - :param int port: (optional) The health check port number. If specified, - this overrides the ports specified in the server member resources. Specify - `null` to remove an existing port value. - :param str url_path: (optional) The health check URL path. Applicable only - if the health monitor `type` is `http` or - `https`. This value must be in the format of an [origin-form request + :param int timeout: The seconds to wait for a response to a health check. + Must be less than `delay`. + :param str type: The protocol type to use for health checks. + :param int port: (optional) The health check port. + If set, this overrides the pool member port values. + Specify `null` to remove an existing health check port. + :param str url_path: (optional) The health check URL path. Applicable when + `type` is `http` or `https`. + Must be in the format of an [origin-form request target](https://tools.ietf.org/html/rfc7230#section-5.3.1). """ self.delay = delay @@ -43655,7 +45067,7 @@ def __ne__(self, other: 'LoadBalancerPoolHealthMonitorPatch') -> bool: class TypeEnum(str, Enum): """ - The protocol type of this load balancer pool health monitor. + The protocol type to use for health checks. """ HTTP = 'http' HTTPS = 'https' @@ -43666,16 +45078,17 @@ class LoadBalancerPoolHealthMonitorPrototype(): """ LoadBalancerPoolHealthMonitorPrototype. - :attr int delay: The health check interval in seconds. Interval must be greater - than timeout value. + :attr int delay: The seconds to wait between health checks. Must be greater + than `timeout`. :attr int max_retries: The health check max retries. - :attr int port: (optional) The health check port number. If specified, this - overrides the ports specified in the server member resources. - :attr int timeout: The health check timeout in seconds. - :attr str type: The protocol type of this load balancer pool health monitor. - :attr str url_path: (optional) The health check URL path. Applicable only if the - health monitor `type` is `http` or - `https`. This value must be in the format of an [origin-form request + :attr int port: (optional) The health check port. + If specified, this overrides the pool member port values. + :attr int timeout: The seconds to wait for a response to a health check. Must + be less than `delay`. + :attr str type: The protocol type to use for health checks. + :attr str url_path: (optional) The health check URL path. Applicable when `type` + is `http` or `https`. + Must be in the format of an [origin-form request target](https://tools.ietf.org/html/rfc7230#section-5.3.1). """ @@ -43690,17 +45103,17 @@ def __init__(self, """ Initialize a LoadBalancerPoolHealthMonitorPrototype object. - :param int delay: The health check interval in seconds. Interval must be - greater than timeout value. + :param int delay: The seconds to wait between health checks. Must be + greater than `timeout`. :param int max_retries: The health check max retries. - :param int timeout: The health check timeout in seconds. - :param str type: The protocol type of this load balancer pool health - monitor. - :param int port: (optional) The health check port number. If specified, - this overrides the ports specified in the server member resources. - :param str url_path: (optional) The health check URL path. Applicable only - if the health monitor `type` is `http` or - `https`. This value must be in the format of an [origin-form request + :param int timeout: The seconds to wait for a response to a health check. + Must be less than `delay`. + :param str type: The protocol type to use for health checks. + :param int port: (optional) The health check port. + If specified, this overrides the pool member port values. + :param str url_path: (optional) The health check URL path. Applicable when + `type` is `http` or `https`. + Must be in the format of an [origin-form request target](https://tools.ietf.org/html/rfc7230#section-5.3.1). """ self.delay = delay @@ -43778,7 +45191,7 @@ def __ne__(self, other: 'LoadBalancerPoolHealthMonitorPrototype') -> bool: class TypeEnum(str, Enum): """ - The protocol type of this load balancer pool health monitor. + The protocol type to use for health checks. """ HTTP = 'http' HTTPS = 'https' @@ -43870,7 +45283,11 @@ class LoadBalancerPoolMember(): receive the traffic on the same port the listener received it on.) This port will also be used for health checks unless the `port` property of `health_monitor` property is specified. - :attr str provisioning_status: The provisioning status of this member. + :attr str provisioning_status: The provisioning status of this member + 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 member on which the + unexpected property value was encountered. :attr LoadBalancerPoolMemberTarget target: The pool member target. Load balancers in the `network` family support virtual server instances. Load balancers in the `application` family support IP addresses. If @@ -43907,7 +45324,11 @@ def __init__(self, on.) This port will also be used for health checks unless the `port` property of `health_monitor` property is specified. - :param str provisioning_status: The provisioning status of this member. + :param str provisioning_status: The provisioning status of this member + 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 member + on which the unexpected property value was encountered. :param LoadBalancerPoolMemberTarget target: The pool member target. Load balancers in the `network` family support virtual server instances. Load balancers in the `application` family support IP addresses. @@ -44022,13 +45443,16 @@ class HealthEnum(str, Enum): class ProvisioningStatusEnum(str, Enum): """ - The provisioning status of this member. + The provisioning status of this member + 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 member on which the + unexpected property value was encountered. """ ACTIVE = 'active' CREATE_PENDING = 'create_pending' DELETE_PENDING = 'delete_pending' FAILED = 'failed' - MAINTENANCE_PENDING = 'maintenance_pending' UPDATE_PENDING = 'update_pending' @@ -44308,7 +45732,7 @@ class LoadBalancerPoolMemberReference(): LoadBalancerPoolMemberReference. :attr LoadBalancerPoolMemberReferenceDeleted deleted: (optional) If present, - this property indicates the referenced resource has been deleted and provides + this property indicates the referenced resource has been deleted, and provides some supplementary information. :attr str href: The member's canonical URL. :attr str id: The unique identifier for this load balancer pool member. @@ -44325,7 +45749,7 @@ def __init__(self, :param str href: The member's canonical URL. :param str id: The unique identifier for this load balancer pool member. :param LoadBalancerPoolMemberReferenceDeleted deleted: (optional) If - present, this property indicates the referenced resource has been deleted + present, this property indicates the referenced resource has been deleted, and provides some supplementary information. """ @@ -44385,7 +45809,7 @@ def __ne__(self, other: 'LoadBalancerPoolMemberReference') -> bool: class LoadBalancerPoolMemberReferenceDeleted(): """ - If present, this property indicates the referenced resource has been deleted and + 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. @@ -44484,13 +45908,14 @@ 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 to use for this load balancer pool. + :attr str protocol: (optional) The protocol 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`. + `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`. + must match, or 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) @@ -44517,13 +45942,14 @@ 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 to use for this load balancer - pool. Load balancers in the `network` family support `tcp` and `udp` (if + :param str protocol: (optional) The protocol 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`. + 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`. + protocol must match, or 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) @@ -44610,12 +46036,13 @@ class AlgorithmEnum(str, Enum): class ProtocolEnum(str, Enum): """ - 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`. + The protocol 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`. + must match, or be compatible with the listener's protocol. At present, the + compatible protocols are `http` and `https`. """ HTTP = 'http' HTTPS = 'https' @@ -44817,7 +46244,7 @@ class LoadBalancerPoolReference(): LoadBalancerPoolReference. :attr LoadBalancerPoolReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted and provides + property indicates the referenced resource has been deleted, and provides some supplementary information. :attr str href: The pool's canonical URL. :attr str id: The unique identifier for this load balancer pool. @@ -44837,7 +46264,7 @@ def __init__(self, :param str id: The unique identifier for this load balancer pool. :param str name: The user-defined name for this load balancer pool. :param LoadBalancerPoolReferenceDeleted deleted: (optional) If present, - this property indicates the referenced resource has been deleted and + this property indicates the referenced resource has been deleted, and provides some supplementary information. """ @@ -44904,7 +46331,7 @@ def __ne__(self, other: 'LoadBalancerPoolReference') -> bool: class LoadBalancerPoolReferenceDeleted(): """ - If present, this property indicates the referenced resource has been deleted and + 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. @@ -45213,7 +46640,7 @@ class LoadBalancerPrivateIpsItem(): 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 + 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. @@ -45245,7 +46672,7 @@ def __init__(self, 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 + property indicates the referenced resource has been deleted, and provides some supplementary information. """ self.address = address @@ -45890,7 +47317,7 @@ def __init__(self) -> None: class LoadBalancerReferenceDeleted(): """ - If present, this property indicates the referenced resource has been deleted and + 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. @@ -46052,7 +47479,7 @@ class NetworkACL(): no rules exist, all traffic will be denied. :attr List[SubnetReference] subnets: The subnets to which this network ACL is attached. - :attr VPCReference vpc: The VPC this network ACL is a part of. + :attr VPCReference vpc: The VPC this network ACL resides in. """ def __init__(self, @@ -46080,7 +47507,7 @@ def __init__(self, ACL. If no rules exist, all traffic will be denied. :param List[SubnetReference] subnets: The subnets to which this network ACL is attached. - :param VPCReference vpc: The VPC this network ACL is a part of. + :param VPCReference vpc: The VPC this network ACL resides in. """ self.created_at = created_at self.crn = crn @@ -46477,7 +47904,7 @@ class NetworkACLPrototype(): :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 VPCIdentity vpc: The VPC this network ACL is to be a part of. + :attr VPCIdentity vpc: The VPC this network ACL will reside in. """ def __init__(self, @@ -46488,7 +47915,7 @@ def __init__(self, """ Initialize a NetworkACLPrototype object. - :param VPCIdentity vpc: The VPC this network ACL is to be a part of. + :param VPCIdentity vpc: The VPC this network ACL will reside in. :param str name: (optional) The user-defined name for this network ACL. Names must be unique within the VPC the network ACL resides in. If unspecified, the name will be a hyphenated list of randomly-selected words. @@ -46507,7 +47934,7 @@ class NetworkACLReference(): :attr str crn: The CRN for this network ACL. :attr NetworkACLReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted and provides + indicates the referenced resource has been deleted, and provides some supplementary information. :attr str href: The URL for this network ACL. :attr str id: The unique identifier for this network ACL. @@ -46529,7 +47956,7 @@ def __init__(self, :param str id: The unique identifier for this network ACL. :param str name: The user-defined name for this network ACL. :param NetworkACLReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted and provides + property indicates the referenced resource has been deleted, and provides some supplementary information. """ self.crn = crn @@ -46602,7 +48029,7 @@ def __ne__(self, other: 'NetworkACLReference') -> bool: class NetworkACLReferenceDeleted(): """ - If present, this property indicates the referenced resource has been deleted and + 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. @@ -46661,23 +48088,20 @@ class NetworkACLRule(): """ NetworkACLRule. - :attr str action: Whether to allow or deny matching traffic. + :attr str action: The action to perform for a packet matching the rule. :attr NetworkACLRuleReference before: (optional) The rule that this rule is immediately before. If absent, this is the last rule. :attr datetime created_at: The date and time that the rule was created. - :attr str destination: The destination CIDR block. The CIDR block `0.0.0.0/0` - applies to all addresses. - :attr str direction: Whether the traffic to be matched is `inbound` or - `outbound`. + :attr str destination: The destination IP address or CIDR block to match. The + CIDR block `0.0.0.0/0` matches all destination addresses. + :attr str direction: The direction of traffic to match. :attr str href: The URL for this network ACL rule. :attr str id: The unique identifier for this network ACL rule. :attr str ip_version: The IP version for this rule. - :attr str name: The user-defined name for this rule. Names must be unique within - the network ACL the rule resides in. If unspecified, the name will be a - hyphenated list of randomly-selected words. + :attr str name: The user-defined name for this network ACL rule. :attr str protocol: The protocol to enforce. - :attr str source: The source CIDR block. The CIDR block `0.0.0.0/0` applies to - all addresses. + :attr str source: The source IP address or CIDR block to match. The CIDR block + `0.0.0.0/0` matches all source addresses. """ def __init__(self, @@ -46696,21 +48120,18 @@ def __init__(self, """ Initialize a NetworkACLRule object. - :param str action: Whether to allow or deny matching traffic. + :param str action: The action to perform for a packet matching the rule. :param datetime created_at: The date and time that the rule was created. - :param str destination: The destination CIDR block. The CIDR block - `0.0.0.0/0` applies to all addresses. - :param str direction: Whether the traffic to be matched is `inbound` or - `outbound`. + :param str destination: The destination IP address or CIDR block to match. + The CIDR block `0.0.0.0/0` matches all destination addresses. + :param str direction: The direction of traffic to match. :param str href: The URL for this network ACL rule. :param str id: The unique identifier for this network ACL rule. :param str ip_version: The IP version for this rule. - :param str name: The user-defined name for this rule. Names must be unique - within the network ACL the rule resides in. If unspecified, the name will - be a hyphenated list of randomly-selected words. + :param str name: The user-defined name for this network ACL rule. :param str protocol: The protocol to enforce. - :param str source: The source CIDR block. The CIDR block `0.0.0.0/0` - applies to all addresses. + :param str source: The source IP address or CIDR block to match. The CIDR + block `0.0.0.0/0` matches all source addresses. :param NetworkACLRuleReference before: (optional) The rule that this rule is immediately before. If absent, this is the last rule. """ @@ -46755,7 +48176,7 @@ def _get_class_by_discriminator(cls, _dict: Dict) -> object: class ActionEnum(str, Enum): """ - Whether to allow or deny matching traffic. + The action to perform for a packet matching the rule. """ ALLOW = 'allow' DENY = 'deny' @@ -46763,7 +48184,7 @@ class ActionEnum(str, Enum): class DirectionEnum(str, Enum): """ - Whether the traffic to be matched is `inbound` or `outbound`. + The direction of traffic to match. """ INBOUND = 'inbound' OUTBOUND = 'outbound' @@ -46774,13 +48195,22 @@ class IpVersionEnum(str, Enum): The IP version for this rule. """ IPV4 = 'ipv4' - IPV6 = 'ipv6' + + + class ProtocolEnum(str, Enum): + """ + The protocol to enforce. + """ + ALL = 'all' + ICMP = 'icmp' + TCP = 'tcp' + UDP = 'udp' class NetworkACLRuleBeforePatch(): """ - The rule to move this rule immediately before. Specify `null` to move this rule after - all existing rules. + The rule to move this rule immediately before. + Specify `null` to move this rule after all existing rules. """ @@ -46795,8 +48225,8 @@ def __init__(self) -> None: class NetworkACLRuleBeforePrototype(): """ - The rule to insert this rule immediately before. If omitted, this rule will be - inserted after all existing rules. + The rule to insert this rule immediately before. + If unspecified, this rule will be inserted after all existing rules. """ @@ -47030,24 +48460,21 @@ class NetworkACLRuleItem(): """ NetworkACLRuleItem. - :attr str action: Whether to allow or deny matching traffic. + :attr str action: The action to perform for a packet matching the rule. :attr NetworkACLRuleReference before: (optional) The rule that this rule is immediately before. In a rule collection, this always refers to the next item in the collection. If absent, this is the last rule. :attr datetime created_at: The date and time that the rule was created. - :attr str destination: The destination CIDR block. The CIDR block `0.0.0.0/0` - applies to all addresses. - :attr str direction: Whether the traffic to be matched is `inbound` or - `outbound`. + :attr str destination: The destination IP address or CIDR block to match. The + CIDR block `0.0.0.0/0` matches all destination addresses. + :attr str direction: The direction of traffic to match. :attr str href: The URL for this network ACL rule. :attr str id: The unique identifier for this network ACL rule. :attr str ip_version: The IP version for this rule. - :attr str name: The user-defined name for this rule. Names must be unique within - the network ACL the rule resides in. If unspecified, the name will be a - hyphenated list of randomly-selected words. + :attr str name: The user-defined name for this network ACL rule. :attr str protocol: The protocol to enforce. - :attr str source: The source CIDR block. The CIDR block `0.0.0.0/0` applies to - all addresses. + :attr str source: The source IP address or CIDR block to match. The CIDR block + `0.0.0.0/0` matches all source addresses. """ def __init__(self, @@ -47066,21 +48493,18 @@ def __init__(self, """ Initialize a NetworkACLRuleItem object. - :param str action: Whether to allow or deny matching traffic. + :param str action: The action to perform for a packet matching the rule. :param datetime created_at: The date and time that the rule was created. - :param str destination: The destination CIDR block. The CIDR block - `0.0.0.0/0` applies to all addresses. - :param str direction: Whether the traffic to be matched is `inbound` or - `outbound`. + :param str destination: The destination IP address or CIDR block to match. + The CIDR block `0.0.0.0/0` matches all destination addresses. + :param str direction: The direction of traffic to match. :param str href: The URL for this network ACL rule. :param str id: The unique identifier for this network ACL rule. :param str ip_version: The IP version for this rule. - :param str name: The user-defined name for this rule. Names must be unique - within the network ACL the rule resides in. If unspecified, the name will - be a hyphenated list of randomly-selected words. + :param str name: The user-defined name for this network ACL rule. :param str protocol: The protocol to enforce. - :param str source: The source CIDR block. The CIDR block `0.0.0.0/0` - applies to all addresses. + :param str source: The source IP address or CIDR block to match. The CIDR + block `0.0.0.0/0` matches all source addresses. :param NetworkACLRuleReference before: (optional) The rule that this rule is immediately before. In a rule collection, this always refers to the next item in the collection. If absent, this is the last @@ -47127,7 +48551,7 @@ def _get_class_by_discriminator(cls, _dict: Dict) -> object: class ActionEnum(str, Enum): """ - Whether to allow or deny matching traffic. + The action to perform for a packet matching the rule. """ ALLOW = 'allow' DENY = 'deny' @@ -47135,7 +48559,7 @@ class ActionEnum(str, Enum): class DirectionEnum(str, Enum): """ - Whether the traffic to be matched is `inbound` or `outbound`. + The direction of traffic to match. """ INBOUND = 'inbound' OUTBOUND = 'outbound' @@ -47146,35 +48570,45 @@ class IpVersionEnum(str, Enum): The IP version for this rule. """ IPV4 = 'ipv4' - IPV6 = 'ipv6' + + + class ProtocolEnum(str, Enum): + """ + The protocol to enforce. + """ + ALL = 'all' + ICMP = 'icmp' + TCP = 'tcp' + UDP = 'udp' class NetworkACLRulePatch(): """ NetworkACLRulePatch. - :attr str action: (optional) Whether to allow or deny matching traffic. + :attr str action: (optional) The action to perform for a packet matching the + rule. :attr NetworkACLRuleBeforePatch before: (optional) The rule to move this rule - immediately before. Specify `null` to move this rule after - all existing rules. - :attr int code: (optional) The ICMP traffic code to allow. - :attr str destination: (optional) The destination IP address or CIDR block. The - CIDR block `0.0.0.0/0` applies to all addresses. + immediately before. + Specify `null` to move this rule after all existing rules. + :attr int code: (optional) The ICMP traffic code to match. + :attr str destination: (optional) The destination IP address or CIDR block to + match. The CIDR block `0.0.0.0/0` matches all destination addresses. :attr int destination_port_max: (optional) The inclusive upper bound of TCP/UDP destination port range. :attr int destination_port_min: (optional) The inclusive lower bound of TCP/UDP destination port range. - :attr str direction: (optional) Whether the traffic to be matched is `inbound` - or `outbound`. + :attr str direction: (optional) The direction of traffic to match. :attr str name: (optional) The user-defined name for this rule. Names must be unique within the network ACL the rule resides in. - :attr str source: (optional) The source IP address or CIDR block. The CIDR - block `0.0.0.0/0` applies to all addresses. + :attr str protocol: (optional) The protocol to enforce. + :attr str source: (optional) The source IP address or CIDR block to match. The + CIDR block `0.0.0.0/0` matches all source addresses. :attr int source_port_max: (optional) The inclusive upper bound of TCP/UDP source port range. :attr int source_port_min: (optional) The inclusive lower bound of TCP/UDP source port range. - :attr int type: (optional) The ICMP traffic type to allow. + :attr int type: (optional) The ICMP traffic type to match. """ def __init__(self, @@ -47187,6 +48621,7 @@ def __init__(self, destination_port_min: int = None, direction: str = None, name: str = None, + protocol: str = None, source: str = None, source_port_max: int = None, source_port_min: int = None, @@ -47194,28 +48629,29 @@ def __init__(self, """ Initialize a NetworkACLRulePatch object. - :param str action: (optional) Whether to allow or deny matching traffic. + :param str action: (optional) The action to perform for a packet matching + the rule. :param NetworkACLRuleBeforePatch before: (optional) The rule to move this - rule immediately before. Specify `null` to move this rule after - all existing rules. - :param int code: (optional) The ICMP traffic code to allow. - :param str destination: (optional) The destination IP address or CIDR - block. The CIDR block `0.0.0.0/0` applies to all addresses. + rule immediately before. + Specify `null` to move this rule after all existing rules. + :param int code: (optional) The ICMP traffic code to match. + :param str destination: (optional) The destination IP address or CIDR block + to match. The CIDR block `0.0.0.0/0` matches all destination addresses. :param int destination_port_max: (optional) The inclusive upper bound of TCP/UDP destination port range. :param int destination_port_min: (optional) The inclusive lower bound of TCP/UDP destination port range. - :param str direction: (optional) Whether the traffic to be matched is - `inbound` or `outbound`. + :param str direction: (optional) The direction of traffic to match. :param str name: (optional) The user-defined name for this rule. Names must be unique within the network ACL the rule resides in. - :param str source: (optional) The source IP address or CIDR block. The - CIDR block `0.0.0.0/0` applies to all addresses. + :param str protocol: (optional) The protocol to enforce. + :param str source: (optional) The source IP address or CIDR block to match. + The CIDR block `0.0.0.0/0` matches all source addresses. :param int source_port_max: (optional) The inclusive upper bound of TCP/UDP source port range. :param int source_port_min: (optional) The inclusive lower bound of TCP/UDP source port range. - :param int type: (optional) The ICMP traffic type to allow. + :param int type: (optional) The ICMP traffic type to match. """ self.action = action self.before = before @@ -47225,6 +48661,7 @@ def __init__(self, self.destination_port_min = destination_port_min self.direction = direction self.name = name + self.protocol = protocol self.source = source self.source_port_max = source_port_max self.source_port_min = source_port_min @@ -47250,6 +48687,8 @@ def from_dict(cls, _dict: Dict) -> 'NetworkACLRulePatch': args['direction'] = _dict.get('direction') if 'name' in _dict: args['name'] = _dict.get('name') + if 'protocol' in _dict: + args['protocol'] = _dict.get('protocol') if 'source' in _dict: args['source'] = _dict.get('source') if 'source_port_max' in _dict: @@ -47287,6 +48726,8 @@ def to_dict(self) -> Dict: _dict['direction'] = self.direction if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name + if hasattr(self, 'protocol') and self.protocol is not None: + _dict['protocol'] = self.protocol if hasattr(self, 'source') and self.source is not None: _dict['source'] = self.source if hasattr(self, 'source_port_max') and self.source_port_max is not None: @@ -47317,7 +48758,7 @@ def __ne__(self, other: 'NetworkACLRulePatch') -> bool: class ActionEnum(str, Enum): """ - Whether to allow or deny matching traffic. + The action to perform for a packet matching the rule. """ ALLOW = 'allow' DENY = 'deny' @@ -47325,30 +48766,39 @@ class ActionEnum(str, Enum): class DirectionEnum(str, Enum): """ - Whether the traffic to be matched is `inbound` or `outbound`. + The direction of traffic to match. """ INBOUND = 'inbound' OUTBOUND = 'outbound' + class ProtocolEnum(str, Enum): + """ + The protocol to enforce. + """ + ALL = 'all' + ICMP = 'icmp' + TCP = 'tcp' + UDP = 'udp' + + class NetworkACLRulePrototype(): """ NetworkACLRulePrototype. - :attr str action: Whether to allow or deny matching traffic. + :attr str action: The action to perform for a packet matching the rule. :attr NetworkACLRuleBeforePrototype before: (optional) The rule to insert this - rule immediately before. If omitted, this rule will be - inserted after all existing rules. - :attr str destination: The destination IP address or CIDR block. The CIDR block - `0.0.0.0/0` applies to all addresses. - :attr str direction: Whether the traffic to be matched is `inbound` or - `outbound`. + rule immediately before. + If unspecified, this rule will be inserted after all existing rules. + :attr str destination: The destination IP address or CIDR block to match. The + CIDR block `0.0.0.0/0` matches all destination addresses. + :attr str direction: The direction of traffic to match. :attr str name: (optional) The user-defined name for this rule. Names must be unique within the network ACL the rule resides in. If unspecified, the name will be a hyphenated list of randomly-selected words. :attr str protocol: The protocol to enforce. - :attr str source: The source IP address or CIDR block. The CIDR block - `0.0.0.0/0` applies to all addresses. + :attr str source: The source IP address or CIDR block to match. The CIDR block + `0.0.0.0/0` matches all source addresses. """ def __init__(self, @@ -47363,23 +48813,22 @@ def __init__(self, """ Initialize a NetworkACLRulePrototype object. - :param str action: Whether to allow or deny matching traffic. - :param str destination: The destination IP address or CIDR block. The CIDR - block `0.0.0.0/0` applies to all addresses. - :param str direction: Whether the traffic to be matched is `inbound` or - `outbound`. + :param str action: The action to perform for a packet matching the rule. + :param str destination: The destination IP address or CIDR block to match. + The CIDR block `0.0.0.0/0` matches all destination addresses. + :param str direction: The direction of traffic to match. :param str protocol: The protocol to enforce. - :param str source: The source IP address or CIDR block. The CIDR block - `0.0.0.0/0` applies to all addresses. + :param str source: The source IP address or CIDR block to match. The CIDR + block `0.0.0.0/0` matches all source addresses. :param NetworkACLRuleBeforePrototype before: (optional) The rule to insert - this rule immediately before. If omitted, this rule will be - inserted after all existing rules. + this rule immediately before. + If unspecified, this rule will be inserted after all existing rules. :param str name: (optional) The user-defined name for this rule. Names must be unique within the network ACL the rule resides in. If unspecified, the name will be a hyphenated list of randomly-selected words. """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDP', 'NetworkACLRulePrototypeNetworkACLRuleProtocolICMP', 'NetworkACLRulePrototypeNetworkACLRuleProtocolAll'])) + ", ".join(['NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype', 'NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype', 'NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype'])) raise Exception(msg) @classmethod @@ -47390,7 +48839,7 @@ def from_dict(cls, _dict: Dict) -> 'NetworkACLRulePrototype': return disc_class.from_dict(_dict) msg = ("Cannot convert dictionary into an instance of base class 'NetworkACLRulePrototype'. " + "The discriminator value should map to a valid subclass: {1}").format( - ", ".join(['NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDP', 'NetworkACLRulePrototypeNetworkACLRuleProtocolICMP', 'NetworkACLRulePrototypeNetworkACLRuleProtocolAll'])) + ", ".join(['NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype', 'NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype', 'NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype'])) raise Exception(msg) @classmethod @@ -47401,10 +48850,10 @@ def _from_dict(cls, _dict: Dict): @classmethod def _get_class_by_discriminator(cls, _dict: Dict) -> object: mapping = {} - mapping['all'] = 'NetworkACLRulePrototypeNetworkACLRuleProtocolAll' - mapping['icmp'] = 'NetworkACLRulePrototypeNetworkACLRuleProtocolICMP' - mapping['tcp'] = 'NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDP' - mapping['udp'] = 'NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDP' + mapping['all'] = 'NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype' + mapping['icmp'] = 'NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype' + mapping['tcp'] = 'NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype' + mapping['udp'] = 'NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype' disc_value = _dict.get('protocol') if disc_value is None: raise ValueError('Discriminator property \'protocol\' not found in NetworkACLRulePrototype JSON') @@ -47419,7 +48868,7 @@ def _get_class_by_discriminator(cls, _dict: Dict) -> object: class ActionEnum(str, Enum): """ - Whether to allow or deny matching traffic. + The action to perform for a packet matching the rule. """ ALLOW = 'allow' DENY = 'deny' @@ -47427,27 +48876,36 @@ class ActionEnum(str, Enum): class DirectionEnum(str, Enum): """ - Whether the traffic to be matched is `inbound` or `outbound`. + The direction of traffic to match. """ INBOUND = 'inbound' OUTBOUND = 'outbound' + class ProtocolEnum(str, Enum): + """ + The protocol to enforce. + """ + ALL = 'all' + ICMP = 'icmp' + TCP = 'tcp' + UDP = 'udp' + + class NetworkACLRulePrototypeNetworkACLContext(): """ NetworkACLRulePrototypeNetworkACLContext. - :attr str action: Whether to allow or deny matching traffic. - :attr str destination: The destination IP address or CIDR block. The CIDR block - `0.0.0.0/0` applies to all addresses. - :attr str direction: Whether the traffic to be matched is `inbound` or - `outbound`. + :attr str action: The action to perform for a packet matching the rule. + :attr str destination: The destination IP address or CIDR block to match. The + CIDR block `0.0.0.0/0` matches all destination addresses. + :attr str direction: The direction of traffic to match. :attr str name: (optional) The user-defined name for this rule. Names must be unique within the network ACL the rule resides in. If unspecified, the name will be a hyphenated list of randomly-selected words. :attr str protocol: The protocol to enforce. - :attr str source: The source IP address or CIDR block. The CIDR block - `0.0.0.0/0` applies to all addresses. + :attr str source: The source IP address or CIDR block to match. The CIDR block + `0.0.0.0/0` matches all source addresses. """ def __init__(self, @@ -47461,20 +48919,19 @@ def __init__(self, """ Initialize a NetworkACLRulePrototypeNetworkACLContext object. - :param str action: Whether to allow or deny matching traffic. - :param str destination: The destination IP address or CIDR block. The CIDR - block `0.0.0.0/0` applies to all addresses. - :param str direction: Whether the traffic to be matched is `inbound` or - `outbound`. + :param str action: The action to perform for a packet matching the rule. + :param str destination: The destination IP address or CIDR block to match. + The CIDR block `0.0.0.0/0` matches all destination addresses. + :param str direction: The direction of traffic to match. :param str protocol: The protocol to enforce. - :param str source: The source IP address or CIDR block. The CIDR block - `0.0.0.0/0` applies to all addresses. + :param str source: The source IP address or CIDR block to match. The CIDR + block `0.0.0.0/0` matches all source addresses. :param str name: (optional) The user-defined name for this rule. Names must be unique within the network ACL the rule resides in. If unspecified, the name will be a hyphenated list of randomly-selected words. """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP', 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMP', 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAll'])) + ", ".join(['NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype', 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype', 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype'])) raise Exception(msg) @classmethod @@ -47485,7 +48942,7 @@ def from_dict(cls, _dict: Dict) -> 'NetworkACLRulePrototypeNetworkACLContext': return disc_class.from_dict(_dict) msg = ("Cannot convert dictionary into an instance of base class 'NetworkACLRulePrototypeNetworkACLContext'. " + "The discriminator value should map to a valid subclass: {1}").format( - ", ".join(['NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP', 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMP', 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAll'])) + ", ".join(['NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype', 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype', 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype'])) raise Exception(msg) @classmethod @@ -47496,10 +48953,10 @@ def _from_dict(cls, _dict: Dict): @classmethod def _get_class_by_discriminator(cls, _dict: Dict) -> object: mapping = {} - mapping['all'] = 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAll' - mapping['icmp'] = 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMP' - mapping['tcp'] = 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP' - mapping['udp'] = 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP' + mapping['all'] = 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype' + mapping['icmp'] = 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype' + mapping['tcp'] = 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype' + mapping['udp'] = 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype' disc_value = _dict.get('protocol') if disc_value is None: raise ValueError('Discriminator property \'protocol\' not found in NetworkACLRulePrototypeNetworkACLContext JSON') @@ -47514,7 +48971,7 @@ def _get_class_by_discriminator(cls, _dict: Dict) -> object: class ActionEnum(str, Enum): """ - Whether to allow or deny matching traffic. + The action to perform for a packet matching the rule. """ ALLOW = 'allow' DENY = 'deny' @@ -47522,18 +48979,28 @@ class ActionEnum(str, Enum): class DirectionEnum(str, Enum): """ - Whether the traffic to be matched is `inbound` or `outbound`. + The direction of traffic to match. """ INBOUND = 'inbound' OUTBOUND = 'outbound' + class ProtocolEnum(str, Enum): + """ + The protocol to enforce. + """ + ALL = 'all' + ICMP = 'icmp' + TCP = 'tcp' + UDP = 'udp' + + class NetworkACLRuleReference(): """ NetworkACLRuleReference. :attr NetworkACLRuleReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted and provides + property indicates the referenced resource has been deleted, and provides some supplementary information. :attr str href: The URL for this network ACL rule. :attr str id: The unique identifier for this network ACL rule. @@ -47553,7 +49020,7 @@ def __init__(self, :param str id: The unique identifier for this network ACL rule. :param str name: The user-defined name for this network ACL rule. :param NetworkACLRuleReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted and provides + property indicates the referenced resource has been deleted, and provides some supplementary information. """ self.deleted = deleted @@ -47619,7 +49086,7 @@ def __ne__(self, other: 'NetworkACLRuleReference') -> bool: class NetworkACLRuleReferenceDeleted(): """ - If present, this property indicates the referenced resource has been deleted and + 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. @@ -47890,8 +49357,8 @@ class NetworkInterfaceBareMetalServerContextReference(): NetworkInterfaceBareMetalServerContextReference. :attr NetworkInterfaceBareMetalServerContextReferenceDeleted deleted: (optional) - If present, this property indicates the referenced resource has been deleted and - provides + 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. @@ -47921,7 +49388,7 @@ def __init__(self, :param SubnetReference subnet: The associated subnet. :param NetworkInterfaceBareMetalServerContextReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has - been deleted and provides + been deleted, and provides some supplementary information. """ self.deleted = deleted @@ -48015,7 +49482,7 @@ class ResourceTypeEnum(str, Enum): class NetworkInterfaceBareMetalServerContextReferenceDeleted(): """ - If present, this property indicates the referenced resource has been deleted and + 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. @@ -48090,7 +49557,7 @@ class NetworkInterfaceInstanceContextReference(): NetworkInterfaceInstanceContextReference. :attr NetworkInterfaceInstanceContextReferenceDeleted deleted: (optional) If - present, this property indicates the referenced resource has been deleted and + present, this property indicates the referenced resource has been deleted, and provides some supplementary information. :attr str href: The URL for this network interface. @@ -48121,7 +49588,7 @@ def __init__(self, :param SubnetReference subnet: The associated subnet. :param NetworkInterfaceInstanceContextReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been - deleted and provides + deleted, and provides some supplementary information. """ self.deleted = deleted @@ -48215,7 +49682,7 @@ class ResourceTypeEnum(str, Enum): class NetworkInterfaceInstanceContextReferenceDeleted(): """ - If present, this property indicates the referenced resource has been deleted and + 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. @@ -48471,7 +49938,7 @@ def __ne__(self, other: 'NetworkInterfacePrototype') -> bool: class NetworkInterfaceReferenceDeleted(): """ - If present, this property indicates the referenced resource has been deleted and + 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. @@ -48528,7 +49995,7 @@ def __ne__(self, other: 'NetworkInterfaceReferenceDeleted') -> bool: class NetworkInterfaceReferenceTargetContextDeleted(): """ - If present, this property indicates the referenced resource has been deleted and + 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. @@ -49519,7 +50986,7 @@ def __ne__(self, other: 'PlacementGroupPatch') -> bool: class PlacementGroupReferenceDeleted(): """ - If present, this property indicates the referenced resource has been deleted and + 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. @@ -49589,8 +51056,8 @@ class PublicGateway(): :attr ResourceGroupReference resource_group: The resource group for this public gateway. :attr str resource_type: The resource type. - :attr str status: The status of the volume. - :attr VPCReference vpc: The VPC this public gateway serves. + :attr str status: The status of this public gateway. + :attr VPCReference vpc: The VPC this public gateway resides in. :attr ZoneReference zone: The zone this public gateway resides in. """ @@ -49620,8 +51087,8 @@ def __init__(self, :param ResourceGroupReference resource_group: The resource group for this public gateway. :param str resource_type: The resource type. - :param str status: The status of the volume. - :param VPCReference vpc: The VPC this public gateway serves. + :param str status: The status of this public gateway. + :param VPCReference vpc: The VPC this public gateway resides in. :param ZoneReference zone: The zone this public gateway resides in. """ self.created_at = created_at @@ -49745,7 +51212,7 @@ class ResourceTypeEnum(str, Enum): class StatusEnum(str, Enum): """ - The status of the volume. + The status of this public gateway. """ AVAILABLE = 'available' DELETING = 'deleting' @@ -49990,7 +51457,7 @@ class PublicGatewayFloatingIp(): :attr str address: The globally unique IP address. :attr str crn: The CRN for this floating IP. :attr FloatingIPReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted and provides + indicates the referenced resource has been deleted, and provides some supplementary information. :attr str href: The URL for this floating IP. :attr str id: The unique identifier for this floating IP. @@ -50014,7 +51481,7 @@ def __init__(self, :param str id: The unique identifier for this floating IP. :param str name: The unique user-defined name for this floating IP. :param FloatingIPReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted and provides + property indicates the referenced resource has been deleted, and provides some supplementary information. """ self.address = address @@ -50170,7 +51637,7 @@ class PublicGatewayReference(): :attr str crn: The CRN for this public gateway. :attr PublicGatewayReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted and provides + property indicates the referenced resource has been deleted, and provides some supplementary information. :attr str href: The URL for this public gateway. :attr str id: The unique identifier for this public gateway. @@ -50195,7 +51662,7 @@ def __init__(self, :param str name: The user-defined name for this public gateway. :param str resource_type: The resource type. :param PublicGatewayReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted and provides + property indicates the referenced resource has been deleted, and provides some supplementary information. """ self.crn = crn @@ -50282,7 +51749,7 @@ class ResourceTypeEnum(str, Enum): class PublicGatewayReferenceDeleted(): """ - If present, this property indicates the referenced resource has been deleted and + 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. @@ -50573,7 +52040,8 @@ class ReservedIP(): :attr str name: The user-defined or system-provided name for this reserved IP. :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. + :attr ReservedIPTarget target: (optional) The target this reserved IP is bound + to. If absent, this reserved IP is provider-owned or unbound. """ @@ -50611,7 +52079,8 @@ def __init__(self, IP. :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. + :param ReservedIPTarget target: (optional) The target this reserved IP is + bound to. If absent, this reserved IP is provider-owned or unbound. """ self.address = address @@ -51484,7 +52953,7 @@ class ReservedIPReference(): 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 + 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. @@ -51516,7 +52985,7 @@ def __init__(self, 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 + property indicates the referenced resource has been deleted, and provides some supplementary information. """ self.address = address @@ -51603,7 +53072,7 @@ class ResourceTypeEnum(str, Enum): class ReservedIPReferenceDeleted(): """ - If present, this property indicates the referenced resource has been deleted and + 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. @@ -51660,7 +53129,7 @@ def __ne__(self, other: 'ReservedIPReferenceDeleted') -> bool: class ReservedIPTarget(): """ - The target of this reserved IP. + The target this reserved IP is bound to. If absent, this reserved IP is provider-owned or unbound. """ @@ -51676,8 +53145,10 @@ def __init__(self) -> None: class ReservedIPTargetPrototype(): """ - The target this reserved IP is to be bound to. The target must be an endpoint gateway - not already bound to a reserved IP in the subnet's zone. + The target to bind this reserved IP to. The target must be in the same VPC. + At present, only endpoint gateway targets are supported. The endpoint gateway must + not be already bound to a reserved IP in the subnet's zone. + If unspecified, the reserved IP will be created unbound. """ @@ -51842,18 +53313,17 @@ class Route(): Route. :attr str action: The action to perform with a packet matching the route: - - `delegate`: delegate to the system's built-in routes - - `delegate_vpc`: delegate to the system's built-in routes, ignoring - Internet-bound - routes + - `delegate`: delegate to system-provided routes + - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound + routes - `deliver`: deliver the packet to the specified `next_hop` - `drop`: drop the packet. :attr datetime created_at: The date and time that the route was created. :attr RouteCreator creator: (optional) If present, the resource that created the - route. Routes with this property present cannot be - directly deleted. All routes with an `origin` of `learned` or `service` will - have this - property set, and future `origin` values may also have this property set. + route. Routes with this property present cannot + be directly deleted. All routes with an `origin` of `service` will have this + property set, + and future `origin` values may also have this property set. :attr str destination: The destination of the route. :attr str href: The URL for this route. :attr str id: The unique identifier for this route. @@ -51891,10 +53361,9 @@ def __init__(self, Initialize a Route object. :param str action: The action to perform with a packet matching the route: - - `delegate`: delegate to the system's built-in routes - - `delegate_vpc`: delegate to the system's built-in routes, ignoring - Internet-bound - routes + - `delegate`: delegate to system-provided routes + - `delegate_vpc`: delegate to system-provided routes, ignoring + Internet-bound routes - `deliver`: deliver the packet to the specified `next_hop` - `drop`: drop the packet. :param datetime created_at: The date and time that the route was created. @@ -51909,11 +53378,6 @@ def __init__(self, :param ZoneReference zone: The zone the route applies to. (Traffic from subnets in this zone will be subject to this route.). - :param RouteCreator creator: (optional) If present, the resource that - created the route. Routes with this property present cannot be - directly deleted. All routes with an `origin` of `learned` or `service` - will have this - property set, and future `origin` values may also have this property set. """ self.action = action self.created_at = created_at @@ -51985,11 +53449,11 @@ def to_dict(self) -> Dict: _dict['action'] = self.action if hasattr(self, 'created_at') and self.created_at is not None: _dict['created_at'] = datetime_to_string(self.created_at) - if hasattr(self, 'creator') and self.creator is not None: - if isinstance(self.creator, dict): - _dict['creator'] = self.creator + if hasattr(self, 'creator') and getattr(self, 'creator') is not None: + if isinstance(getattr(self, 'creator'), dict): + _dict['creator'] = getattr(self, 'creator') else: - _dict['creator'] = self.creator.to_dict() + _dict['creator'] = getattr(self, 'creator').to_dict() if hasattr(self, 'destination') and self.destination is not None: _dict['destination'] = self.destination if hasattr(self, 'href') and self.href is not None: @@ -52032,10 +53496,9 @@ def __ne__(self, other: 'Route') -> bool: class ActionEnum(str, Enum): """ The action to perform with a packet matching the route: - - `delegate`: delegate to the system's built-in routes - - `delegate_vpc`: delegate to the system's built-in routes, ignoring - Internet-bound - routes + - `delegate`: delegate to system-provided routes + - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound + routes - `deliver`: deliver the packet to the specified `next_hop` - `drop`: drop the packet. """ @@ -52289,8 +53752,8 @@ def __ne__(self, other: 'RouteCollectionNext') -> bool: class RouteCreator(): """ If present, the resource that created the route. Routes with this property present - cannot be directly deleted. All routes with an `origin` of `learned` or `service` will - have this property set, and future `origin` values may also have this property set. + cannot be directly deleted. All routes with an `origin` of `service` will have this + property set, and future `origin` values may also have this property set. """ @@ -52381,16 +53844,14 @@ class RoutePrototype(): :attr str action: (optional) The action to perform with a packet matching the route: - - `delegate`: delegate to the system's built-in routes - - `delegate_vpc`: delegate to the system's built-in routes, ignoring - Internet-bound - routes + - `delegate`: delegate to system-provided routes + - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound + routes - `deliver`: deliver the packet to the specified `next_hop` - `drop`: drop the packet. :attr str destination: The destination of the route. At most two routes per `zone` in a table can have the same destination, and only if both routes have an - `action` of `deliver` and the - `next_hop` is an IP address. + `action` of `deliver` and the `next_hop` is an IP address. :attr str name: (optional) The user-defined name for this route. If unspecified, the name will be a hyphenated list of randomly-selected words. Names must be unique within the VPC routing table the route resides in. @@ -52414,17 +53875,15 @@ def __init__(self, :param str destination: The destination of the route. At most two routes per `zone` in a table can have the same destination, and only if both - routes have an `action` of `deliver` and the - `next_hop` is an IP address. + routes have an `action` of `deliver` and the `next_hop` is an IP address. :param ZoneIdentity zone: The zone to apply the route to. (Traffic from subnets in this zone will be subject to this route.). :param str action: (optional) The action to perform with a packet matching the route: - - `delegate`: delegate to the system's built-in routes - - `delegate_vpc`: delegate to the system's built-in routes, ignoring - Internet-bound - routes + - `delegate`: delegate to system-provided routes + - `delegate_vpc`: delegate to system-provided routes, ignoring + Internet-bound routes - `deliver`: deliver the packet to the specified `next_hop` - `drop`: drop the packet. :param str name: (optional) The user-defined name for this route. If @@ -52507,10 +53966,9 @@ def __ne__(self, other: 'RoutePrototype') -> bool: class ActionEnum(str, Enum): """ The action to perform with a packet matching the route: - - `delegate`: delegate to the system's built-in routes - - `delegate_vpc`: delegate to the system's built-in routes, ignoring - Internet-bound - routes + - `delegate`: delegate to system-provided routes + - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound + routes - `deliver`: deliver the packet to the specified `next_hop` - `drop`: drop the packet. """ @@ -52541,7 +53999,7 @@ class RouteReference(): RouteReference. :attr RouteReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted and provides + indicates the referenced resource has been deleted, and provides some supplementary information. :attr str href: The URL for this route. :attr str id: The unique identifier for this route. @@ -52561,7 +54019,7 @@ def __init__(self, :param str id: The unique identifier for this route. :param str name: The user-defined name for this route. :param RouteReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted and provides + indicates the referenced resource has been deleted, and provides some supplementary information. """ self.deleted = deleted @@ -52627,7 +54085,7 @@ def __ne__(self, other: 'RouteReference') -> bool: class RouteReferenceDeleted(): """ - If present, this property indicates the referenced resource has been deleted and + 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. @@ -52702,16 +54160,28 @@ class RoutingTable(): :attr str resource_type: The resource type. :attr bool route_direct_link_ingress: Indicates whether this routing table is used to route traffic that originates from - [Direct Link](https://cloud.ibm.com/docs/dl/) to this VPC. + [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 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_internet_ingress: Indicates whether this routing table is used + to route traffic that originates from the internet. + Incoming traffic will be routed according to the routing table with two + exceptions: + - Traffic destined for IP addresses associated with public gateways will not be + subject to routes in this routing table. + - Routes with an action of deliver are treated as drop 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. :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. + Gateway](https://cloud.ibm.com/docs/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 bound to a network interface on a subnet in the @@ -52741,6 +54211,7 @@ def __init__(self, name: str, resource_type: str, route_direct_link_ingress: bool, + route_internet_ingress: bool, route_transit_gateway_ingress: bool, route_vpc_zone_ingress: bool, routes: List['RouteReference'], @@ -52764,16 +54235,30 @@ def __init__(self, :param str resource_type: The resource type. :param bool route_direct_link_ingress: Indicates whether this routing table is used to route traffic that originates from - [Direct Link](https://cloud.ibm.com/docs/dl/) to this VPC. + [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 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_internet_ingress: Indicates whether this routing table is + used to route traffic that originates from the internet. + Incoming traffic will be routed according to the routing table with two + exceptions: + - Traffic destined for IP addresses associated with public gateways will + not be + subject to routes in this routing table. + - Routes with an action of deliver are treated as drop 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. + Gateway](https://cloud.ibm.com/docs/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 bound to a network interface on a @@ -52802,6 +54287,7 @@ def __init__(self, self.name = name self.resource_type = resource_type self.route_direct_link_ingress = route_direct_link_ingress + self.route_internet_ingress = route_internet_ingress self.route_transit_gateway_ingress = route_transit_gateway_ingress self.route_vpc_zone_ingress = route_vpc_zone_ingress self.routes = routes @@ -52847,6 +54333,10 @@ def from_dict(cls, _dict: Dict) -> 'RoutingTable': args['route_direct_link_ingress'] = _dict.get('route_direct_link_ingress') else: raise ValueError('Required property \'route_direct_link_ingress\' not present in RoutingTable JSON') + if 'route_internet_ingress' in _dict: + args['route_internet_ingress'] = _dict.get('route_internet_ingress') + else: + raise ValueError('Required property \'route_internet_ingress\' not present in RoutingTable JSON') if 'route_transit_gateway_ingress' in _dict: args['route_transit_gateway_ingress'] = _dict.get('route_transit_gateway_ingress') else: @@ -52891,6 +54381,8 @@ def to_dict(self) -> Dict: _dict['resource_type'] = self.resource_type if hasattr(self, 'route_direct_link_ingress') and self.route_direct_link_ingress is not None: _dict['route_direct_link_ingress'] = self.route_direct_link_ingress + if hasattr(self, 'route_internet_ingress') and self.route_internet_ingress is not None: + _dict['route_internet_ingress'] = self.route_internet_ingress if hasattr(self, 'route_transit_gateway_ingress') and self.route_transit_gateway_ingress is not None: _dict['route_transit_gateway_ingress'] = self.route_transit_gateway_ingress if hasattr(self, 'route_vpc_zone_ingress') and self.route_vpc_zone_ingress is not None: @@ -53175,10 +54667,10 @@ class RoutingTablePatch(): :attr List[ResourceFilter] accept_routes_from: (optional) The filters specifying the resources that may create routes in this routing table - (replacing any existing filters). All routes learned from resources that match a + (replacing any existing filters). All routes created by resources that match a given filter will be removed when an existing filter is removed. Therefore, if an empty array is specified, all filters will be removed, resulting in all - learned routes being removed. + routes not directly created by the user being removed. At present, only the `resource_type` filter is permitted, and only the `vpn_server` value is supported, but filter support is expected to expand in the future. @@ -53196,9 +54688,26 @@ class RoutingTablePatch(): 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_internet_ingress: (optional) Indicates whether this routing + table is used to route traffic that originates from the internet. Updating to + `true` selects this routing table, provided no other routing table in the VPC + already has this property set to `true`. Updating to `false` deselects this + routing table. + Incoming traffic will be routed according to the routing table with two + exceptions: + - Traffic destined for IP addresses associated with public gateways will not be + subject + to routes in this routing table. + - Routes with an `action` of `deliver` are treated as `drop` 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. :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. + [Transit Gateway](https://cloud.ibm.com/docs/transit-gateway) to this VPC. Updating to `true` selects this routing table, provided no other routing table in the VPC already has this property set to `true`, and no subnets are attached to this @@ -53232,6 +54741,7 @@ def __init__(self, accept_routes_from: List['ResourceFilter'] = None, name: str = None, route_direct_link_ingress: bool = None, + route_internet_ingress: bool = None, route_transit_gateway_ingress: bool = None, route_vpc_zone_ingress: bool = None) -> None: """ @@ -53239,10 +54749,10 @@ def __init__(self, :param List[ResourceFilter] accept_routes_from: (optional) The filters specifying the resources that may create routes in this routing table - (replacing any existing filters). All routes learned from resources that + (replacing any existing filters). All routes created by resources that match a given filter will be removed when an existing filter is removed. Therefore, if an empty array is specified, all filters will be removed, - resulting in all learned routes being removed. + resulting in all routes not directly created by the user being removed. At present, only the `resource_type` filter is permitted, and only the `vpn_server` value is supported, but filter support is expected to expand in the future. @@ -53260,10 +54770,27 @@ def __init__(self, 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_internet_ingress: (optional) Indicates whether this + routing table is used to route traffic that originates from the internet. + Updating to `true` selects this routing table, provided no other routing + table in the VPC already has this property set to `true`. Updating to + `false` deselects this routing table. + Incoming traffic will be routed according to the routing table with two + exceptions: + - Traffic destined for IP addresses associated with public gateways will + not be subject + to routes in this routing table. + - Routes with an `action` of `deliver` are treated as `drop` 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 - VPC. Updating to + [Transit Gateway](https://cloud.ibm.com/docs/transit-gateway) to this VPC. + Updating to `true` selects this routing table, provided no other routing table in the VPC already has this property set to `true`, and no subnets are attached to this routing table. Updating to `false` deselects this routing table. @@ -53293,6 +54820,7 @@ def __init__(self, self.accept_routes_from = accept_routes_from self.name = name self.route_direct_link_ingress = route_direct_link_ingress + self.route_internet_ingress = route_internet_ingress self.route_transit_gateway_ingress = route_transit_gateway_ingress self.route_vpc_zone_ingress = route_vpc_zone_ingress @@ -53306,6 +54834,8 @@ def from_dict(cls, _dict: Dict) -> 'RoutingTablePatch': args['name'] = _dict.get('name') if 'route_direct_link_ingress' in _dict: args['route_direct_link_ingress'] = _dict.get('route_direct_link_ingress') + if 'route_internet_ingress' in _dict: + args['route_internet_ingress'] = _dict.get('route_internet_ingress') if 'route_transit_gateway_ingress' in _dict: args['route_transit_gateway_ingress'] = _dict.get('route_transit_gateway_ingress') if 'route_vpc_zone_ingress' in _dict: @@ -53326,6 +54856,8 @@ def to_dict(self) -> Dict: _dict['name'] = self.name if hasattr(self, 'route_direct_link_ingress') and self.route_direct_link_ingress is not None: _dict['route_direct_link_ingress'] = self.route_direct_link_ingress + if hasattr(self, 'route_internet_ingress') and self.route_internet_ingress is not None: + _dict['route_internet_ingress'] = self.route_internet_ingress if hasattr(self, 'route_transit_gateway_ingress') and self.route_transit_gateway_ingress is not None: _dict['route_transit_gateway_ingress'] = self.route_transit_gateway_ingress if hasattr(self, 'route_vpc_zone_ingress') and self.route_vpc_zone_ingress is not None: @@ -53355,7 +54887,7 @@ class RoutingTableReference(): RoutingTableReference. :attr RoutingTableReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted and provides + indicates the referenced resource has been deleted, and provides some supplementary information. :attr str href: The URL for this routing table. :attr str id: The unique identifier for this routing table. @@ -53378,7 +54910,7 @@ def __init__(self, :param str name: The user-defined name for this routing table. :param str resource_type: The resource type. :param RoutingTableReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted and provides + property indicates the referenced resource has been deleted, and provides some supplementary information. """ self.deleted = deleted @@ -53458,7 +54990,7 @@ class ResourceTypeEnum(str, Enum): class RoutingTableReferenceDeleted(): """ - If present, this property indicates the referenced resource has been deleted and + 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. @@ -53530,7 +55062,7 @@ class SecurityGroup(): rules exist, all traffic will be denied. :attr List[SecurityGroupTargetReference] targets: The targets for this security group. - :attr VPCReference vpc: The VPC this security group is a part of. + :attr VPCReference vpc: The VPC this security group resides in. """ def __init__(self, @@ -53559,7 +55091,7 @@ def __init__(self, no rules exist, all traffic will be denied. :param List[SecurityGroupTargetReference] targets: The targets for this security group. - :param VPCReference vpc: The VPC this security group is a part of. + :param VPCReference vpc: The VPC this security group resides in. """ self.created_at = created_at self.crn = crn @@ -53958,7 +55490,7 @@ class SecurityGroupReference(): :attr str crn: The security group's CRN. :attr SecurityGroupReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted and provides + property indicates the referenced resource has been deleted, and provides some supplementary information. :attr str href: The security group's canonical URL. :attr str id: The unique identifier for this security group. @@ -53982,7 +55514,7 @@ def __init__(self, :param str name: The user-defined name for this security group. Names must be unique within the VPC the security group resides in. :param SecurityGroupReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted and provides + property indicates the referenced resource has been deleted, and provides some supplementary information. """ self.crn = crn @@ -54055,7 +55587,7 @@ def __ne__(self, other: 'SecurityGroupReference') -> bool: class SecurityGroupReferenceDeleted(): """ - If present, this property indicates the referenced resource has been deleted and + 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. @@ -54114,8 +55646,7 @@ class SecurityGroupRule(): """ SecurityGroupRule. - :attr str direction: The direction of traffic to enforce, either `inbound` or - `outbound`. + :attr str direction: The direction of traffic to enforce. :attr str href: The URL for this security group rule. :attr str id: The unique identifier for this security group rule. :attr str ip_version: The IP version to enforce. The format of `remote.address` @@ -54125,12 +55656,12 @@ class SecurityGroupRule(): version. :attr str protocol: The protocol to enforce. :attr SecurityGroupRuleRemote remote: The IP addresses or security groups from - which this rule allows traffic (or to which, - for outbound rules). Can be specified as an IP address, a CIDR block, or a - security - group. A CIDR block of `0.0.0.0/0` allows traffic from any source (or to any - source, - for outbound rules). + which this rule allows traffic (or to which, for + outbound rules). Can be specified as an IP address, a CIDR block, or a security + group. A + CIDR block of `0.0.0.0/0` allows traffic from any source (or to any destination, + for + outbound rules). """ def __init__(self, @@ -54143,8 +55674,7 @@ def __init__(self, """ Initialize a SecurityGroupRule object. - :param str direction: The direction of traffic to enforce, either `inbound` - or `outbound`. + :param str direction: The direction of traffic to enforce. :param str href: The URL for this security group rule. :param str id: The unique identifier for this security group rule. :param str ip_version: The IP version to enforce. The format of @@ -54154,12 +55684,12 @@ def __init__(self, matching this IP version. :param str protocol: The protocol to enforce. :param SecurityGroupRuleRemote remote: The IP addresses or security groups - from which this rule allows traffic (or to which, - for outbound rules). Can be specified as an IP address, a CIDR block, or a - security - group. A CIDR block of `0.0.0.0/0` allows traffic from any source (or to - any source, - for outbound rules). + from which this rule allows traffic (or to which, for + outbound rules). Can be specified as an IP address, a CIDR block, or a + security group. A + CIDR block of `0.0.0.0/0` allows traffic from any source (or to any + destination, for + outbound rules). """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( ", ".join(['SecurityGroupRuleSecurityGroupRuleProtocolAll', 'SecurityGroupRuleSecurityGroupRuleProtocolICMP', 'SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP'])) @@ -54202,7 +55732,7 @@ def _get_class_by_discriminator(cls, _dict: Dict) -> object: class DirectionEnum(str, Enum): """ - The direction of traffic to enforce, either `inbound` or `outbound`. + The direction of traffic to enforce. """ INBOUND = 'inbound' OUTBOUND = 'outbound' @@ -54218,6 +55748,16 @@ class IpVersionEnum(str, Enum): IPV4 = 'ipv4' + class ProtocolEnum(str, Enum): + """ + The protocol to enforce. + """ + ALL = 'all' + ICMP = 'icmp' + TCP = 'tcp' + UDP = 'udp' + + class SecurityGroupRuleCollection(): """ Collection of rules in a security group. @@ -54278,30 +55818,30 @@ class SecurityGroupRulePatch(): """ SecurityGroupRulePatch. - :attr int code: (optional) The ICMP traffic code to allow. Specify `null` to - remove an existing ICMP traffic code value. - :attr str direction: (optional) The direction of traffic to enforce, either - `inbound` or `outbound`. + :attr int code: (optional) The ICMP traffic code to allow. If set, `type` must + also be set. + Specify `null` to remove an existing ICMP traffic code. + :attr str direction: (optional) The direction of traffic to enforce. :attr str ip_version: (optional) The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses (network interfaces) in that group matching this IP version. :attr int port_max: (optional) The inclusive upper bound of the protocol port - range. Specify `null` to clear an existing upper bound. If a lower bound has - been set, the upper bound must also be set, and must not be smaller. + range. If set, `port_min` must also be set, and must not be larger. + Specify `null` to remove an existing upper bound. :attr int port_min: (optional) The inclusive lower bound of the protocol port - range. Specify `null` to clear an existing lower bound. If an upper bound has - been set, the lower bound must also be set, and must not be larger. + range. If set, `port_max` must also be set, and must not be smaller. + Specify `null` to remove an existing lower bound. :attr SecurityGroupRuleRemotePatch remote: (optional) The IP addresses or security groups from which this rule will allow traffic (or to which, for outbound rules). Can be specified as an IP address, a CIDR block, or a security group. A CIDR block of `0.0.0.0/0` will allow traffic from any source (or to - any source, for outbound rules). - :attr int type: (optional) The ICMP traffic type to allow. Specify `null` to - remove an existing ICMP traffic type value. + any destination, for outbound rules). + :attr int type: (optional) The ICMP traffic type to allow. + Specify `null` to remove an existing ICMP traffic type value. """ def __init__(self, @@ -54316,32 +55856,30 @@ def __init__(self, """ Initialize a SecurityGroupRulePatch object. - :param int code: (optional) The ICMP traffic code to allow. Specify `null` - to remove an existing ICMP traffic code value. - :param str direction: (optional) The direction of traffic to enforce, - either `inbound` or `outbound`. + :param int code: (optional) The ICMP traffic code to allow. If set, `type` + must also be set. + Specify `null` to remove an existing ICMP traffic code. + :param str direction: (optional) The direction of traffic to enforce. :param str ip_version: (optional) The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses (network interfaces) in that group matching this IP version. :param int port_max: (optional) The inclusive upper bound of the protocol - port range. Specify `null` to clear an existing upper bound. If a lower - bound has been set, the upper bound must also be set, and must not be - smaller. + port range. If set, `port_min` must also be set, and must not be larger. + Specify `null` to remove an existing upper bound. :param int port_min: (optional) The inclusive lower bound of the protocol - port range. Specify `null` to clear an existing lower bound. If an upper - bound has been set, the lower bound must also be set, and must not be - larger. + port range. If set, `port_max` must also be set, and must not be smaller. + Specify `null` to remove an existing lower bound. :param SecurityGroupRuleRemotePatch remote: (optional) The IP addresses or security groups from which this rule will allow traffic (or to which, for outbound rules). Can be specified as an IP address, a CIDR block, or a security group. A CIDR block of `0.0.0.0/0` will allow traffic from any source (or to - any source, for outbound rules). - :param int type: (optional) The ICMP traffic type to allow. Specify `null` - to remove an existing ICMP traffic type value. + any destination, for outbound rules). + :param int type: (optional) The ICMP traffic type to allow. + Specify `null` to remove an existing ICMP traffic type value. """ self.code = code self.direction = direction @@ -54418,7 +55956,7 @@ def __ne__(self, other: 'SecurityGroupRulePatch') -> bool: class DirectionEnum(str, Enum): """ - The direction of traffic to enforce, either `inbound` or `outbound`. + The direction of traffic to enforce. """ INBOUND = 'inbound' OUTBOUND = 'outbound' @@ -54438,8 +55976,7 @@ class SecurityGroupRulePrototype(): """ SecurityGroupRulePrototype. - :attr str direction: The direction of traffic to enforce, either `inbound` or - `outbound`. + :attr str direction: The direction of traffic to enforce. :attr str ip_version: (optional) The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they are used. Alternatively, if `remote` references a security group, then this rule @@ -54447,12 +55984,13 @@ class SecurityGroupRulePrototype(): version. :attr str protocol: The protocol to enforce. :attr SecurityGroupRuleRemotePrototype remote: (optional) The IP addresses or - security groups from which this rule will allow traffic (or to - which, for outbound rules). Can be specified as an IP address, a CIDR block, or - a - security group. If omitted, a CIDR block of `0.0.0.0/0` will be used to allow - traffic - from any source (or to any source, for outbound rules). + security groups from which this rule will allow traffic (or to which, + for outbound rules). Can be specified as an IP address, a CIDR block, or a + security group + within the VPC. + If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic from + any source + (or to any destination, for outbound rules). """ def __init__(self, @@ -54464,8 +56002,7 @@ def __init__(self, """ Initialize a SecurityGroupRulePrototype object. - :param str direction: The direction of traffic to enforce, either `inbound` - or `outbound`. + :param str direction: The direction of traffic to enforce. :param str protocol: The protocol to enforce. :param str ip_version: (optional) The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they @@ -54473,12 +56010,13 @@ def __init__(self, rule only applies to IP addresses (network interfaces) in that group matching this IP version. :param SecurityGroupRuleRemotePrototype remote: (optional) The IP addresses - or security groups from which this rule will allow traffic (or to - which, for outbound rules). Can be specified as an IP address, a CIDR - block, or a - security group. If omitted, a CIDR block of `0.0.0.0/0` will be used to - allow traffic - from any source (or to any source, for outbound rules). + or security groups from which this rule will allow traffic (or to which, + for outbound rules). Can be specified as an IP address, a CIDR block, or a + security group + within the VPC. + If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic + from any source + (or to any destination, for outbound rules). """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( ", ".join(['SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll', 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP', 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP'])) @@ -54521,7 +56059,7 @@ def _get_class_by_discriminator(cls, _dict: Dict) -> object: class DirectionEnum(str, Enum): """ - The direction of traffic to enforce, either `inbound` or `outbound`. + The direction of traffic to enforce. """ INBOUND = 'inbound' OUTBOUND = 'outbound' @@ -54537,12 +56075,22 @@ class IpVersionEnum(str, Enum): IPV4 = 'ipv4' + class ProtocolEnum(str, Enum): + """ + The protocol to enforce. + """ + ALL = 'all' + ICMP = 'icmp' + TCP = 'tcp' + UDP = 'udp' + + class SecurityGroupRuleRemote(): """ The IP addresses or security groups from which this rule allows traffic (or to which, for outbound rules). Can be specified as an IP address, a CIDR block, or a security - group. A CIDR block of `0.0.0.0/0` allows traffic from any source (or to any source, - for outbound rules). + group. A CIDR block of `0.0.0.0/0` allows traffic from any source (or to any + destination, for outbound rules). """ @@ -54560,7 +56108,7 @@ class SecurityGroupRuleRemotePatch(): The IP addresses or security groups from which this rule will allow traffic (or to which, for outbound rules). Can be specified as an IP address, a CIDR block, or a security group. A CIDR block of `0.0.0.0/0` will allow traffic from any source (or to - any source, for outbound rules). + any destination, for outbound rules). """ @@ -54577,8 +56125,10 @@ class SecurityGroupRuleRemotePrototype(): """ The IP addresses or security groups from which this rule will allow traffic (or to which, for outbound rules). Can be specified as an IP address, a CIDR block, or a - security group. If omitted, a CIDR block of `0.0.0.0/0` will be used to allow traffic - from any source (or to any source, for outbound rules). + security group within the VPC. + If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic from any + source + (or to any destination, for outbound rules). """ @@ -55491,7 +57041,7 @@ class SnapshotReference(): :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 + indicates the referenced resource has been deleted, and provides some supplementary information. :attr str href: The URL for this snapshot. :attr str id: The unique identifier for this snapshot. @@ -55516,7 +57066,7 @@ def __init__(self, :param str name: The user-defined name for this snapshot. :param str resource_type: The resource type. :param SnapshotReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted and provides + property indicates the referenced resource has been deleted, and provides some supplementary information. """ self.crn = crn @@ -55603,7 +57153,7 @@ class ResourceTypeEnum(str, Enum): class SnapshotReferenceDeleted(): """ - If present, this property indicates the referenced resource has been deleted and + 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. @@ -55685,7 +57235,7 @@ class Subnet(): 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 VPCReference vpc: The VPC this subnet resides in. :attr ZoneReference zone: The zone this subnet resides in. """ @@ -55734,7 +57284,7 @@ def __init__(self, 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 VPCReference vpc: The VPC this subnet resides in. :param ZoneReference zone: The zone this subnet resides in. :param PublicGatewayReference public_gateway: (optional) The public gateway to use for internet-bound traffic for this subnet. @@ -56156,8 +57706,8 @@ class SubnetPatch(): use for internet-bound traffic for this subnet. :attr RoutingTableIdentity routing_table: (optional) The routing table to use for this subnet. The routing table properties - `route_direct_link_ingress`, `route_transit_gateway_ingress`, and - `route_vpc_zone_ingress` must be `false`. + `route_direct_link_ingress`, `route_internet_ingress`, + `route_transit_gateway_ingress`, and `route_vpc_zone_ingress` must be `false`. """ def __init__(self, @@ -56177,8 +57727,9 @@ def __init__(self, gateway to use for internet-bound traffic for this subnet. :param RoutingTableIdentity routing_table: (optional) The routing table to use for this subnet. The routing table properties - `route_direct_link_ingress`, `route_transit_gateway_ingress`, and - `route_vpc_zone_ingress` must be `false`. + `route_direct_link_ingress`, `route_internet_ingress`, + `route_transit_gateway_ingress`, and `route_vpc_zone_ingress` must be + `false`. """ self.name = name self.network_acl = network_acl @@ -56263,8 +57814,9 @@ class SubnetPrototype(): :attr RoutingTableIdentity routing_table: (optional) The routing table to use for this subnet. If unspecified, the default routing table for the VPC is used. The routing table properties `route_direct_link_ingress`, - `route_transit_gateway_ingress`, and `route_vpc_zone_ingress` must be `false`. - :attr VPCIdentity vpc: The VPC the subnet is to be a part of. + `route_internet_ingress`, `route_transit_gateway_ingress`, and + `route_vpc_zone_ingress` must be `false`. + :attr VPCIdentity vpc: The VPC the subnet will reside in. """ def __init__(self, @@ -56279,7 +57831,7 @@ def __init__(self, """ Initialize a SubnetPrototype object. - :param VPCIdentity vpc: The VPC the subnet is to be a part of. + :param VPCIdentity vpc: The VPC the subnet will reside in. :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 @@ -56298,8 +57850,8 @@ def __init__(self, use for this subnet. If unspecified, the default routing table for the VPC is used. The routing table properties `route_direct_link_ingress`, - `route_transit_gateway_ingress`, and `route_vpc_zone_ingress` must be - `false`. + `route_internet_ingress`, `route_transit_gateway_ingress`, and + `route_vpc_zone_ingress` must be `false`. """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( ", ".join(['SubnetPrototypeSubnetByTotalCount', 'SubnetPrototypeSubnetByCIDR'])) @@ -56333,7 +57885,7 @@ class SubnetReference(): :attr str crn: The CRN for this subnet. :attr SubnetReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted and provides + indicates the referenced resource has been deleted, and provides some supplementary information. :attr str href: The URL for this subnet. :attr str id: The unique identifier for this subnet. @@ -56358,7 +57910,7 @@ def __init__(self, :param str name: The user-defined name for this subnet. :param str resource_type: The resource type. :param SubnetReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted and provides + indicates the referenced resource has been deleted, and provides some supplementary information. """ self.crn = crn @@ -56445,7 +57997,7 @@ class ResourceTypeEnum(str, Enum): class SubnetReferenceDeleted(): """ - If present, this property indicates the referenced resource has been deleted and + 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. @@ -57236,7 +58788,7 @@ class VPCReference(): :attr str crn: The CRN for this VPC. :attr VPCReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted and provides + indicates the referenced resource has been deleted, and provides some supplementary information. :attr str href: The URL for this VPC. :attr str id: The unique identifier for this VPC. @@ -57261,7 +58813,7 @@ def __init__(self, :param str name: The unique user-defined name for this VPC. :param str resource_type: The resource type. :param VPCReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted and provides + indicates the referenced resource has been deleted, and provides some supplementary information. """ self.crn = crn @@ -57348,7 +58900,7 @@ class ResourceTypeEnum(str, Enum): class VPCReferenceDeleted(): """ - If present, this property indicates the referenced resource has been deleted and + 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. @@ -57420,6 +58972,7 @@ class VPNGateway(): :attr str resource_type: The resource type. :attr str status: The status of the VPN gateway. :attr SubnetReference subnet: + :attr VPCReference vpc: The VPC this VPN gateway resides in. """ def __init__(self, @@ -57433,7 +58986,8 @@ def __init__(self, resource_group: 'ResourceGroupReference', resource_type: str, status: str, - subnet: 'SubnetReference') -> None: + subnet: 'SubnetReference', + vpc: 'VPCReference') -> None: """ Initialize a VPNGateway object. @@ -57451,6 +59005,7 @@ def __init__(self, :param str resource_type: The resource type. :param str status: The status of the VPN gateway. :param SubnetReference subnet: + :param VPCReference vpc: The VPC this VPN gateway resides in. """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( ", ".join(['VPNGatewayRouteMode', 'VPNGatewayPolicyMode'])) @@ -58397,7 +59952,7 @@ class VPNGatewayConnectionReference(): VPNGatewayConnectionReference. :attr VPNGatewayConnectionReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted and provides + property indicates the referenced resource has been deleted, and provides some supplementary information. :attr str href: The VPN connection's canonical URL. :attr str id: The unique identifier for this VPN gateway connection. @@ -58420,7 +59975,7 @@ def __init__(self, :param str name: The user-defined name for this VPN connection. :param str resource_type: The resource type. :param VPNGatewayConnectionReferenceDeleted deleted: (optional) If present, - this property indicates the referenced resource has been deleted and + this property indicates the referenced resource has been deleted, and provides some supplementary information. """ @@ -58501,7 +60056,7 @@ class ResourceTypeEnum(str, Enum): class VPNGatewayConnectionReferenceDeleted(): """ - If present, this property indicates the referenced resource has been deleted and + 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. @@ -58829,7 +60384,7 @@ def __init__(self, class VPNGatewayReferenceDeleted(): """ - If present, this property indicates the referenced resource has been deleted and + 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. @@ -60202,7 +61757,7 @@ class ProtocolEnum(str, Enum): class VPNServerReferenceDeleted(): """ - If present, this property indicates the referenced resource has been deleted and + 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. @@ -60743,7 +62298,9 @@ class Volume(): :attr OperatingSystemReference operating_system: (optional) The operating system associated with this volume. If absent, this volume was not created from an image, or the image did not include an operating system. - :attr VolumeProfileReference profile: The profile this volume uses. + :attr VolumeProfileReference profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) for + this volume. :attr ResourceGroupReference resource_group: The resource group for this volume. :attr ImageReference source_image: (optional) The image from which this volume was created (this may be @@ -60816,7 +62373,10 @@ def __init__(self, the volume. Applicable only to volumes using a profile `family` of `custom`. :param str name: The unique user-defined name for this volume. - :param VolumeProfileReference profile: The profile this volume uses. + :param VolumeProfileReference profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) + for + this volume. :param ResourceGroupReference resource_group: The resource group for this volume. :param str status: The status of the volume. @@ -61074,7 +62634,8 @@ class VolumeAttachment(): :attr str name: The user-defined name for this volume attachment. :attr str status: The status of this volume attachment. :attr str type: The type of volume attachment. - :attr VolumeReference volume: The attached volume. + :attr VolumeReference volume: (optional) The attached volume. + This property will be absent if the volume has not yet been provisioned. """ def __init__(self, @@ -61086,9 +62647,9 @@ def __init__(self, name: str, status: str, type: str, - volume: 'VolumeReference', *, - device: 'VolumeAttachmentDevice' = None) -> None: + device: 'VolumeAttachmentDevice' = None, + volume: 'VolumeReference' = None) -> None: """ Initialize a VolumeAttachment object. @@ -61103,11 +62664,12 @@ def __init__(self, :param str name: The user-defined name for this volume attachment. :param str status: The status of this volume attachment. :param str type: The type of volume attachment. - :param VolumeReference volume: The attached volume. :param VolumeAttachmentDevice device: (optional) Information about how the volume is exposed to the instance operating system. This property may be absent if the volume attachment's `status` is not `attached`. + :param VolumeReference volume: (optional) The attached volume. + This property will be absent if the volume has not yet been provisioned. """ self.bandwidth = bandwidth self.created_at = created_at @@ -61160,8 +62722,6 @@ def from_dict(cls, _dict: Dict) -> 'VolumeAttachment': raise ValueError('Required property \'type\' not present in VolumeAttachment JSON') if 'volume' in _dict: args['volume'] = VolumeReference.from_dict(_dict.get('volume')) - else: - raise ValueError('Required property \'volume\' not present in VolumeAttachment JSON') return cls(**args) @classmethod @@ -61676,7 +63236,7 @@ class VolumeAttachmentReferenceInstanceContext(): VolumeAttachmentReferenceInstanceContext. :attr VolumeAttachmentReferenceInstanceContextDeleted deleted: (optional) If - present, this property indicates the referenced resource has been deleted and + present, this property indicates the referenced resource has been deleted, and provides some supplementary information. :attr VolumeAttachmentDevice device: (optional) Information about how the volume @@ -61686,32 +63246,34 @@ class VolumeAttachmentReferenceInstanceContext(): :attr str href: The URL for this volume attachment. :attr str id: The unique identifier for this volume attachment. :attr str name: The user-defined name for this volume attachment. - :attr VolumeReference volume: The attached volume. + :attr VolumeReference volume: (optional) The attached volume. + This property will be absent if the volume has not yet been provisioned. """ def __init__(self, href: str, id: str, name: str, - volume: 'VolumeReference', *, deleted: 'VolumeAttachmentReferenceInstanceContextDeleted' = None, - device: 'VolumeAttachmentDevice' = None) -> None: + device: 'VolumeAttachmentDevice' = None, + volume: 'VolumeReference' = None) -> None: """ Initialize a VolumeAttachmentReferenceInstanceContext object. :param str href: The URL for this volume attachment. :param str id: The unique identifier for this volume attachment. :param str name: The user-defined name for this volume attachment. - :param VolumeReference volume: The attached volume. :param VolumeAttachmentReferenceInstanceContextDeleted deleted: (optional) If present, this property indicates the referenced resource has been - deleted and provides + deleted, and provides some supplementary information. :param VolumeAttachmentDevice device: (optional) Information about how the volume is exposed to the instance operating system. This property may be absent if the volume attachment's `status` is not `attached`. + :param VolumeReference volume: (optional) The attached volume. + This property will be absent if the volume has not yet been provisioned. """ self.deleted = deleted self.device = device @@ -61742,8 +63304,6 @@ def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentReferenceInstanceContext': raise ValueError('Required property \'name\' not present in VolumeAttachmentReferenceInstanceContext JSON') if 'volume' in _dict: args['volume'] = VolumeReference.from_dict(_dict.get('volume')) - else: - raise ValueError('Required property \'volume\' not present in VolumeAttachmentReferenceInstanceContext JSON') return cls(**args) @classmethod @@ -61788,7 +63348,7 @@ def __ne__(self, other: 'VolumeAttachmentReferenceInstanceContext') -> bool: class VolumeAttachmentReferenceInstanceContextDeleted(): """ - If present, this property indicates the referenced resource has been deleted and + 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. @@ -61850,7 +63410,7 @@ class VolumeAttachmentReferenceVolumeContext(): :attr bool delete_volume_on_instance_delete: If set to true, when deleting the instance the volume will also be deleted. :attr VolumeAttachmentReferenceVolumeContextDeleted deleted: (optional) If - present, this property indicates the referenced resource has been deleted and + present, this property indicates the referenced resource has been deleted, and provides some supplementary information. :attr VolumeAttachmentDevice device: (optional) Information about how the volume @@ -61885,7 +63445,7 @@ def __init__(self, :param str name: The user-defined name for this volume attachment. :param str type: The type of volume attachment. :param VolumeAttachmentReferenceVolumeContextDeleted deleted: (optional) If - present, this property indicates the referenced resource has been deleted + present, this property indicates the referenced resource has been deleted, and provides some supplementary information. :param VolumeAttachmentDevice device: (optional) Information about how the @@ -61990,7 +63550,7 @@ class TypeEnum(str, Enum): class VolumeAttachmentReferenceVolumeContextDeleted(): """ - If present, this property indicates the referenced resource has been deleted and + 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. @@ -62801,7 +64361,9 @@ class VolumePrototype(): :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 VolumeProfileIdentity profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to + use for this volume. :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. @@ -62822,7 +64384,10 @@ def __init__(self, """ Initialize a VolumePrototype object. - :param VolumeProfileIdentity profile: The profile to use for this volume. + :param VolumeProfileIdentity profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) + to + use for this volume. :param ZoneIdentity zone: The zone this volume will reside in. :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 @@ -62850,13 +64415,16 @@ class VolumePrototypeInstanceByImageContext(): 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. - If unspecified, and the image is encrypted, the image's `encryption_key` will be - used. Otherwise, the `encryption` type for the volume will be - `provider_managed`. + If unspecified, the `encryption` type for the volume will be `provider_managed`. :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 VolumeProfileIdentity profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to + use for this volume. + :attr List[str] user_tags: (optional) The [user + tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this + volume. """ def __init__(self, @@ -62865,11 +64433,15 @@ def __init__(self, capacity: int = None, encryption_key: 'EncryptionKeyIdentity' = None, iops: int = None, - name: str = None) -> None: + name: str = None, + user_tags: List[str] = None) -> None: """ Initialize a VolumePrototypeInstanceByImageContext object. - :param VolumeProfileIdentity profile: The profile to use for this volume. + :param VolumeProfileIdentity profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) + to + use for this volume. :param int capacity: (optional) The capacity to use for the volume (in gigabytes). Must be at least the image's `minimum_provisioned_size`. The maximum value may increase in the future. @@ -62877,20 +64449,22 @@ def __init__(self, `minimum_provisioned_size`. :param EncryptionKeyIdentity encryption_key: (optional) The root key to use to wrap the data encryption key for the volume. - If unspecified, and the image is encrypted, the image's `encryption_key` - will be - used. Otherwise, the `encryption` type for the volume will be + If unspecified, the `encryption` type for the volume will be `provider_managed`. :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. + :param List[str] user_tags: (optional) The [user + tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with + this volume. """ self.capacity = capacity self.encryption_key = encryption_key self.iops = iops self.name = name self.profile = profile + self.user_tags = user_tags @classmethod def from_dict(cls, _dict: Dict) -> 'VolumePrototypeInstanceByImageContext': @@ -62908,6 +64482,8 @@ def from_dict(cls, _dict: Dict) -> 'VolumePrototypeInstanceByImageContext': args['profile'] = _dict.get('profile') else: raise ValueError('Required property \'profile\' not present in VolumePrototypeInstanceByImageContext JSON') + if 'user_tags' in _dict: + args['user_tags'] = _dict.get('user_tags') return cls(**args) @classmethod @@ -62934,6 +64510,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): @@ -62964,13 +64542,18 @@ class VolumePrototypeInstanceBySourceSnapshotContext(): 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. + If unspecified, the `encryption` type for the volume will be `provider_managed`. :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 VolumeProfileIdentity profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to + use for this volume. :attr SnapshotIdentity source_snapshot: The snapshot from which to clone the volume. + :attr List[str] user_tags: (optional) The [user + tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this + volume. """ def __init__(self, @@ -62980,11 +64563,15 @@ def __init__(self, capacity: int = None, encryption_key: 'EncryptionKeyIdentity' = None, iops: int = None, - name: str = None) -> None: + name: str = None, + user_tags: List[str] = None) -> None: """ Initialize a VolumePrototypeInstanceBySourceSnapshotContext object. - :param VolumeProfileIdentity profile: The profile to use for this volume. + :param VolumeProfileIdentity profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) + 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 @@ -62994,11 +64581,15 @@ def __init__(self, `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. + If unspecified, the `encryption` type for the volume will be + `provider_managed`. :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. + :param List[str] user_tags: (optional) The [user + tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with + this volume. """ self.capacity = capacity self.encryption_key = encryption_key @@ -63006,6 +64597,7 @@ def __init__(self, self.name = name self.profile = profile self.source_snapshot = source_snapshot + self.user_tags = user_tags @classmethod def from_dict(cls, _dict: Dict) -> 'VolumePrototypeInstanceBySourceSnapshotContext': @@ -63027,6 +64619,8 @@ def from_dict(cls, _dict: Dict) -> 'VolumePrototypeInstanceBySourceSnapshotConte args['source_snapshot'] = _dict.get('source_snapshot') else: raise ValueError('Required property \'source_snapshot\' not present in VolumePrototypeInstanceBySourceSnapshotContext JSON') + if 'user_tags' in _dict: + args['user_tags'] = _dict.get('user_tags') return cls(**args) @classmethod @@ -63058,6 +64652,8 @@ def to_dict(self) -> Dict: _dict['source_snapshot'] = self.source_snapshot else: _dict['source_snapshot'] = self.source_snapshot.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): @@ -63084,7 +64680,7 @@ class VolumeReference(): :attr str crn: The CRN for this volume. :attr VolumeReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted and provides + indicates the referenced resource has been deleted, and provides some supplementary information. :attr str href: The URL for this volume. :attr str id: The unique identifier for this volume. @@ -63106,7 +64702,7 @@ def __init__(self, :param str id: The unique identifier for this volume. :param str name: The unique user-defined name for this volume. :param VolumeReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted and provides + indicates the referenced resource has been deleted, and provides some supplementary information. """ self.crn = crn @@ -63179,7 +64775,7 @@ def __ne__(self, other: 'VolumeReference') -> bool: class VolumeReferenceDeleted(): """ - If present, this property indicates the referenced resource has been deleted and + 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. @@ -63555,7 +65151,7 @@ class BareMetalServerBootTargetBareMetalServerDiskReference(BareMetalServerBootT BareMetalServerBootTargetBareMetalServerDiskReference. :attr BareMetalServerDiskReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted and provides + property indicates the referenced resource has been deleted, and provides some supplementary information. :attr str href: The URL for this bare metal server disk. :attr str id: The unique identifier for this bare metal server disk. @@ -63578,7 +65174,7 @@ def __init__(self, :param str name: The user-defined name for this disk. :param str resource_type: The resource type. :param BareMetalServerDiskReferenceDeleted deleted: (optional) If present, - this property indicates the referenced resource has been deleted and + this property indicates the referenced resource has been deleted, and provides some supplementary information. """ @@ -63757,6 +65353,278 @@ class ResourceTypeEnum(str, Enum): HOST_USER_ACCOUNT = 'host_user_account' +class BareMetalServerNetworkInterfaceByHiperSocket(BareMetalServerNetworkInterface): + """ + BareMetalServerNetworkInterfaceByHiperSocket. + + :attr bool allow_ip_spoofing: Indicates whether source IP spoofing is allowed on + this interface. If false, source IP spoofing is prevented on this interface. If + true, source IP spoofing is allowed on this interface. + :attr datetime created_at: The date and time that the network interface was + created. + :attr bool enable_infrastructure_nat: If `true`: + - The VPC infrastructure performs any needed NAT operations. + - A single floating IP can be assigned to the network interface. + If `false`: + - Packets are passed unchanged to/from the network interface, + allowing the workload to perform any needed NAT operations. + - Multiple floating IPs can be assigned to the network interface. + - `allow_ip_spoofing` must be set to `false`. + This must be `true` when `interface_type` is `hipersocket`. + :attr List[FloatingIPReference] floating_ips: (optional) The floating IPs + associated with this network interface. + :attr str href: The URL for this network interface. + :attr str id: The unique identifier for this network interface. + :attr str mac_address: The MAC address of the interface. If absent, the value + 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 ReservedIPReference primary_ip: + :attr str resource_type: The resource type. + :attr List[SecurityGroupReference] security_groups: The security groups + targeting this network interface. + :attr str status: The status of the network interface. + :attr SubnetReference subnet: The associated subnet. + :attr str type: The type of this bare metal server network interface. + :attr str interface_type: - `hipersocket`: a virtual network device that + provides high-speed TCP/IP connectivity + within a `s390x` based system. + """ + + def __init__(self, + allow_ip_spoofing: bool, + created_at: datetime, + enable_infrastructure_nat: bool, + href: str, + id: str, + mac_address: str, + name: str, + port_speed: int, + primary_ip: 'ReservedIPReference', + resource_type: str, + security_groups: List['SecurityGroupReference'], + status: str, + subnet: 'SubnetReference', + type: str, + interface_type: str, + *, + floating_ips: List['FloatingIPReference'] = None) -> None: + """ + Initialize a BareMetalServerNetworkInterfaceByHiperSocket object. + + :param bool allow_ip_spoofing: Indicates whether source IP spoofing is + allowed on this interface. If false, source IP spoofing is prevented on + this interface. If true, source IP spoofing is allowed on this interface. + :param datetime created_at: The date and time that the network interface + was created. + :param bool enable_infrastructure_nat: If `true`: + - The VPC infrastructure performs any needed NAT operations. + - A single floating IP can be assigned to the network interface. + If `false`: + - Packets are passed unchanged to/from the network interface, + allowing the workload to perform any needed NAT operations. + - Multiple floating IPs can be assigned to the network interface. + - `allow_ip_spoofing` must be set to `false`. + This must be `true` when `interface_type` is `hipersocket`. + :param str href: The URL for this network interface. + :param str id: The unique identifier for this network interface. + :param str mac_address: The MAC address of the interface. If absent, the + 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 ReservedIPReference primary_ip: + :param str resource_type: The resource type. + :param List[SecurityGroupReference] security_groups: The security groups + targeting this network interface. + :param str status: The status of the network interface. + :param SubnetReference subnet: The associated subnet. + :param str type: The type of this bare metal server network interface. + :param str interface_type: - `hipersocket`: a virtual network device that + provides high-speed TCP/IP connectivity + within a `s390x` based system. + :param List[FloatingIPReference] floating_ips: (optional) The floating IPs + associated with this network interface. + """ + # pylint: disable=super-init-not-called + self.allow_ip_spoofing = allow_ip_spoofing + self.created_at = created_at + self.enable_infrastructure_nat = enable_infrastructure_nat + self.floating_ips = floating_ips + self.href = href + self.id = id + self.mac_address = mac_address + self.name = name + self.port_speed = port_speed + self.primary_ip = primary_ip + self.resource_type = resource_type + self.security_groups = security_groups + self.status = status + self.subnet = subnet + self.type = type + self.interface_type = interface_type + + @classmethod + def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfaceByHiperSocket': + """Initialize a BareMetalServerNetworkInterfaceByHiperSocket object from a json dictionary.""" + args = {} + if 'allow_ip_spoofing' in _dict: + args['allow_ip_spoofing'] = _dict.get('allow_ip_spoofing') + else: + raise ValueError('Required property \'allow_ip_spoofing\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON') + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) + else: + raise ValueError('Required property \'created_at\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON') + if 'enable_infrastructure_nat' in _dict: + args['enable_infrastructure_nat'] = _dict.get('enable_infrastructure_nat') + else: + raise ValueError('Required property \'enable_infrastructure_nat\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON') + if 'floating_ips' in _dict: + args['floating_ips'] = [FloatingIPReference.from_dict(x) for x in _dict.get('floating_ips')] + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON') + if 'mac_address' in _dict: + args['mac_address'] = _dict.get('mac_address') + else: + raise ValueError('Required property \'mac_address\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON') + if 'port_speed' in _dict: + args['port_speed'] = _dict.get('port_speed') + else: + raise ValueError('Required property \'port_speed\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON') + if 'primary_ip' in _dict: + args['primary_ip'] = ReservedIPReference.from_dict(_dict.get('primary_ip')) + else: + raise ValueError('Required property \'primary_ip\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON') + if 'security_groups' in _dict: + args['security_groups'] = [SecurityGroupReference.from_dict(x) for x in _dict.get('security_groups')] + else: + raise ValueError('Required property \'security_groups\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON') + if 'status' in _dict: + args['status'] = _dict.get('status') + else: + raise ValueError('Required property \'status\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON') + if 'subnet' in _dict: + args['subnet'] = SubnetReference.from_dict(_dict.get('subnet')) + else: + raise ValueError('Required property \'subnet\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON') + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError('Required property \'type\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON') + if 'interface_type' in _dict: + args['interface_type'] = _dict.get('interface_type') + else: + raise ValueError('Required property \'interface_type\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a BareMetalServerNetworkInterfaceByHiperSocket object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'allow_ip_spoofing') and self.allow_ip_spoofing is not None: + _dict['allow_ip_spoofing'] = self.allow_ip_spoofing + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) + if hasattr(self, 'enable_infrastructure_nat') and self.enable_infrastructure_nat is not None: + _dict['enable_infrastructure_nat'] = self.enable_infrastructure_nat + if hasattr(self, 'floating_ips') and self.floating_ips is not None: + _dict['floating_ips'] = [x.to_dict() for x in self.floating_ips] + 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, 'mac_address') and self.mac_address is not None: + _dict['mac_address'] = self.mac_address + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'port_speed') and self.port_speed is not None: + _dict['port_speed'] = self.port_speed + 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: + _dict['security_groups'] = [x.to_dict() for x in self.security_groups] + if hasattr(self, 'status') and self.status is not None: + _dict['status'] = self.status + if hasattr(self, 'subnet') and self.subnet is not None: + _dict['subnet'] = self.subnet.to_dict() + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'interface_type') and self.interface_type is not None: + _dict['interface_type'] = self.interface_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 BareMetalServerNetworkInterfaceByHiperSocket object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'BareMetalServerNetworkInterfaceByHiperSocket') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'BareMetalServerNetworkInterfaceByHiperSocket') -> 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 StatusEnum(str, Enum): + """ + The status of the network interface. + """ + AVAILABLE = 'available' + DELETING = 'deleting' + FAILED = 'failed' + PENDING = 'pending' + + + class TypeEnum(str, Enum): + """ + The type of this bare metal server network interface. + """ + PRIMARY = 'primary' + SECONDARY = 'secondary' + + + class InterfaceTypeEnum(str, Enum): + """ + - `hipersocket`: a virtual network device that provides high-speed TCP/IP + connectivity + within a `s390x` based system. + """ + HIPERSOCKET = 'hipersocket' + + class BareMetalServerNetworkInterfaceByPCI(BareMetalServerNetworkInterface): """ BareMetalServerNetworkInterfaceByPCI. @@ -63770,10 +65638,11 @@ class BareMetalServerNetworkInterfaceByPCI(BareMetalServerNetworkInterface): - The VPC infrastructure performs any needed NAT operations. - A single floating IP can be assigned to the network interface. If `false`: - - Packets are passed unmodified to/from the network interface, + - Packets are passed unchanged to/from the network interface, allowing the workload to perform any needed NAT operations. - Multiple floating IPs can be assigned to the network interface. - `allow_ip_spoofing` must be set to `false`. + This must be `true` when `interface_type` is `hipersocket`. :attr List[FloatingIPReference] floating_ips: (optional) The floating IPs associated with this network interface. :attr str href: The URL for this network interface. @@ -63790,8 +65659,7 @@ class BareMetalServerNetworkInterfaceByPCI(BareMetalServerNetworkInterface): :attr SubnetReference subnet: The associated subnet. :attr str type: The type of this bare metal server network interface. :attr List[int] allowed_vlans: Indicates what VLAN IDs (for VLAN type only) can - use this physical (PCI type) interface. A given VLAN can only be in the - `allowed_vlans` array for one PCI type adapter per bare metal server. + use this physical (PCI type) interface. :attr str interface_type: - `pci`: a physical PCI device which can only be created or deleted when the bare metal server is stopped @@ -63832,10 +65700,11 @@ def __init__(self, - The VPC infrastructure performs any needed NAT operations. - A single floating IP can be assigned to the network interface. If `false`: - - Packets are passed unmodified to/from the network interface, + - Packets are passed unchanged to/from the network interface, allowing the workload to perform any needed NAT operations. - Multiple floating IPs can be assigned to the network interface. - `allow_ip_spoofing` must be set to `false`. + This must be `true` when `interface_type` is `hipersocket`. :param str href: The URL for this network interface. :param str id: The unique identifier for this network interface. :param str mac_address: The MAC address of the interface. If absent, the @@ -63850,9 +65719,7 @@ def __init__(self, :param SubnetReference subnet: The associated subnet. :param str type: The type of this bare metal server network interface. :param List[int] allowed_vlans: Indicates what VLAN IDs (for VLAN type - only) can use this physical (PCI type) interface. A given VLAN can only be - in the `allowed_vlans` array for one PCI type adapter per bare metal - server. + only) can use this physical (PCI type) interface. :param str interface_type: - `pci`: a physical PCI device which can only be created or deleted when the bare metal server is stopped @@ -64067,10 +65934,11 @@ class BareMetalServerNetworkInterfaceByVLAN(BareMetalServerNetworkInterface): - The VPC infrastructure performs any needed NAT operations. - A single floating IP can be assigned to the network interface. If `false`: - - Packets are passed unmodified to/from the network interface, + - Packets are passed unchanged to/from the network interface, allowing the workload to perform any needed NAT operations. - Multiple floating IPs can be assigned to the network interface. - `allow_ip_spoofing` must be set to `false`. + This must be `true` when `interface_type` is `hipersocket`. :attr List[FloatingIPReference] floating_ips: (optional) The floating IPs associated with this network interface. :attr str href: The URL for this network interface. @@ -64134,10 +66002,11 @@ def __init__(self, - The VPC infrastructure performs any needed NAT operations. - A single floating IP can be assigned to the network interface. If `false`: - - Packets are passed unmodified to/from the network interface, + - Packets are passed unchanged to/from the network interface, allowing the workload to perform any needed NAT operations. - Multiple floating IPs can be assigned to the network interface. - `allow_ip_spoofing` must be set to `false`. + This must be `true` when `interface_type` is `hipersocket`. :param str href: The URL for this network interface. :param str id: The unique identifier for this network interface. :param str mac_address: The MAC address of the interface. If absent, the @@ -64366,9 +66235,9 @@ class InterfaceTypeEnum(str, Enum): VLAN = 'vlan' -class BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype(BareMetalServerNetworkInterfacePrototype): +class BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype(BareMetalServerNetworkInterfacePrototype): """ - BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype. + BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype. :attr bool allow_ip_spoofing: (optional) Indicates whether source IP spoofing is allowed on this interface. If false, source IP spoofing is prevented on this @@ -64377,10 +66246,11 @@ class BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByP - The VPC infrastructure performs any needed NAT operations. - A single floating IP can be assigned to the network interface. If `false`: - - Packets are passed unmodified to/from the network interface, + - Packets are passed unchanged to/from the network interface, allowing the workload to perform any needed NAT operations. - Multiple floating IPs can be assigned to the network interface. - `allow_ip_spoofing` must be set to `false`. + This must be `true` when `interface_type` is `hipersocket`. :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. @@ -64394,16 +66264,10 @@ class BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByP groups to use for this network interface. If unspecified, the VPC's default security group is used. :attr SubnetIdentity subnet: The associated subnet. - :attr List[int] allowed_vlans: (optional) Indicates what VLAN IDs (for VLAN type - only) can use this physical (PCI type) interface. A given VLAN can only be in - the `allowed_vlans` array for one PCI type adapter per bare metal server. - :attr str interface_type: - `pci`: a physical PCI device which can only be - created or deleted when the bare metal - server is stopped - - Has an `allowed_vlans` property which controls the VLANs that will be - permitted - to use the PCI interface - - Cannot directly use an IEEE 802.1q VLAN tag. + :attr str interface_type: - `hipersocket`: a virtual network device that + provides high-speed TCP/IP connectivity + within a `s390x` based system. + - Not supported on bare metal servers with a `cpu.architecture` of `amd64`. """ def __init__(self, @@ -64414,19 +66278,16 @@ def __init__(self, enable_infrastructure_nat: bool = None, name: str = None, primary_ip: 'NetworkInterfaceIPPrototype' = None, - security_groups: List['SecurityGroupIdentity'] = None, - allowed_vlans: List[int] = None) -> None: + security_groups: List['SecurityGroupIdentity'] = None) -> None: """ - Initialize a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype object. + Initialize a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype object. :param SubnetIdentity subnet: The associated subnet. - :param str interface_type: - `pci`: a physical PCI device which can only be - created or deleted when the bare metal - server is stopped - - Has an `allowed_vlans` property which controls the VLANs that will be - permitted - to use the PCI interface - - Cannot directly use an IEEE 802.1q VLAN tag. + :param str interface_type: - `hipersocket`: a virtual network device that + provides high-speed TCP/IP connectivity + within a `s390x` based system. + - Not supported on bare metal servers with a `cpu.architecture` of + `amd64`. :param bool allow_ip_spoofing: (optional) Indicates whether source IP spoofing is allowed on this interface. If false, source IP spoofing is prevented on this interface. If true, source IP spoofing is allowed on this @@ -64435,10 +66296,200 @@ def __init__(self, - The VPC infrastructure performs any needed NAT operations. - A single floating IP can be assigned to the network interface. If `false`: - - Packets are passed unmodified to/from the network interface, + - Packets are passed unchanged to/from the network interface, allowing the workload to perform any needed NAT operations. - Multiple floating IPs can be assigned to the network interface. - `allow_ip_spoofing` must be set to `false`. + This must be `true` when `interface_type` is `hipersocket`. + :param 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. + :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. + """ + # pylint: disable=super-init-not-called + self.allow_ip_spoofing = allow_ip_spoofing + self.enable_infrastructure_nat = enable_infrastructure_nat + self.name = name + self.primary_ip = primary_ip + self.security_groups = security_groups + self.subnet = subnet + self.interface_type = interface_type + + @classmethod + def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype': + """Initialize a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype object from a json dictionary.""" + args = {} + if 'allow_ip_spoofing' in _dict: + args['allow_ip_spoofing'] = _dict.get('allow_ip_spoofing') + if 'enable_infrastructure_nat' in _dict: + args['enable_infrastructure_nat'] = _dict.get('enable_infrastructure_nat') + if 'name' in _dict: + args['name'] = _dict.get('name') + 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: + args['subnet'] = _dict.get('subnet') + else: + raise ValueError('Required property \'subnet\' not present in BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype JSON') + if 'interface_type' in _dict: + args['interface_type'] = _dict.get('interface_type') + else: + raise ValueError('Required property \'interface_type\' not present in BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'allow_ip_spoofing') and self.allow_ip_spoofing is not None: + _dict['allow_ip_spoofing'] = self.allow_ip_spoofing + if hasattr(self, 'enable_infrastructure_nat') and self.enable_infrastructure_nat is not None: + _dict['enable_infrastructure_nat'] = self.enable_infrastructure_nat + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + 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: + if isinstance(x, dict): + security_groups_list.append(x) + else: + security_groups_list.append(x.to_dict()) + _dict['security_groups'] = security_groups_list + if hasattr(self, 'subnet') and self.subnet is not None: + if isinstance(self.subnet, dict): + _dict['subnet'] = self.subnet + else: + _dict['subnet'] = self.subnet.to_dict() + if hasattr(self, 'interface_type') and self.interface_type is not None: + _dict['interface_type'] = self.interface_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 BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class InterfaceTypeEnum(str, Enum): + """ + - `hipersocket`: a virtual network device that provides high-speed TCP/IP + connectivity + within a `s390x` based system. + - Not supported on bare metal servers with a `cpu.architecture` of `amd64`. + """ + HIPERSOCKET = 'hipersocket' + + +class BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype(BareMetalServerNetworkInterfacePrototype): + """ + BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype. + + :attr bool allow_ip_spoofing: (optional) Indicates whether source IP spoofing is + allowed on this interface. If false, source IP spoofing is prevented on this + interface. If true, source IP spoofing is allowed on this interface. + :attr bool enable_infrastructure_nat: (optional) If `true`: + - The VPC infrastructure performs any needed NAT operations. + - A single floating IP can be assigned to the network interface. + If `false`: + - Packets are passed unchanged to/from the network interface, + allowing the workload to perform any needed NAT operations. + - Multiple floating IPs can be assigned to the network interface. + - `allow_ip_spoofing` must be set to `false`. + This must be `true` when `interface_type` is `hipersocket`. + :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 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. + :attr SubnetIdentity subnet: The associated subnet. + :attr List[int] allowed_vlans: (optional) Indicates what VLAN IDs (for VLAN type + only) can use this physical (PCI type) interface. + :attr str interface_type: - `pci`: a physical PCI device which can only be + created or deleted when the bare metal + server is stopped + - Has an `allowed_vlans` property which controls the VLANs that will be + permitted + to use the PCI interface + - Cannot directly use an IEEE 802.1q VLAN tag. + - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. + """ + + def __init__(self, + subnet: 'SubnetIdentity', + interface_type: str, + *, + allow_ip_spoofing: bool = None, + enable_infrastructure_nat: bool = None, + name: str = None, + primary_ip: 'NetworkInterfaceIPPrototype' = None, + security_groups: List['SecurityGroupIdentity'] = None, + allowed_vlans: List[int] = None) -> None: + """ + Initialize a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype object. + + :param SubnetIdentity subnet: The associated subnet. + :param str interface_type: - `pci`: a physical PCI device which can only be + created or deleted when the bare metal + server is stopped + - Has an `allowed_vlans` property which controls the VLANs that will be + permitted + to use the PCI interface + - Cannot directly use an IEEE 802.1q VLAN tag. + - Not supported on bare metal servers with a `cpu.architecture` of + `s390x`. + :param bool allow_ip_spoofing: (optional) Indicates whether source IP + spoofing is allowed on this interface. If false, source IP spoofing is + prevented on this interface. If true, source IP spoofing is allowed on this + interface. + :param bool enable_infrastructure_nat: (optional) If `true`: + - The VPC infrastructure performs any needed NAT operations. + - A single floating IP can be assigned to the network interface. + If `false`: + - Packets are passed unchanged to/from the network interface, + allowing the workload to perform any needed NAT operations. + - Multiple floating IPs can be assigned to the network interface. + - `allow_ip_spoofing` must be set to `false`. + This must be `true` when `interface_type` is `hipersocket`. :param 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 @@ -64454,9 +66505,7 @@ def __init__(self, groups to use for this network interface. If unspecified, the VPC's default security group is used. :param List[int] allowed_vlans: (optional) Indicates what VLAN IDs (for - VLAN type only) can use this physical (PCI type) interface. A given VLAN - can only be in the `allowed_vlans` array for one PCI type adapter per bare - metal server. + VLAN type only) can use this physical (PCI type) interface. """ # pylint: disable=super-init-not-called self.allow_ip_spoofing = allow_ip_spoofing @@ -64559,6 +66608,7 @@ class InterfaceTypeEnum(str, Enum): permitted to use the PCI interface - Cannot directly use an IEEE 802.1q VLAN tag. + - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. """ PCI = 'pci' @@ -64574,10 +66624,11 @@ class BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByV - The VPC infrastructure performs any needed NAT operations. - A single floating IP can be assigned to the network interface. If `false`: - - Packets are passed unmodified to/from the network interface, + - Packets are passed unchanged to/from the network interface, allowing the workload to perform any needed NAT operations. - Multiple floating IPs can be assigned to the network interface. - `allow_ip_spoofing` must be set to `false`. + This must be `true` when `interface_type` is `hipersocket`. :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. @@ -64603,6 +66654,7 @@ class BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByV - Has its own security groups and does not inherit those of the PCI device through which traffic flows. + - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. :attr int vlan: Indicates the 802.1Q VLAN ID tag that must be used for all traffic on this interface. """ @@ -64629,6 +66681,8 @@ def __init__(self, - Has its own security groups and does not inherit those of the PCI device through which traffic flows. + - Not supported on bare metal servers with a `cpu.architecture` of + `s390x`. :param int vlan: Indicates the 802.1Q VLAN ID tag that must be used for all traffic on this interface. :param bool allow_ip_spoofing: (optional) Indicates whether source IP @@ -64639,10 +66693,11 @@ def __init__(self, - The VPC infrastructure performs any needed NAT operations. - A single floating IP can be assigned to the network interface. If `false`: - - Packets are passed unmodified to/from the network interface, + - Packets are passed unchanged to/from the network interface, allowing the workload to perform any needed NAT operations. - Multiple floating IPs can be assigned to the network interface. - `allow_ip_spoofing` must be set to `false`. + This must be `true` when `interface_type` is `hipersocket`. :param 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 @@ -64771,6 +66826,7 @@ class InterfaceTypeEnum(str, Enum): - Has its own security groups and does not inherit those of the PCI device through which traffic flows. + - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. """ VLAN = 'vlan' @@ -66860,6 +68916,128 @@ class TypeEnum(str, Enum): RANGE = 'range' +class CatalogOfferingIdentityCatalogOfferingByCRN(CatalogOfferingIdentity): + """ + CatalogOfferingIdentityCatalogOfferingByCRN. + + :attr str crn: The CRN for this + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + offering. + """ + + def __init__(self, + crn: str) -> None: + """ + Initialize a CatalogOfferingIdentityCatalogOfferingByCRN object. + + :param str crn: The CRN for this + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + offering. + """ + # pylint: disable=super-init-not-called + self.crn = crn + + @classmethod + def from_dict(cls, _dict: Dict) -> 'CatalogOfferingIdentityCatalogOfferingByCRN': + """Initialize a CatalogOfferingIdentityCatalogOfferingByCRN object from a json dictionary.""" + args = {} + if 'crn' in _dict: + args['crn'] = _dict.get('crn') + else: + raise ValueError('Required property \'crn\' not present in CatalogOfferingIdentityCatalogOfferingByCRN JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a CatalogOfferingIdentityCatalogOfferingByCRN object from 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 CatalogOfferingIdentityCatalogOfferingByCRN object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'CatalogOfferingIdentityCatalogOfferingByCRN') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'CatalogOfferingIdentityCatalogOfferingByCRN') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + +class CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN(CatalogOfferingVersionIdentity): + """ + CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN. + + :attr str crn: The CRN for this version of a + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + offering. + """ + + def __init__(self, + crn: str) -> None: + """ + Initialize a CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN object. + + :param str crn: The CRN for this version of a + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + offering. + """ + # pylint: disable=super-init-not-called + self.crn = crn + + @classmethod + def from_dict(cls, _dict: Dict) -> 'CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN': + """Initialize a CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN object from a json dictionary.""" + args = {} + if 'crn' in _dict: + args['crn'] = _dict.get('crn') + else: + raise ValueError('Required property \'crn\' not present in CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN object from 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 CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + class CertificateInstanceIdentityByCRN(CertificateInstanceIdentity): """ CertificateInstanceIdentityByCRN. @@ -68189,7 +70367,8 @@ class DedicatedHostPrototypeDedicatedHostByGroup(DedicatedHostPrototype): be placed on this dedicated host. :attr str name: (optional) The unique user-defined name for this dedicated host. If unspecified, the name will be a hyphenated list of randomly-selected words. - :attr DedicatedHostProfileIdentity profile: The profile to use for this + :attr DedicatedHostProfileIdentity profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) to use for this dedicated host. :attr ResourceGroupIdentity resource_group: (optional) :attr DedicatedHostGroupIdentity group: The dedicated host group for this @@ -68206,8 +70385,9 @@ def __init__(self, """ Initialize a DedicatedHostPrototypeDedicatedHostByGroup object. - :param DedicatedHostProfileIdentity profile: The profile to use for this - dedicated host. + :param DedicatedHostProfileIdentity profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) to use for + this dedicated host. :param DedicatedHostGroupIdentity group: The dedicated host group for this dedicated host. :param bool instance_placement_enabled: (optional) If set to true, @@ -68299,7 +70479,8 @@ class DedicatedHostPrototypeDedicatedHostByZone(DedicatedHostPrototype): be placed on this dedicated host. :attr str name: (optional) The unique user-defined name for this dedicated host. If unspecified, the name will be a hyphenated list of randomly-selected words. - :attr DedicatedHostProfileIdentity profile: The profile to use for this + :attr DedicatedHostProfileIdentity profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) to use for this dedicated host. :attr ResourceGroupIdentity resource_group: (optional) :attr DedicatedHostGroupPrototypeDedicatedHostByZoneContext group: (optional) @@ -68317,8 +70498,9 @@ def __init__(self, """ Initialize a DedicatedHostPrototypeDedicatedHostByZone object. - :param DedicatedHostProfileIdentity profile: The profile to use for this - dedicated host. + :param DedicatedHostProfileIdentity profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) to use for + this dedicated host. :param ZoneIdentity zone: The zone this dedicated host will reside in. :param bool instance_placement_enabled: (optional) If set to true, instances can be placed on this dedicated host. @@ -69198,7 +71380,7 @@ class FloatingIPTargetNetworkInterfaceReference(FloatingIPTarget): FloatingIPTargetNetworkInterfaceReference. :attr NetworkInterfaceReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted and provides + 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. @@ -69224,7 +71406,7 @@ def __init__(self, :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 + this property indicates the referenced resource has been deleted, and provides some supplementary information. """ @@ -69317,7 +71499,7 @@ class FloatingIPTargetPublicGatewayReference(FloatingIPTarget): :attr str crn: The CRN for this public gateway. :attr PublicGatewayReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted and provides + property indicates the referenced resource has been deleted, and provides some supplementary information. :attr str href: The URL for this public gateway. :attr str id: The unique identifier for this public gateway. @@ -69342,7 +71524,7 @@ def __init__(self, :param str name: The user-defined name for this public gateway. :param str resource_type: The resource type. :param PublicGatewayReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted and provides + property indicates the referenced resource has been deleted, and provides some supplementary information. """ # pylint: disable=super-init-not-called @@ -69498,7 +71680,7 @@ class FlowLogCollectorTargetInstanceReference(FlowLogCollectorTarget): :attr str crn: The CRN for this virtual server instance. :attr InstanceReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted and provides + indicates the referenced resource has been deleted, and provides some supplementary information. :attr str href: The URL for this virtual server instance. :attr str id: The unique identifier for this virtual server instance. @@ -69522,7 +71704,7 @@ def __init__(self, :param str name: The user-defined name for this virtual server instance (and default system hostname). :param InstanceReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted and provides + property indicates the referenced resource has been deleted, and provides some supplementary information. """ # pylint: disable=super-init-not-called @@ -69599,7 +71781,7 @@ class FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext(FlowLogCollec FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext. :attr NetworkInterfaceReferenceTargetContextDeleted deleted: (optional) If - present, this property indicates the referenced resource has been deleted and + present, this property indicates the referenced resource has been deleted, and provides some supplementary information. :attr str href: The URL for this network interface. @@ -69623,7 +71805,7 @@ def __init__(self, :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 + present, this property indicates the referenced resource has been deleted, and provides some supplementary information. """ @@ -69709,7 +71891,7 @@ class FlowLogCollectorTargetSubnetReference(FlowLogCollectorTarget): :attr str crn: The CRN for this subnet. :attr SubnetReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted and provides + indicates the referenced resource has been deleted, and provides some supplementary information. :attr str href: The URL for this subnet. :attr str id: The unique identifier for this subnet. @@ -69734,7 +71916,7 @@ def __init__(self, :param str name: The user-defined name for this subnet. :param str resource_type: The resource type. :param SubnetReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted and provides + indicates the referenced resource has been deleted, and provides some supplementary information. """ # pylint: disable=super-init-not-called @@ -69826,7 +72008,7 @@ class FlowLogCollectorTargetVPCReference(FlowLogCollectorTarget): :attr str crn: The CRN for this VPC. :attr VPCReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted and provides + indicates the referenced resource has been deleted, and provides some supplementary information. :attr str href: The URL for this VPC. :attr str id: The unique identifier for this VPC. @@ -69851,7 +72033,7 @@ def __init__(self, :param str name: The unique user-defined name for this VPC. :param str resource_type: The resource type. :param VPCReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted and provides + indicates the referenced resource has been deleted, and provides some supplementary information. """ # pylint: disable=super-init-not-called @@ -70270,7 +72452,7 @@ class ImagePrototypeImageBySourceVolume(ImagePrototype): If unspecified, the root key from `source_volume` will be used. :attr VolumeIdentity source_volume: The volume from which to create the image. The specified volume must: - - Originate from an image, which will be used to populate this image's + - Have an `operating_system`, which will be used to populate this image's operating system information. - Not be `active` or `busy`. During image creation, the specified volume may briefly become `busy`. @@ -70287,7 +72469,7 @@ def __init__(self, :param VolumeIdentity source_volume: The volume from which to create the image. The specified volume must: - - Originate from an image, which will be used to populate this image's + - Have an `operating_system`, which will be used to populate this image's operating system information. - Not be `active` or `busy`. During image creation, the specified volume may briefly become `busy`. @@ -70366,6 +72548,136 @@ def __ne__(self, other: 'ImagePrototypeImageBySourceVolume') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other +class InstanceCatalogOfferingPrototypeCatalogOfferingByOffering(InstanceCatalogOfferingPrototype): + """ + InstanceCatalogOfferingPrototypeCatalogOfferingByOffering. + + :attr CatalogOfferingIdentity offering: Identifies a + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + offering by a unique property. + """ + + def __init__(self, + offering: 'CatalogOfferingIdentity') -> None: + """ + Initialize a InstanceCatalogOfferingPrototypeCatalogOfferingByOffering object. + + :param CatalogOfferingIdentity offering: Identifies a + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + offering by a unique property. + """ + # pylint: disable=super-init-not-called + self.offering = offering + + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstanceCatalogOfferingPrototypeCatalogOfferingByOffering': + """Initialize a InstanceCatalogOfferingPrototypeCatalogOfferingByOffering object from a json dictionary.""" + args = {} + if 'offering' in _dict: + args['offering'] = _dict.get('offering') + else: + raise ValueError('Required property \'offering\' not present in InstanceCatalogOfferingPrototypeCatalogOfferingByOffering JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceCatalogOfferingPrototypeCatalogOfferingByOffering object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'offering') and self.offering is not None: + if isinstance(self.offering, dict): + _dict['offering'] = self.offering + else: + _dict['offering'] = self.offering.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 InstanceCatalogOfferingPrototypeCatalogOfferingByOffering object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstanceCatalogOfferingPrototypeCatalogOfferingByOffering') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'InstanceCatalogOfferingPrototypeCatalogOfferingByOffering') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + +class InstanceCatalogOfferingPrototypeCatalogOfferingByVersion(InstanceCatalogOfferingPrototype): + """ + InstanceCatalogOfferingPrototypeCatalogOfferingByVersion. + + :attr CatalogOfferingVersionIdentity version: Identifies a version of a + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + offering by a + unique property. + """ + + def __init__(self, + version: 'CatalogOfferingVersionIdentity') -> None: + """ + Initialize a InstanceCatalogOfferingPrototypeCatalogOfferingByVersion object. + + :param CatalogOfferingVersionIdentity version: Identifies a version of a + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + offering by a + unique property. + """ + # pylint: disable=super-init-not-called + self.version = version + + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstanceCatalogOfferingPrototypeCatalogOfferingByVersion': + """Initialize a InstanceCatalogOfferingPrototypeCatalogOfferingByVersion object from a json dictionary.""" + args = {} + if 'version' in _dict: + args['version'] = _dict.get('version') + else: + raise ValueError('Required property \'version\' not present in InstanceCatalogOfferingPrototypeCatalogOfferingByVersion JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceCatalogOfferingPrototypeCatalogOfferingByVersion object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'version') and self.version is not None: + if isinstance(self.version, dict): + _dict['version'] = self.version + else: + _dict['version'] = self.version.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 InstanceCatalogOfferingPrototypeCatalogOfferingByVersion object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstanceCatalogOfferingPrototypeCatalogOfferingByVersion') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'InstanceCatalogOfferingPrototypeCatalogOfferingByVersion') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + class InstanceGroupManagerActionPrototypeScheduledActionPrototype(InstanceGroupManagerActionPrototype): """ InstanceGroupManagerActionPrototypeScheduledActionPrototype. @@ -70415,7 +72727,7 @@ class InstanceGroupManagerActionScheduledAction(InstanceGroupManagerAction): - `incompatible`: Action parameters are not compatible with the group or manager - `omitted`: Action was not applied because this action's manager was disabled. :attr datetime updated_at: The date and time that the instance group manager - action was modified. + action was updated. :attr str action_type: The type of action for the instance group. :attr str cron_spec: (optional) The cron specification for a recurring scheduled action. Actions can be applied a maximum of one time within a 5 min period. @@ -70468,7 +72780,7 @@ def __init__(self, - `omitted`: Action was not applied because this action's manager was disabled. :param datetime updated_at: The date and time that the instance group - manager action was modified. + manager action was updated. :param str action_type: The type of action for the instance group. :param str cron_spec: (optional) The cron specification for a recurring scheduled action. Actions can be applied a maximum of one time within a 5 @@ -71324,7 +73636,7 @@ class InstanceGroupManagerScheduledActionManagerAutoScale(InstanceGroupManagerSc InstanceGroupManagerScheduledActionManagerAutoScale. :attr InstanceGroupManagerReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted and provides + property indicates the referenced resource has been deleted, and provides some supplementary information. :attr str href: The URL for this instance group manager. :attr str id: The unique identifier for this instance group manager. @@ -71350,7 +73662,7 @@ def __init__(self, :param str id: The unique identifier for this instance group manager. :param str name: The user-defined name for this instance group manager. :param InstanceGroupManagerReferenceDeleted deleted: (optional) If present, - this property indicates the referenced resource has been deleted and + this property indicates the referenced resource has been deleted, and provides some supplementary information. :param int max_membership_count: (optional) The desired maximum number of @@ -71662,7 +73974,7 @@ class InstancePlacementTargetDedicatedHostGroupReference(InstancePlacementTarget :attr str crn: The CRN for this dedicated host group. :attr DedicatedHostGroupReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted and provides + property indicates the referenced resource has been deleted, and provides some supplementary information. :attr str href: The URL for this dedicated host group. :attr str id: The unique identifier for this dedicated host group. @@ -71688,7 +74000,7 @@ def __init__(self, group. :param str resource_type: The resource type. :param DedicatedHostGroupReferenceDeleted deleted: (optional) If present, - this property indicates the referenced resource has been deleted and + this property indicates the referenced resource has been deleted, and provides some supplementary information. """ @@ -71781,7 +74093,7 @@ class InstancePlacementTargetDedicatedHostReference(InstancePlacementTarget): :attr str crn: The CRN for this dedicated host. :attr DedicatedHostReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted and provides + property indicates the referenced resource has been deleted, and provides some supplementary information. :attr str href: The URL for this dedicated host. :attr str id: The unique identifier for this dedicated host. @@ -71806,7 +74118,7 @@ def __init__(self, :param str name: The unique user-defined name for this dedicated host. :param str resource_type: The resource type. :param DedicatedHostReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted and provides + property indicates the referenced resource has been deleted, and provides some supplementary information. """ # pylint: disable=super-init-not-called @@ -71898,7 +74210,7 @@ class InstancePlacementTargetPlacementGroupReference(InstancePlacementTarget): :attr str crn: The CRN for this placement group. :attr PlacementGroupReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted and provides + property indicates the referenced resource has been deleted, and provides some supplementary information. :attr str href: The URL for this placement group. :attr str id: The unique identifier for this placement group. @@ -71923,7 +74235,7 @@ def __init__(self, :param str name: The user-defined name for this placement group. :param str resource_type: The resource type. :param PlacementGroupReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted and provides + property indicates the referenced resource has been deleted, and provides some supplementary information. """ # pylint: disable=super-init-not-called @@ -74890,6 +77202,319 @@ class TypeEnum(str, Enum): RANGE = 'range' +class InstancePrototypeInstanceByCatalogOffering(InstancePrototype): + """ + InstancePrototypeInstanceByCatalogOffering. + + :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 + 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 InstanceMetadataServicePrototype metadata_service: (optional) + :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 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](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this + 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 + increase in this value will result in a corresponding decrease to + `total_network_bandwidth`. + :attr str user_data: (optional) [User + data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when + setting up the virtual server instance. + :attr List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: + (optional) The additional volume attachments to create for the virtual server + instance. + :attr VPCIdentity vpc: (optional) The VPC this virtual server instance will + reside in. If specified, it must match the VPC for the subnets of the + instance's network interfaces. + :attr VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment: + (optional) The boot volume attachment for the virtual server instance. + :attr InstanceCatalogOfferingPrototype catalog_offering: The + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + offering + or offering version to use when provisioning this virtual server instance. + If an offering is specified, the latest version of that offering will be used. + The specified offering or offering version may be in a different account in the + same + [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise), + subject + to IAM policies. + :attr NetworkInterfacePrototype primary_network_interface: Primary network + interface. + :attr ZoneIdentity zone: The zone this virtual server instance will reside in. + """ + + def __init__(self, + catalog_offering: 'InstanceCatalogOfferingPrototype', + 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, + profile: 'InstanceProfileIdentity' = None, + resource_group: 'ResourceGroupIdentity' = 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 InstancePrototypeInstanceByCatalogOffering object. + + :param InstanceCatalogOfferingPrototype catalog_offering: The + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + offering + or offering version to use when provisioning this virtual server instance. + If an offering is specified, the latest version of that offering will be + used. + The specified offering or offering version may be in a different account in + the same + [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise), + subject + to IAM policies. + :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 + 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 InstanceMetadataServicePrototype metadata_service: (optional) + :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 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](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for + 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 + increase in this value will result in a corresponding decrease to + `total_network_bandwidth`. + :param str user_data: (optional) [User + data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available + when setting up the virtual server instance. + :param List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: + (optional) The additional volume attachments to create for the virtual + server instance. + :param VPCIdentity vpc: (optional) The VPC this virtual server instance + will reside in. If specified, it must match the VPC for 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.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 + 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.catalog_offering = catalog_offering + self.primary_network_interface = primary_network_interface + self.zone = zone + + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstancePrototypeInstanceByCatalogOffering': + """Initialize a InstancePrototypeInstanceByCatalogOffering 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: + 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'] = _dict.get('resource_group') + 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 'catalog_offering' in _dict: + args['catalog_offering'] = _dict.get('catalog_offering') + else: + raise ValueError('Required property \'catalog_offering\' not present in InstancePrototypeInstanceByCatalogOffering 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 InstancePrototypeInstanceByCatalogOffering JSON') + if 'zone' in _dict: + args['zone'] = _dict.get('zone') + else: + raise ValueError('Required property \'zone\' not present in InstancePrototypeInstanceByCatalogOffering JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstancePrototypeInstanceByCatalogOffering object from 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: + 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: + _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, 'catalog_offering') and self.catalog_offering is not None: + if isinstance(self.catalog_offering, dict): + _dict['catalog_offering'] = self.catalog_offering + else: + _dict['catalog_offering'] = self.catalog_offering.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 InstancePrototypeInstanceByCatalogOffering object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstancePrototypeInstanceByCatalogOffering') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'InstancePrototypeInstanceByCatalogOffering') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + class InstancePrototypeInstanceByImage(InstancePrototype): """ InstancePrototypeInstanceByImage. @@ -74925,8 +77550,9 @@ class InstancePrototypeInstanceByImage(InstancePrototype): 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. If unspecified, `bx2-2x8` will be used, but this + :attr InstanceProfileIdentity profile: (optional) The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this + 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 @@ -74939,8 +77565,8 @@ class InstancePrototypeInstanceByImage(InstancePrototype): :attr List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: (optional) The additional volume attachments to create for the 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 + :attr VPCIdentity vpc: (optional) The VPC this virtual server instance will + reside in. If specified, it must match the VPC for the subnets of the instance's network interfaces. :attr VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment: (optional) The boot volume attachment for the virtual server instance. @@ -75012,8 +77638,9 @@ def __init__(self, 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. If unspecified, `bx2-2x8` will be used, but + :param InstanceProfileIdentity profile: (optional) The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for + 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 @@ -75026,9 +77653,9 @@ def __init__(self, :param List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: (optional) The additional volume attachments to create for the 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 VPCIdentity vpc: (optional) The VPC this virtual server instance + will reside in. If specified, it must match the VPC for the subnets of the + instance's network interfaces. :param VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment: (optional) The boot volume attachment for the virtual server instance. @@ -75219,8 +77846,9 @@ class InstancePrototypeInstanceBySourceSnapshot(InstancePrototype): 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. If unspecified, `bx2-2x8` will be used, but this + :attr InstanceProfileIdentity profile: (optional) The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this + 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 @@ -75233,8 +77861,8 @@ class InstancePrototypeInstanceBySourceSnapshot(InstancePrototype): :attr List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: (optional) The additional volume attachments to create for the 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 + :attr VPCIdentity vpc: (optional) The VPC this virtual server instance will + reside in. If specified, it must match the VPC for the subnets of the instance's network interfaces. :attr VolumeAttachmentPrototypeInstanceBySourceSnapshotContext boot_volume_attachment: The boot volume attachment for the virtual server @@ -75305,8 +77933,9 @@ def __init__(self, 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. If unspecified, `bx2-2x8` will be used, but + :param InstanceProfileIdentity profile: (optional) The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for + 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 @@ -75319,9 +77948,9 @@ def __init__(self, :param List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: (optional) The additional volume attachments to create for the 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 VPCIdentity vpc: (optional) The VPC this virtual server instance + will reside in. If specified, it must match the VPC for the subnets of the + instance's network interfaces. """ # pylint: disable=super-init-not-called self.availability_policy = availability_policy @@ -75501,8 +78130,9 @@ class InstancePrototypeInstanceBySourceTemplate(InstancePrototype): 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. If unspecified, `bx2-2x8` will be used, but this + :attr InstanceProfileIdentity profile: (optional) The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this + 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 @@ -75515,11 +78145,20 @@ class InstancePrototypeInstanceBySourceTemplate(InstancePrototype): :attr List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: (optional) The additional volume attachments to create for the 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 + :attr VPCIdentity vpc: (optional) The VPC this virtual server instance will + reside in. If specified, it must match the VPC for the subnets of the instance's network interfaces. :attr VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment: (optional) The boot volume attachment for the virtual server instance. + :attr InstanceCatalogOfferingPrototype catalog_offering: (optional) The + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + offering version to use when provisioning this virtual server instance. + If an offering is specified, the latest version of that offering will be used. + The specified offering or offering version may be in a different account, + subject to + IAM policies. + If specified, `image` must not be specified, and `source_template` must not have + `image` specified. :attr ImageIdentity image: (optional) The image to use when provisioning the virtual server instance. :attr NetworkInterfacePrototype primary_network_interface: (optional) Primary @@ -75547,6 +78186,7 @@ def __init__(self, volume_attachments: List['VolumeAttachmentPrototypeInstanceContext'] = None, vpc: 'VPCIdentity' = None, boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceByImageContext' = None, + catalog_offering: 'InstanceCatalogOfferingPrototype' = None, image: 'ImageIdentity' = None, primary_network_interface: 'NetworkInterfacePrototype' = None, zone: 'ZoneIdentity' = None) -> None: @@ -75588,8 +78228,9 @@ def __init__(self, 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. If unspecified, `bx2-2x8` will be used, but + :param InstanceProfileIdentity profile: (optional) The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for + 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 @@ -75602,12 +78243,23 @@ def __init__(self, :param List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: (optional) The additional volume attachments to create for the 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 VPCIdentity vpc: (optional) The VPC this virtual server instance + will reside in. If specified, it must match the VPC for the subnets of the + instance's network interfaces. :param VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment: (optional) The boot volume attachment for the virtual server instance. + :param InstanceCatalogOfferingPrototype catalog_offering: (optional) The + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + offering version to use when provisioning this virtual server instance. + If an offering is specified, the latest version of that offering will be + used. + The specified offering or offering version may be in a different account, + subject to + IAM policies. + If specified, `image` must not be specified, and `source_template` must not + have + `image` specified. :param ImageIdentity image: (optional) The image to use when provisioning the virtual server instance. :param NetworkInterfacePrototype primary_network_interface: (optional) @@ -75630,6 +78282,7 @@ def __init__(self, self.volume_attachments = volume_attachments self.vpc = vpc self.boot_volume_attachment = boot_volume_attachment + self.catalog_offering = catalog_offering self.image = image self.primary_network_interface = primary_network_interface self.source_template = source_template @@ -75667,6 +78320,8 @@ def from_dict(cls, _dict: Dict) -> 'InstancePrototypeInstanceBySourceTemplate': args['vpc'] = _dict.get('vpc') if 'boot_volume_attachment' in _dict: args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByImageContext.from_dict(_dict.get('boot_volume_attachment')) + if 'catalog_offering' in _dict: + args['catalog_offering'] = _dict.get('catalog_offering') if 'image' in _dict: args['image'] = _dict.get('image') if 'primary_network_interface' in _dict: @@ -75733,6 +78388,11 @@ 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, 'catalog_offering') and self.catalog_offering is not None: + if isinstance(self.catalog_offering, dict): + _dict['catalog_offering'] = self.catalog_offering + else: + _dict['catalog_offering'] = self.catalog_offering.to_dict() if hasattr(self, 'image') and self.image is not None: if isinstance(self.image, dict): _dict['image'] = self.image @@ -75941,6 +78601,319 @@ def __ne__(self, other: 'InstanceTemplateIdentityById') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other +class InstanceTemplatePrototypeInstanceByCatalogOffering(InstanceTemplatePrototype): + """ + InstanceTemplatePrototypeInstanceByCatalogOffering. + + :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 + 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 InstanceMetadataServicePrototype metadata_service: (optional) + :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 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](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this + 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 + increase in this value will result in a corresponding decrease to + `total_network_bandwidth`. + :attr str user_data: (optional) [User + data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when + setting up the virtual server instance. + :attr List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: + (optional) The additional volume attachments to create for the virtual server + instance. + :attr VPCIdentity vpc: (optional) The VPC this virtual server instance will + reside in. If specified, it must match the VPC for the subnets of the + instance's network interfaces. + :attr VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment: + (optional) The boot volume attachment for the virtual server instance. + :attr InstanceCatalogOfferingPrototype catalog_offering: The + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + offering + or offering version to use when provisioning this virtual server instance. + If an offering is specified, the latest version of that offering will be used. + The specified offering or offering version may be in a different account in the + same + [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise), + subject + to IAM policies. + :attr NetworkInterfacePrototype primary_network_interface: Primary network + interface. + :attr ZoneIdentity zone: The zone this virtual server instance will reside in. + """ + + def __init__(self, + catalog_offering: 'InstanceCatalogOfferingPrototype', + 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, + profile: 'InstanceProfileIdentity' = None, + resource_group: 'ResourceGroupIdentity' = 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 InstanceTemplatePrototypeInstanceByCatalogOffering object. + + :param InstanceCatalogOfferingPrototype catalog_offering: The + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + offering + or offering version to use when provisioning this virtual server instance. + If an offering is specified, the latest version of that offering will be + used. + The specified offering or offering version may be in a different account in + the same + [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise), + subject + to IAM policies. + :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 + 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 InstanceMetadataServicePrototype metadata_service: (optional) + :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 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](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for + 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 + increase in this value will result in a corresponding decrease to + `total_network_bandwidth`. + :param str user_data: (optional) [User + data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available + when setting up the virtual server instance. + :param List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: + (optional) The additional volume attachments to create for the virtual + server instance. + :param VPCIdentity vpc: (optional) The VPC this virtual server instance + will reside in. If specified, it must match the VPC for 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.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 + 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.catalog_offering = catalog_offering + self.primary_network_interface = primary_network_interface + self.zone = zone + + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstanceTemplatePrototypeInstanceByCatalogOffering': + """Initialize a InstanceTemplatePrototypeInstanceByCatalogOffering 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: + 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'] = _dict.get('resource_group') + 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 'catalog_offering' in _dict: + args['catalog_offering'] = _dict.get('catalog_offering') + else: + raise ValueError('Required property \'catalog_offering\' not present in InstanceTemplatePrototypeInstanceByCatalogOffering 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 InstanceTemplatePrototypeInstanceByCatalogOffering JSON') + if 'zone' in _dict: + args['zone'] = _dict.get('zone') + else: + raise ValueError('Required property \'zone\' not present in InstanceTemplatePrototypeInstanceByCatalogOffering JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceTemplatePrototypeInstanceByCatalogOffering object from 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: + 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: + _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, 'catalog_offering') and self.catalog_offering is not None: + if isinstance(self.catalog_offering, dict): + _dict['catalog_offering'] = self.catalog_offering + else: + _dict['catalog_offering'] = self.catalog_offering.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 InstanceTemplatePrototypeInstanceByCatalogOffering object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstanceTemplatePrototypeInstanceByCatalogOffering') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'InstanceTemplatePrototypeInstanceByCatalogOffering') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + class InstanceTemplatePrototypeInstanceByImage(InstanceTemplatePrototype): """ InstanceTemplatePrototypeInstanceByImage. @@ -75976,8 +78949,9 @@ class InstanceTemplatePrototypeInstanceByImage(InstanceTemplatePrototype): 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. If unspecified, `bx2-2x8` will be used, but this + :attr InstanceProfileIdentity profile: (optional) The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this + 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 @@ -75990,8 +78964,8 @@ class InstanceTemplatePrototypeInstanceByImage(InstanceTemplatePrototype): :attr List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: (optional) The additional volume attachments to create for the 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 + :attr VPCIdentity vpc: (optional) The VPC this virtual server instance will + reside in. If specified, it must match the VPC for the subnets of the instance's network interfaces. :attr VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment: (optional) The boot volume attachment for the virtual server instance. @@ -76063,8 +79037,9 @@ def __init__(self, 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. If unspecified, `bx2-2x8` will be used, but + :param InstanceProfileIdentity profile: (optional) The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for + 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 @@ -76077,9 +79052,9 @@ def __init__(self, :param List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: (optional) The additional volume attachments to create for the 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 VPCIdentity vpc: (optional) The VPC this virtual server instance + will reside in. If specified, it must match the VPC for the subnets of the + instance's network interfaces. :param VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment: (optional) The boot volume attachment for the virtual server instance. @@ -76235,6 +79210,290 @@ def __ne__(self, other: 'InstanceTemplatePrototypeInstanceByImage') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other +class InstanceTemplatePrototypeInstanceBySourceSnapshot(InstanceTemplatePrototype): + """ + InstanceTemplatePrototypeInstanceBySourceSnapshot. + + :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 + 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 InstanceMetadataServicePrototype metadata_service: (optional) + :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 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](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this + 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 + increase in this value will result in a corresponding decrease to + `total_network_bandwidth`. + :attr str user_data: (optional) [User + data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when + setting up the virtual server instance. + :attr List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: + (optional) The additional volume attachments to create for the virtual server + instance. + :attr VPCIdentity vpc: (optional) The VPC this virtual server instance will + reside in. If specified, it must match the VPC for the subnets of the + instance's network interfaces. + :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, + 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, + 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: + """ + Initialize a InstanceTemplatePrototypeInstanceBySourceSnapshot object. + + :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 + 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 InstanceMetadataServicePrototype metadata_service: (optional) + :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 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](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for + 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 + increase in this value will result in a corresponding decrease to + `total_network_bandwidth`. + :param str user_data: (optional) [User + data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available + when setting up the virtual server instance. + :param List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: + (optional) The additional volume attachments to create for the virtual + server instance. + :param VPCIdentity vpc: (optional) The VPC this virtual server instance + will reside in. If specified, it must match the VPC for the subnets of the + instance's network interfaces. + """ + # 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 + 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) -> 'InstanceTemplatePrototypeInstanceBySourceSnapshot': + """Initialize a InstanceTemplatePrototypeInstanceBySourceSnapshot 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: + 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'] = _dict.get('resource_group') + 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'] = VolumeAttachmentPrototypeInstanceBySourceSnapshotContext.from_dict(_dict.get('boot_volume_attachment')) + else: + raise ValueError('Required property \'boot_volume_attachment\' not present in InstanceTemplatePrototypeInstanceBySourceSnapshot 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 InstanceTemplatePrototypeInstanceBySourceSnapshot JSON') + if 'zone' in _dict: + args['zone'] = _dict.get('zone') + else: + raise ValueError('Required property \'zone\' not present in InstanceTemplatePrototypeInstanceBySourceSnapshot JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceTemplatePrototypeInstanceBySourceSnapshot object from 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: + 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: + _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 InstanceTemplatePrototypeInstanceBySourceSnapshot object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstanceTemplatePrototypeInstanceBySourceSnapshot') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'InstanceTemplatePrototypeInstanceBySourceSnapshot') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + class InstanceTemplatePrototypeInstanceBySourceTemplate(InstanceTemplatePrototype): """ InstanceTemplatePrototypeInstanceBySourceTemplate. @@ -76270,8 +79529,9 @@ class InstanceTemplatePrototypeInstanceBySourceTemplate(InstanceTemplatePrototyp 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. If unspecified, `bx2-2x8` will be used, but this + :attr InstanceProfileIdentity profile: (optional) The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this + 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 @@ -76284,11 +79544,20 @@ class InstanceTemplatePrototypeInstanceBySourceTemplate(InstanceTemplatePrototyp :attr List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: (optional) The additional volume attachments to create for the 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 + :attr VPCIdentity vpc: (optional) The VPC this virtual server instance will + reside in. If specified, it must match the VPC for the subnets of the instance's network interfaces. :attr VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment: (optional) The boot volume attachment for the virtual server instance. + :attr InstanceCatalogOfferingPrototype catalog_offering: (optional) The + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + offering version to use when provisioning this virtual server instance. + If an offering is specified, the latest version of that offering will be used. + The specified offering or offering version may be in a different account, + subject to + IAM policies. + If specified, `image` must not be specified, and `source_template` must not have + `image` specified. :attr ImageIdentity image: (optional) The image to use when provisioning the virtual server instance. :attr NetworkInterfacePrototype primary_network_interface: (optional) Primary @@ -76316,6 +79585,7 @@ def __init__(self, volume_attachments: List['VolumeAttachmentPrototypeInstanceContext'] = None, vpc: 'VPCIdentity' = None, boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceByImageContext' = None, + catalog_offering: 'InstanceCatalogOfferingPrototype' = None, image: 'ImageIdentity' = None, primary_network_interface: 'NetworkInterfacePrototype' = None, zone: 'ZoneIdentity' = None) -> None: @@ -76357,8 +79627,9 @@ def __init__(self, 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. If unspecified, `bx2-2x8` will be used, but + :param InstanceProfileIdentity profile: (optional) The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for + 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 @@ -76371,12 +79642,23 @@ def __init__(self, :param List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: (optional) The additional volume attachments to create for the 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 VPCIdentity vpc: (optional) The VPC this virtual server instance + will reside in. If specified, it must match the VPC for the subnets of the + instance's network interfaces. :param VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment: (optional) The boot volume attachment for the virtual server instance. + :param InstanceCatalogOfferingPrototype catalog_offering: (optional) The + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + offering version to use when provisioning this virtual server instance. + If an offering is specified, the latest version of that offering will be + used. + The specified offering or offering version may be in a different account, + subject to + IAM policies. + If specified, `image` must not be specified, and `source_template` must not + have + `image` specified. :param ImageIdentity image: (optional) The image to use when provisioning the virtual server instance. :param NetworkInterfacePrototype primary_network_interface: (optional) @@ -76399,6 +79681,7 @@ def __init__(self, self.volume_attachments = volume_attachments self.vpc = vpc self.boot_volume_attachment = boot_volume_attachment + self.catalog_offering = catalog_offering self.image = image self.primary_network_interface = primary_network_interface self.source_template = source_template @@ -76436,6 +79719,8 @@ def from_dict(cls, _dict: Dict) -> 'InstanceTemplatePrototypeInstanceBySourceTem args['vpc'] = _dict.get('vpc') if 'boot_volume_attachment' in _dict: args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByImageContext.from_dict(_dict.get('boot_volume_attachment')) + if 'catalog_offering' in _dict: + args['catalog_offering'] = _dict.get('catalog_offering') if 'image' in _dict: args['image'] = _dict.get('image') if 'primary_network_interface' in _dict: @@ -76502,6 +79787,11 @@ 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, 'catalog_offering') and self.catalog_offering is not None: + if isinstance(self.catalog_offering, dict): + _dict['catalog_offering'] = self.catalog_offering + else: + _dict['catalog_offering'] = self.catalog_offering.to_dict() if hasattr(self, 'image') and self.image is not None: if isinstance(self.image, dict): _dict['image'] = self.image @@ -76539,9 +79829,9 @@ def __ne__(self, other: 'InstanceTemplatePrototypeInstanceBySourceTemplate') -> """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class InstanceTemplateInstanceByImage(InstanceTemplate): +class InstanceTemplateInstanceByCatalogOffering(InstanceTemplate): """ - InstanceTemplateInstanceByImage. + InstanceTemplateInstanceByCatalogOffering. :attr InstanceAvailabilityPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. @@ -76577,8 +79867,9 @@ class InstanceTemplateInstanceByImage(InstanceTemplate): 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. If unspecified, `bx2-2x8` will be used, but this + :attr InstanceProfileIdentity profile: (optional) The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this + 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. @@ -76592,13 +79883,21 @@ class InstanceTemplateInstanceByImage(InstanceTemplate): :attr List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: (optional) The additional volume attachments to create for the 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 + :attr VPCIdentity vpc: (optional) The VPC this virtual server instance will + reside in. If specified, it must match the VPC for 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 InstanceCatalogOfferingPrototype catalog_offering: The + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + offering + or offering version to use when provisioning this virtual server instance. + If an offering is specified, the latest version of that offering will be used. + The specified offering or offering version may be in a different account in the + same + [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise), + subject + to IAM policies. :attr NetworkInterfacePrototype primary_network_interface: Primary network interface. :attr ZoneIdentity zone: The zone this virtual server instance will reside in. @@ -76611,7 +79910,7 @@ def __init__(self, id: str, name: str, resource_group: 'ResourceGroupReference', - image: 'ImageIdentity', + catalog_offering: 'InstanceCatalogOfferingPrototype', primary_network_interface: 'NetworkInterfacePrototype', zone: 'ZoneIdentity', *, @@ -76628,7 +79927,7 @@ def __init__(self, vpc: 'VPCIdentity' = None, boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceByImageContext' = None) -> None: """ - Initialize a InstanceTemplateInstanceByImage object. + Initialize a InstanceTemplateInstanceByCatalogOffering object. :param datetime created_at: The date and time that the instance template was created. @@ -76638,8 +79937,17 @@ 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 ImageIdentity image: The image to use when provisioning the virtual - server instance. + :param InstanceCatalogOfferingPrototype catalog_offering: The + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + offering + or offering version to use when provisioning this virtual server instance. + If an offering is specified, the latest version of that offering will be + used. + The specified offering or offering version may be in a different account in + the same + [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise), + subject + to IAM policies. :param NetworkInterfacePrototype primary_network_interface: Primary network interface. :param ZoneIdentity zone: The zone this virtual server instance will reside @@ -76674,8 +79982,9 @@ def __init__(self, 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. If unspecified, `bx2-2x8` will be used, but + :param InstanceProfileIdentity profile: (optional) The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for + 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 @@ -76687,9 +79996,9 @@ def __init__(self, :param List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: (optional) The additional volume attachments to create for the 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 VPCIdentity vpc: (optional) The VPC this virtual server instance + will reside in. If specified, it must match the VPC for the subnets of the + instance's network interfaces. :param VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment: (optional) The boot volume attachment for the virtual server instance. @@ -76713,34 +80022,34 @@ def __init__(self, self.volume_attachments = volume_attachments self.vpc = vpc self.boot_volume_attachment = boot_volume_attachment - self.image = image + self.catalog_offering = catalog_offering 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.""" + def from_dict(cls, _dict: Dict) -> 'InstanceTemplateInstanceByCatalogOffering': + """Initialize a InstanceTemplateInstanceByCatalogOffering 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') + raise ValueError('Required property \'created_at\' not present in InstanceTemplateInstanceByCatalogOffering JSON') if 'crn' in _dict: args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'crn\' not present in InstanceTemplateInstanceByImage JSON') + raise ValueError('Required property \'crn\' not present in InstanceTemplateInstanceByCatalogOffering 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') + raise ValueError('Required property \'href\' not present in InstanceTemplateInstanceByCatalogOffering JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in InstanceTemplateInstanceByImage JSON') + raise ValueError('Required property \'id\' not present in InstanceTemplateInstanceByCatalogOffering JSON') if 'keys' in _dict: args['keys'] = _dict.get('keys') if 'metadata_service' in _dict: @@ -76748,7 +80057,7 @@ def from_dict(cls, _dict: Dict) -> 'InstanceTemplateInstanceByImage': if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in InstanceTemplateInstanceByImage JSON') + raise ValueError('Required property \'name\' not present in InstanceTemplateInstanceByCatalogOffering 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: @@ -76758,7 +80067,7 @@ def from_dict(cls, _dict: Dict) -> 'InstanceTemplateInstanceByImage': 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') + raise ValueError('Required property \'resource_group\' not present in InstanceTemplateInstanceByCatalogOffering JSON') if 'total_volume_bandwidth' in _dict: args['total_volume_bandwidth'] = _dict.get('total_volume_bandwidth') if 'user_data' in _dict: @@ -76769,23 +80078,360 @@ def from_dict(cls, _dict: Dict) -> 'InstanceTemplateInstanceByImage': 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') + if 'catalog_offering' in _dict: + args['catalog_offering'] = _dict.get('catalog_offering') else: - raise ValueError('Required property \'image\' not present in InstanceTemplateInstanceByImage JSON') + raise ValueError('Required property \'catalog_offering\' not present in InstanceTemplateInstanceByCatalogOffering 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') + raise ValueError('Required property \'primary_network_interface\' not present in InstanceTemplateInstanceByCatalogOffering JSON') if 'zone' in _dict: args['zone'] = _dict.get('zone') else: - raise ValueError('Required property \'zone\' not present in InstanceTemplateInstanceByImage JSON') + raise ValueError('Required property \'zone\' not present in InstanceTemplateInstanceByCatalogOffering JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceTemplateInstanceByImage object from a json dictionary.""" + """Initialize a InstanceTemplateInstanceByCatalogOffering object from 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: + 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: + _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, 'catalog_offering') and self.catalog_offering is not None: + if isinstance(self.catalog_offering, dict): + _dict['catalog_offering'] = self.catalog_offering + else: + _dict['catalog_offering'] = self.catalog_offering.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 InstanceTemplateInstanceByCatalogOffering object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstanceTemplateInstanceByCatalogOffering') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'InstanceTemplateInstanceByCatalogOffering') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + +class InstanceTemplateInstanceByImage(InstanceTemplate): + """ + 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 + 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 InstanceMetadataServicePrototype metadata_service: (optional) + :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](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this + 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 + `total_network_bandwidth`. + :attr str user_data: (optional) [User + data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when + setting up the virtual server instance. + :attr List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: + (optional) The additional volume attachments to create for the virtual server + instance. + :attr VPCIdentity vpc: (optional) The VPC this virtual server instance will + reside in. If specified, it must match the VPC for 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', + *, + 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, + 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 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 + 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 InstanceMetadataServicePrototype metadata_service: (optional) + :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](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for + 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 + `total_network_bandwidth`. + :param str user_data: (optional) [User + data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available + when setting up the virtual server instance. + :param List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: + (optional) The additional volume attachments to create for the virtual + server instance. + :param VPCIdentity vpc: (optional) The VPC this virtual server instance + will reside in. If specified, it must match the VPC for 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 + 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 '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: + 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: @@ -76912,8 +80558,9 @@ class InstanceTemplateInstanceBySourceSnapshot(InstanceTemplate): 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. If unspecified, `bx2-2x8` will be used, but this + :attr InstanceProfileIdentity profile: (optional) The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this + 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. @@ -76927,8 +80574,8 @@ class InstanceTemplateInstanceBySourceSnapshot(InstanceTemplate): :attr List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: (optional) The additional volume attachments to create for the 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 + :attr VPCIdentity vpc: (optional) The VPC this virtual server instance will + reside in. If specified, it must match the VPC for the subnets of the instance's network interfaces. :attr VolumeAttachmentPrototypeInstanceBySourceSnapshotContext boot_volume_attachment: The boot volume attachment for the virtual server @@ -77008,8 +80655,9 @@ def __init__(self, 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. If unspecified, `bx2-2x8` will be used, but + :param InstanceProfileIdentity profile: (optional) The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for + 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 @@ -77021,9 +80669,9 @@ def __init__(self, :param List[VolumeAttachmentPrototypeInstanceContext] volume_attachments: (optional) The additional volume attachments to create for the 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 VPCIdentity vpc: (optional) The VPC this virtual server instance + will reside in. If specified, it must match the VPC for the subnets of the + instance's network interfaces. """ # pylint: disable=super-init-not-called self.availability_policy = availability_policy @@ -78242,7 +81890,7 @@ class LoadBalancerListenerPolicyTargetLoadBalancerPoolReference(LoadBalancerList LoadBalancerListenerPolicyTargetLoadBalancerPoolReference. :attr LoadBalancerPoolReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted and provides + property indicates the referenced resource has been deleted, and provides some supplementary information. :attr str href: The pool's canonical URL. :attr str id: The unique identifier for this load balancer pool. @@ -78262,7 +81910,7 @@ def __init__(self, :param str id: The unique identifier for this load balancer pool. :param str name: The user-defined name for this load balancer pool. :param LoadBalancerPoolReferenceDeleted deleted: (optional) If present, - this property indicates the referenced resource has been deleted and + this property indicates the referenced resource has been deleted, and provides some supplementary information. """ @@ -78596,7 +82244,7 @@ class LoadBalancerPoolMemberTargetInstanceReference(LoadBalancerPoolMemberTarget :attr str crn: The CRN for this virtual server instance. :attr InstanceReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted and provides + indicates the referenced resource has been deleted, and provides some supplementary information. :attr str href: The URL for this virtual server instance. :attr str id: The unique identifier for this virtual server instance. @@ -78620,7 +82268,7 @@ def __init__(self, :param str name: The user-defined name for this virtual server instance (and default system hostname). :param InstanceReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted and provides + property indicates the referenced resource has been deleted, and provides some supplementary information. """ # pylint: disable=super-init-not-called @@ -79401,7 +83049,7 @@ class NetworkACLPrototypeNetworkACLByRules(NetworkACLPrototype): must be unique within the VPC the network ACL resides in. If unspecified, the name will be a hyphenated list of randomly-selected words. :attr ResourceGroupIdentity resource_group: (optional) - :attr VPCIdentity vpc: The VPC this network ACL is to be a part of. + :attr VPCIdentity vpc: The VPC this network ACL will reside in. :attr List[NetworkACLRulePrototypeNetworkACLContext] rules: (optional) The prototype objects for rules to create along with this network ACL. If unspecified, no rules will be created, resulting in all traffic being denied. @@ -79416,7 +83064,7 @@ def __init__(self, """ Initialize a NetworkACLPrototypeNetworkACLByRules object. - :param VPCIdentity vpc: The VPC this network ACL is to be a part of. + :param VPCIdentity vpc: The VPC this network ACL will reside in. :param str name: (optional) The user-defined name for this network ACL. Names must be unique within the VPC the network ACL resides in. If unspecified, the name will be a hyphenated list of randomly-selected words. @@ -79498,7 +83146,7 @@ class NetworkACLPrototypeNetworkACLBySourceNetworkACL(NetworkACLPrototype): must be unique within the VPC the network ACL resides in. If unspecified, the name will be a hyphenated list of randomly-selected words. :attr ResourceGroupIdentity resource_group: (optional) - :attr VPCIdentity vpc: The VPC this network ACL is to be a part of. + :attr VPCIdentity vpc: The VPC this network ACL will reside in. :attr NetworkACLIdentity source_network_acl: Network ACL to copy rules from. """ @@ -79511,7 +83159,7 @@ def __init__(self, """ Initialize a NetworkACLPrototypeNetworkACLBySourceNetworkACL object. - :param VPCIdentity vpc: The VPC this network ACL is to be a part of. + :param VPCIdentity vpc: The VPC this network ACL will reside in. :param NetworkACLIdentity source_network_acl: Network ACL to copy rules from. :param str name: (optional) The user-defined name for this network ACL. @@ -79820,23 +83468,20 @@ class NetworkACLRuleItemNetworkACLRuleProtocolAll(NetworkACLRuleItem): """ NetworkACLRuleItemNetworkACLRuleProtocolAll. - :attr str action: Whether to allow or deny matching traffic. + :attr str action: The action to perform for a packet matching the rule. :attr NetworkACLRuleReference before: (optional) The rule that this rule is immediately before. In a rule collection, this always refers to the next item in the collection. If absent, this is the last rule. :attr datetime created_at: The date and time that the rule was created. - :attr str destination: The destination CIDR block. The CIDR block `0.0.0.0/0` - applies to all addresses. - :attr str direction: Whether the traffic to be matched is `inbound` or - `outbound`. + :attr str destination: The destination IP address or CIDR block to match. The + CIDR block `0.0.0.0/0` matches all destination addresses. + :attr str direction: The direction of traffic to match. :attr str href: The URL for this network ACL rule. :attr str id: The unique identifier for this network ACL rule. :attr str ip_version: The IP version for this rule. - :attr str name: The user-defined name for this rule. Names must be unique within - the network ACL the rule resides in. If unspecified, the name will be a - hyphenated list of randomly-selected words. - :attr str source: The source CIDR block. The CIDR block `0.0.0.0/0` applies to - all addresses. + :attr str name: The user-defined name for this network ACL rule. + :attr str source: The source IP address or CIDR block to match. The CIDR block + `0.0.0.0/0` matches all source addresses. :attr str protocol: The protocol to enforce. """ @@ -79856,20 +83501,17 @@ def __init__(self, """ Initialize a NetworkACLRuleItemNetworkACLRuleProtocolAll object. - :param str action: Whether to allow or deny matching traffic. + :param str action: The action to perform for a packet matching the rule. :param datetime created_at: The date and time that the rule was created. - :param str destination: The destination CIDR block. The CIDR block - `0.0.0.0/0` applies to all addresses. - :param str direction: Whether the traffic to be matched is `inbound` or - `outbound`. + :param str destination: The destination IP address or CIDR block to match. + The CIDR block `0.0.0.0/0` matches all destination addresses. + :param str direction: The direction of traffic to match. :param str href: The URL for this network ACL rule. :param str id: The unique identifier for this network ACL rule. :param str ip_version: The IP version for this rule. - :param str name: The user-defined name for this rule. Names must be unique - within the network ACL the rule resides in. If unspecified, the name will - be a hyphenated list of randomly-selected words. - :param str source: The source CIDR block. The CIDR block `0.0.0.0/0` - applies to all addresses. + :param str name: The user-defined name for this network ACL rule. + :param str source: The source IP address or CIDR block to match. The CIDR + block `0.0.0.0/0` matches all source addresses. :param str protocol: The protocol to enforce. :param NetworkACLRuleReference before: (optional) The rule that this rule is immediately before. In a rule collection, this always refers to the next @@ -79988,7 +83630,7 @@ def __ne__(self, other: 'NetworkACLRuleItemNetworkACLRuleProtocolAll') -> bool: class ActionEnum(str, Enum): """ - Whether to allow or deny matching traffic. + The action to perform for a packet matching the rule. """ ALLOW = 'allow' DENY = 'deny' @@ -79996,7 +83638,7 @@ class ActionEnum(str, Enum): class DirectionEnum(str, Enum): """ - Whether the traffic to be matched is `inbound` or `outbound`. + The direction of traffic to match. """ INBOUND = 'inbound' OUTBOUND = 'outbound' @@ -80007,7 +83649,6 @@ class IpVersionEnum(str, Enum): The IP version for this rule. """ IPV4 = 'ipv4' - IPV6 = 'ipv6' class ProtocolEnum(str, Enum): @@ -80021,28 +83662,25 @@ class NetworkACLRuleItemNetworkACLRuleProtocolICMP(NetworkACLRuleItem): """ NetworkACLRuleItemNetworkACLRuleProtocolICMP. - :attr str action: Whether to allow or deny matching traffic. + :attr str action: The action to perform for a packet matching the rule. :attr NetworkACLRuleReference before: (optional) The rule that this rule is immediately before. In a rule collection, this always refers to the next item in the collection. If absent, this is the last rule. :attr datetime created_at: The date and time that the rule was created. - :attr str destination: The destination CIDR block. The CIDR block `0.0.0.0/0` - applies to all addresses. - :attr str direction: Whether the traffic to be matched is `inbound` or - `outbound`. + :attr str destination: The destination IP address or CIDR block to match. The + CIDR block `0.0.0.0/0` matches all destination addresses. + :attr str direction: The direction of traffic to match. :attr str href: The URL for this network ACL rule. :attr str id: The unique identifier for this network ACL rule. :attr str ip_version: The IP version for this rule. - :attr str name: The user-defined name for this rule. Names must be unique within - the network ACL the rule resides in. If unspecified, the name will be a - hyphenated list of randomly-selected words. - :attr str source: The source CIDR block. The CIDR block `0.0.0.0/0` applies to - all addresses. - :attr int code: (optional) The ICMP traffic code to allow. If unspecified, all - codes are allowed. This can only be specified if type is also specified. + :attr str name: The user-defined name for this network ACL rule. + :attr str source: The source IP address or CIDR block to match. The CIDR block + `0.0.0.0/0` matches all source addresses. + :attr int code: (optional) The ICMP traffic code to match. + If absent, all codes are matched. :attr str protocol: The protocol to enforce. - :attr int type: (optional) The ICMP traffic type to allow. If unspecified, all - types are allowed by this rule. + :attr int type: (optional) The ICMP traffic type to match. + If absent, all types are matched. """ def __init__(self, @@ -80063,29 +83701,25 @@ def __init__(self, """ Initialize a NetworkACLRuleItemNetworkACLRuleProtocolICMP object. - :param str action: Whether to allow or deny matching traffic. + :param str action: The action to perform for a packet matching the rule. :param datetime created_at: The date and time that the rule was created. - :param str destination: The destination CIDR block. The CIDR block - `0.0.0.0/0` applies to all addresses. - :param str direction: Whether the traffic to be matched is `inbound` or - `outbound`. + :param str destination: The destination IP address or CIDR block to match. + The CIDR block `0.0.0.0/0` matches all destination addresses. + :param str direction: The direction of traffic to match. :param str href: The URL for this network ACL rule. :param str id: The unique identifier for this network ACL rule. :param str ip_version: The IP version for this rule. - :param str name: The user-defined name for this rule. Names must be unique - within the network ACL the rule resides in. If unspecified, the name will - be a hyphenated list of randomly-selected words. - :param str source: The source CIDR block. The CIDR block `0.0.0.0/0` - applies to all addresses. + :param str name: The user-defined name for this network ACL rule. + :param str source: The source IP address or CIDR block to match. The CIDR + block `0.0.0.0/0` matches all source addresses. :param str protocol: The protocol to enforce. :param NetworkACLRuleReference before: (optional) The rule that this rule is immediately before. In a rule collection, this always refers to the next item in the collection. If absent, this is the last rule. - :param int code: (optional) The ICMP traffic code to allow. If unspecified, - all codes are allowed. This can only be specified if type is also - specified. - :param int type: (optional) The ICMP traffic type to allow. If unspecified, - all types are allowed by this rule. + :param int code: (optional) The ICMP traffic code to match. + If absent, all codes are matched. + :param int type: (optional) The ICMP traffic type to match. + If absent, all types are matched. """ # pylint: disable=super-init-not-called self.action = action @@ -80210,7 +83844,7 @@ def __ne__(self, other: 'NetworkACLRuleItemNetworkACLRuleProtocolICMP') -> bool: class ActionEnum(str, Enum): """ - Whether to allow or deny matching traffic. + The action to perform for a packet matching the rule. """ ALLOW = 'allow' DENY = 'deny' @@ -80218,7 +83852,7 @@ class ActionEnum(str, Enum): class DirectionEnum(str, Enum): """ - Whether the traffic to be matched is `inbound` or `outbound`. + The direction of traffic to match. """ INBOUND = 'inbound' OUTBOUND = 'outbound' @@ -80229,7 +83863,6 @@ class IpVersionEnum(str, Enum): The IP version for this rule. """ IPV4 = 'ipv4' - IPV6 = 'ipv6' class ProtocolEnum(str, Enum): @@ -80243,32 +83876,29 @@ class NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP(NetworkACLRuleItem): """ NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP. - :attr str action: Whether to allow or deny matching traffic. + :attr str action: The action to perform for a packet matching the rule. :attr NetworkACLRuleReference before: (optional) The rule that this rule is immediately before. In a rule collection, this always refers to the next item in the collection. If absent, this is the last rule. :attr datetime created_at: The date and time that the rule was created. - :attr str destination: The destination CIDR block. The CIDR block `0.0.0.0/0` - applies to all addresses. - :attr str direction: Whether the traffic to be matched is `inbound` or - `outbound`. + :attr str destination: The destination IP address or CIDR block to match. The + CIDR block `0.0.0.0/0` matches all destination addresses. + :attr str direction: The direction of traffic to match. :attr str href: The URL for this network ACL rule. :attr str id: The unique identifier for this network ACL rule. :attr str ip_version: The IP version for this rule. - :attr str name: The user-defined name for this rule. Names must be unique within - the network ACL the rule resides in. If unspecified, the name will be a - hyphenated list of randomly-selected words. - :attr str source: The source CIDR block. The CIDR block `0.0.0.0/0` applies to - all addresses. - :attr int destination_port_max: (optional) The inclusive upper bound of TCP/UDP - destination port range. - :attr int destination_port_min: (optional) The inclusive lower bound of TCP/UDP - destination port range. + :attr str name: The user-defined name for this network ACL rule. + :attr str source: The source IP address or CIDR block to match. The CIDR block + `0.0.0.0/0` matches all source addresses. + :attr int destination_port_max: The inclusive upper bound of TCP/UDP destination + port range. + :attr int destination_port_min: The inclusive lower bound of TCP/UDP destination + port range. :attr str protocol: The protocol to enforce. - :attr int source_port_max: (optional) The inclusive upper bound of TCP/UDP - source port range. - :attr int source_port_min: (optional) The inclusive lower bound of TCP/UDP - source port range. + :attr int source_port_max: The inclusive upper bound of TCP/UDP source port + range. + :attr int source_port_min: The inclusive lower bound of TCP/UDP source port + range. """ def __init__(self, @@ -80281,42 +83911,39 @@ def __init__(self, ip_version: str, name: str, source: str, + destination_port_max: int, + destination_port_min: int, protocol: str, + source_port_max: int, + source_port_min: int, *, - before: 'NetworkACLRuleReference' = None, - destination_port_max: int = None, - destination_port_min: int = None, - source_port_max: int = None, - source_port_min: int = None) -> None: + before: 'NetworkACLRuleReference' = None) -> None: """ Initialize a NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP object. - :param str action: Whether to allow or deny matching traffic. + :param str action: The action to perform for a packet matching the rule. :param datetime created_at: The date and time that the rule was created. - :param str destination: The destination CIDR block. The CIDR block - `0.0.0.0/0` applies to all addresses. - :param str direction: Whether the traffic to be matched is `inbound` or - `outbound`. + :param str destination: The destination IP address or CIDR block to match. + The CIDR block `0.0.0.0/0` matches all destination addresses. + :param str direction: The direction of traffic to match. :param str href: The URL for this network ACL rule. :param str id: The unique identifier for this network ACL rule. :param str ip_version: The IP version for this rule. - :param str name: The user-defined name for this rule. Names must be unique - within the network ACL the rule resides in. If unspecified, the name will - be a hyphenated list of randomly-selected words. - :param str source: The source CIDR block. The CIDR block `0.0.0.0/0` - applies to all addresses. + :param str name: The user-defined name for this network ACL rule. + :param str source: The source IP address or CIDR block to match. The CIDR + block `0.0.0.0/0` matches all source addresses. + :param int destination_port_max: The inclusive upper bound of TCP/UDP + destination port range. + :param int destination_port_min: The inclusive lower bound of TCP/UDP + destination port range. :param str protocol: The protocol to enforce. + :param int source_port_max: The inclusive upper bound of TCP/UDP source + port range. + :param int source_port_min: The inclusive lower bound of TCP/UDP source + port range. :param NetworkACLRuleReference before: (optional) The rule that this rule is immediately before. In a rule collection, this always refers to the next item in the collection. If absent, this is the last rule. - :param int destination_port_max: (optional) The inclusive upper bound of - TCP/UDP destination port range. - :param int destination_port_min: (optional) The inclusive lower bound of - TCP/UDP destination port range. - :param int source_port_max: (optional) The inclusive upper bound of TCP/UDP - source port range. - :param int source_port_min: (optional) The inclusive lower bound of TCP/UDP - source port range. """ # pylint: disable=super-init-not-called self.action = action @@ -80379,16 +84006,24 @@ def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleItemNetworkACLRuleProtocolTCPU raise ValueError('Required property \'source\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON') if 'destination_port_max' in _dict: args['destination_port_max'] = _dict.get('destination_port_max') + else: + raise ValueError('Required property \'destination_port_max\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON') if 'destination_port_min' in _dict: args['destination_port_min'] = _dict.get('destination_port_min') + else: + raise ValueError('Required property \'destination_port_min\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON') if 'protocol' in _dict: args['protocol'] = _dict.get('protocol') else: raise ValueError('Required property \'protocol\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON') if 'source_port_max' in _dict: args['source_port_max'] = _dict.get('source_port_max') + else: + raise ValueError('Required property \'source_port_max\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON') if 'source_port_min' in _dict: args['source_port_min'] = _dict.get('source_port_min') + else: + raise ValueError('Required property \'source_port_min\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON') return cls(**args) @classmethod @@ -80451,7 +84086,7 @@ def __ne__(self, other: 'NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP') -> boo class ActionEnum(str, Enum): """ - Whether to allow or deny matching traffic. + The action to perform for a packet matching the rule. """ ALLOW = 'allow' DENY = 'deny' @@ -80459,7 +84094,7 @@ class ActionEnum(str, Enum): class DirectionEnum(str, Enum): """ - Whether the traffic to be matched is `inbound` or `outbound`. + The direction of traffic to match. """ INBOUND = 'inbound' OUTBOUND = 'outbound' @@ -80470,7 +84105,6 @@ class IpVersionEnum(str, Enum): The IP version for this rule. """ IPV4 = 'ipv4' - IPV6 = 'ipv6' class ProtocolEnum(str, Enum): @@ -80481,20 +84115,19 @@ class ProtocolEnum(str, Enum): UDP = 'udp' -class NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAll(NetworkACLRulePrototypeNetworkACLContext): +class NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype(NetworkACLRulePrototypeNetworkACLContext): """ - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAll. + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype. - :attr str action: Whether to allow or deny matching traffic. - :attr str destination: The destination IP address or CIDR block. The CIDR block - `0.0.0.0/0` applies to all addresses. - :attr str direction: Whether the traffic to be matched is `inbound` or - `outbound`. + :attr str action: The action to perform for a packet matching the rule. + :attr str destination: The destination IP address or CIDR block to match. The + CIDR block `0.0.0.0/0` matches all destination addresses. + :attr str direction: The direction of traffic to match. :attr str name: (optional) The user-defined name for this rule. Names must be unique within the network ACL the rule resides in. If unspecified, the name will be a hyphenated list of randomly-selected words. - :attr str source: The source IP address or CIDR block. The CIDR block - `0.0.0.0/0` applies to all addresses. + :attr str source: The source IP address or CIDR block to match. The CIDR block + `0.0.0.0/0` matches all source addresses. :attr str protocol: The protocol to enforce. """ @@ -80507,15 +84140,14 @@ def __init__(self, *, name: str = None) -> None: """ - Initialize a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAll object. + Initialize a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype object. - :param str action: Whether to allow or deny matching traffic. - :param str destination: The destination IP address or CIDR block. The CIDR - block `0.0.0.0/0` applies to all addresses. - :param str direction: Whether the traffic to be matched is `inbound` or - `outbound`. - :param str source: The source IP address or CIDR block. The CIDR block - `0.0.0.0/0` applies to all addresses. + :param str action: The action to perform for a packet matching the rule. + :param str destination: The destination IP address or CIDR block to match. + The CIDR block `0.0.0.0/0` matches all destination addresses. + :param str direction: The direction of traffic to match. + :param str source: The source IP address or CIDR block to match. The CIDR + block `0.0.0.0/0` matches all source addresses. :param str protocol: The protocol to enforce. :param str name: (optional) The user-defined name for this rule. Names must be unique within the network ACL the rule resides in. If unspecified, the @@ -80530,36 +84162,36 @@ def __init__(self, self.protocol = protocol @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAll': - """Initialize a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAll object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype': + """Initialize a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype object from a json dictionary.""" args = {} if 'action' in _dict: args['action'] = _dict.get('action') else: - raise ValueError('Required property \'action\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAll JSON') + raise ValueError('Required property \'action\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype JSON') if 'destination' in _dict: args['destination'] = _dict.get('destination') else: - raise ValueError('Required property \'destination\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAll JSON') + raise ValueError('Required property \'destination\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype JSON') if 'direction' in _dict: args['direction'] = _dict.get('direction') else: - raise ValueError('Required property \'direction\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAll JSON') + raise ValueError('Required property \'direction\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype JSON') if 'name' in _dict: args['name'] = _dict.get('name') if 'source' in _dict: args['source'] = _dict.get('source') else: - raise ValueError('Required property \'source\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAll JSON') + raise ValueError('Required property \'source\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype JSON') if 'protocol' in _dict: args['protocol'] = _dict.get('protocol') else: - raise ValueError('Required property \'protocol\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAll JSON') + raise ValueError('Required property \'protocol\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAll object from a json dictionary.""" + """Initialize a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -80584,22 +84216,22 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAll object.""" + """Return a `str` version of this NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAll') -> bool: + def __eq__(self, other: 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAll') -> bool: + def __ne__(self, other: 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class ActionEnum(str, Enum): """ - Whether to allow or deny matching traffic. + The action to perform for a packet matching the rule. """ ALLOW = 'allow' DENY = 'deny' @@ -80607,7 +84239,7 @@ class ActionEnum(str, Enum): class DirectionEnum(str, Enum): """ - Whether the traffic to be matched is `inbound` or `outbound`. + The direction of traffic to match. """ INBOUND = 'inbound' OUTBOUND = 'outbound' @@ -80620,25 +84252,25 @@ class ProtocolEnum(str, Enum): ALL = 'all' -class NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMP(NetworkACLRulePrototypeNetworkACLContext): +class NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype(NetworkACLRulePrototypeNetworkACLContext): """ - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMP. + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype. - :attr str action: Whether to allow or deny matching traffic. - :attr str destination: The destination IP address or CIDR block. The CIDR block - `0.0.0.0/0` applies to all addresses. - :attr str direction: Whether the traffic to be matched is `inbound` or - `outbound`. + :attr str action: The action to perform for a packet matching the rule. + :attr str destination: The destination IP address or CIDR block to match. The + CIDR block `0.0.0.0/0` matches all destination addresses. + :attr str direction: The direction of traffic to match. :attr str name: (optional) The user-defined name for this rule. Names must be unique within the network ACL the rule resides in. If unspecified, the name will be a hyphenated list of randomly-selected words. - :attr str source: The source IP address or CIDR block. The CIDR block - `0.0.0.0/0` applies to all addresses. - :attr int code: (optional) The ICMP traffic code to allow. If unspecified, all - codes are allowed. This can only be specified if type is also specified. + :attr str source: The source IP address or CIDR block to match. The CIDR block + `0.0.0.0/0` matches all source addresses. + :attr int code: (optional) The ICMP traffic code to match. + If specified, `type` must also be specified. If unspecified, all codes are + matched. :attr str protocol: The protocol to enforce. - :attr int type: (optional) The ICMP traffic type to allow. If unspecified, all - types are allowed by this rule. + :attr int type: (optional) The ICMP traffic type to match. + If unspecified, all types are matched. """ def __init__(self, @@ -80652,24 +84284,23 @@ def __init__(self, code: int = None, type: int = None) -> None: """ - Initialize a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMP object. + Initialize a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype object. - :param str action: Whether to allow or deny matching traffic. - :param str destination: The destination IP address or CIDR block. The CIDR - block `0.0.0.0/0` applies to all addresses. - :param str direction: Whether the traffic to be matched is `inbound` or - `outbound`. - :param str source: The source IP address or CIDR block. The CIDR block - `0.0.0.0/0` applies to all addresses. + :param str action: The action to perform for a packet matching the rule. + :param str destination: The destination IP address or CIDR block to match. + The CIDR block `0.0.0.0/0` matches all destination addresses. + :param str direction: The direction of traffic to match. + :param str source: The source IP address or CIDR block to match. The CIDR + block `0.0.0.0/0` matches all source addresses. :param str protocol: The protocol to enforce. :param str name: (optional) The user-defined name for this rule. Names must be unique within the network ACL the rule resides in. If unspecified, the name will be a hyphenated list of randomly-selected words. - :param int code: (optional) The ICMP traffic code to allow. If unspecified, - all codes are allowed. This can only be specified if type is also - specified. - :param int type: (optional) The ICMP traffic type to allow. If unspecified, - all types are allowed by this rule. + :param int code: (optional) The ICMP traffic code to match. + If specified, `type` must also be specified. If unspecified, all codes are + matched. + :param int type: (optional) The ICMP traffic type to match. + If unspecified, all types are matched. """ # pylint: disable=super-init-not-called self.action = action @@ -80682,40 +84313,40 @@ def __init__(self, self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMP': - """Initialize a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMP object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype': + """Initialize a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype object from a json dictionary.""" args = {} if 'action' in _dict: args['action'] = _dict.get('action') else: - raise ValueError('Required property \'action\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMP JSON') + raise ValueError('Required property \'action\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype JSON') if 'destination' in _dict: args['destination'] = _dict.get('destination') else: - raise ValueError('Required property \'destination\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMP JSON') + raise ValueError('Required property \'destination\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype JSON') if 'direction' in _dict: args['direction'] = _dict.get('direction') else: - raise ValueError('Required property \'direction\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMP JSON') + raise ValueError('Required property \'direction\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype JSON') if 'name' in _dict: args['name'] = _dict.get('name') if 'source' in _dict: args['source'] = _dict.get('source') else: - raise ValueError('Required property \'source\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMP JSON') + raise ValueError('Required property \'source\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype JSON') if 'code' in _dict: args['code'] = _dict.get('code') if 'protocol' in _dict: args['protocol'] = _dict.get('protocol') else: - raise ValueError('Required property \'protocol\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMP JSON') + raise ValueError('Required property \'protocol\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype JSON') if 'type' in _dict: args['type'] = _dict.get('type') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMP object from a json dictionary.""" + """Initialize a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -80744,22 +84375,22 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMP object.""" + """Return a `str` version of this NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMP') -> bool: + def __eq__(self, other: 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMP') -> bool: + def __ne__(self, other: 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class ActionEnum(str, Enum): """ - Whether to allow or deny matching traffic. + The action to perform for a packet matching the rule. """ ALLOW = 'allow' DENY = 'deny' @@ -80767,7 +84398,7 @@ class ActionEnum(str, Enum): class DirectionEnum(str, Enum): """ - Whether the traffic to be matched is `inbound` or `outbound`. + The direction of traffic to match. """ INBOUND = 'inbound' OUTBOUND = 'outbound' @@ -80780,20 +84411,19 @@ class ProtocolEnum(str, Enum): ICMP = 'icmp' -class NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP(NetworkACLRulePrototypeNetworkACLContext): +class NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype(NetworkACLRulePrototypeNetworkACLContext): """ - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP. + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype. - :attr str action: Whether to allow or deny matching traffic. - :attr str destination: The destination IP address or CIDR block. The CIDR block - `0.0.0.0/0` applies to all addresses. - :attr str direction: Whether the traffic to be matched is `inbound` or - `outbound`. + :attr str action: The action to perform for a packet matching the rule. + :attr str destination: The destination IP address or CIDR block to match. The + CIDR block `0.0.0.0/0` matches all destination addresses. + :attr str direction: The direction of traffic to match. :attr str name: (optional) The user-defined name for this rule. Names must be unique within the network ACL the rule resides in. If unspecified, the name will be a hyphenated list of randomly-selected words. - :attr str source: The source IP address or CIDR block. The CIDR block - `0.0.0.0/0` applies to all addresses. + :attr str source: The source IP address or CIDR block to match. The CIDR block + `0.0.0.0/0` matches all source addresses. :attr int destination_port_max: (optional) The inclusive upper bound of TCP/UDP destination port range. :attr int destination_port_min: (optional) The inclusive lower bound of TCP/UDP @@ -80818,15 +84448,14 @@ def __init__(self, source_port_max: int = None, source_port_min: int = None) -> None: """ - Initialize a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP object. + Initialize a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype object. - :param str action: Whether to allow or deny matching traffic. - :param str destination: The destination IP address or CIDR block. The CIDR - block `0.0.0.0/0` applies to all addresses. - :param str direction: Whether the traffic to be matched is `inbound` or - `outbound`. - :param str source: The source IP address or CIDR block. The CIDR block - `0.0.0.0/0` applies to all addresses. + :param str action: The action to perform for a packet matching the rule. + :param str destination: The destination IP address or CIDR block to match. + The CIDR block `0.0.0.0/0` matches all destination addresses. + :param str direction: The direction of traffic to match. + :param str source: The source IP address or CIDR block to match. The CIDR + block `0.0.0.0/0` matches all source addresses. :param str protocol: The protocol to enforce. :param str name: (optional) The user-defined name for this rule. Names must be unique within the network ACL the rule resides in. If unspecified, the @@ -80853,27 +84482,27 @@ def __init__(self, self.source_port_min = source_port_min @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP': - """Initialize a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype': + """Initialize a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype object from a json dictionary.""" args = {} if 'action' in _dict: args['action'] = _dict.get('action') else: - raise ValueError('Required property \'action\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP JSON') + raise ValueError('Required property \'action\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype JSON') if 'destination' in _dict: args['destination'] = _dict.get('destination') else: - raise ValueError('Required property \'destination\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP JSON') + raise ValueError('Required property \'destination\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype JSON') if 'direction' in _dict: args['direction'] = _dict.get('direction') else: - raise ValueError('Required property \'direction\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP JSON') + raise ValueError('Required property \'direction\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype JSON') if 'name' in _dict: args['name'] = _dict.get('name') if 'source' in _dict: args['source'] = _dict.get('source') else: - raise ValueError('Required property \'source\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP JSON') + raise ValueError('Required property \'source\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype JSON') if 'destination_port_max' in _dict: args['destination_port_max'] = _dict.get('destination_port_max') if 'destination_port_min' in _dict: @@ -80881,7 +84510,7 @@ def from_dict(cls, _dict: Dict) -> 'NetworkACLRulePrototypeNetworkACLContextNetw if 'protocol' in _dict: args['protocol'] = _dict.get('protocol') else: - raise ValueError('Required property \'protocol\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP JSON') + raise ValueError('Required property \'protocol\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype JSON') if 'source_port_max' in _dict: args['source_port_max'] = _dict.get('source_port_max') if 'source_port_min' in _dict: @@ -80890,7 +84519,7 @@ def from_dict(cls, _dict: Dict) -> 'NetworkACLRulePrototypeNetworkACLContextNetw @classmethod def _from_dict(cls, _dict): - """Initialize a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP object from a json dictionary.""" + """Initialize a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -80923,22 +84552,22 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP object.""" + """Return a `str` version of this NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP') -> bool: + def __eq__(self, other: 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP') -> bool: + def __ne__(self, other: 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class ActionEnum(str, Enum): """ - Whether to allow or deny matching traffic. + The action to perform for a packet matching the rule. """ ALLOW = 'allow' DENY = 'deny' @@ -80946,7 +84575,7 @@ class ActionEnum(str, Enum): class DirectionEnum(str, Enum): """ - Whether the traffic to be matched is `inbound` or `outbound`. + The direction of traffic to match. """ INBOUND = 'inbound' OUTBOUND = 'outbound' @@ -80960,21 +84589,20 @@ class ProtocolEnum(str, Enum): UDP = 'udp' -class NetworkACLRulePrototypeNetworkACLRuleProtocolAll(NetworkACLRulePrototype): +class NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype(NetworkACLRulePrototype): """ - NetworkACLRulePrototypeNetworkACLRuleProtocolAll. + NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype. - :attr str action: Whether to allow or deny matching traffic. + :attr str action: The action to perform for a packet matching the rule. :attr NetworkACLRuleBeforePrototype before: (optional) - :attr str destination: The destination IP address or CIDR block. The CIDR block - `0.0.0.0/0` applies to all addresses. - :attr str direction: Whether the traffic to be matched is `inbound` or - `outbound`. + :attr str destination: The destination IP address or CIDR block to match. The + CIDR block `0.0.0.0/0` matches all destination addresses. + :attr str direction: The direction of traffic to match. :attr str name: (optional) The user-defined name for this rule. Names must be unique within the network ACL the rule resides in. If unspecified, the name will be a hyphenated list of randomly-selected words. - :attr str source: The source IP address or CIDR block. The CIDR block - `0.0.0.0/0` applies to all addresses. + :attr str source: The source IP address or CIDR block to match. The CIDR block + `0.0.0.0/0` matches all source addresses. :attr str protocol: The protocol to enforce. """ @@ -80988,15 +84616,14 @@ def __init__(self, before: 'NetworkACLRuleBeforePrototype' = None, name: str = None) -> None: """ - Initialize a NetworkACLRulePrototypeNetworkACLRuleProtocolAll object. + Initialize a NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype object. - :param str action: Whether to allow or deny matching traffic. - :param str destination: The destination IP address or CIDR block. The CIDR - block `0.0.0.0/0` applies to all addresses. - :param str direction: Whether the traffic to be matched is `inbound` or - `outbound`. - :param str source: The source IP address or CIDR block. The CIDR block - `0.0.0.0/0` applies to all addresses. + :param str action: The action to perform for a packet matching the rule. + :param str destination: The destination IP address or CIDR block to match. + The CIDR block `0.0.0.0/0` matches all destination addresses. + :param str direction: The direction of traffic to match. + :param str source: The source IP address or CIDR block to match. The CIDR + block `0.0.0.0/0` matches all source addresses. :param str protocol: The protocol to enforce. :param NetworkACLRuleBeforePrototype before: (optional) :param str name: (optional) The user-defined name for this rule. Names must @@ -81013,38 +84640,38 @@ def __init__(self, self.protocol = protocol @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkACLRulePrototypeNetworkACLRuleProtocolAll': - """Initialize a NetworkACLRulePrototypeNetworkACLRuleProtocolAll object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype': + """Initialize a NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype object from a json dictionary.""" args = {} if 'action' in _dict: args['action'] = _dict.get('action') else: - raise ValueError('Required property \'action\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolAll JSON') + raise ValueError('Required property \'action\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype JSON') if 'before' in _dict: args['before'] = _dict.get('before') if 'destination' in _dict: args['destination'] = _dict.get('destination') else: - raise ValueError('Required property \'destination\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolAll JSON') + raise ValueError('Required property \'destination\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype JSON') if 'direction' in _dict: args['direction'] = _dict.get('direction') else: - raise ValueError('Required property \'direction\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolAll JSON') + raise ValueError('Required property \'direction\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype JSON') if 'name' in _dict: args['name'] = _dict.get('name') if 'source' in _dict: args['source'] = _dict.get('source') else: - raise ValueError('Required property \'source\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolAll JSON') + raise ValueError('Required property \'source\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype JSON') if 'protocol' in _dict: args['protocol'] = _dict.get('protocol') else: - raise ValueError('Required property \'protocol\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolAll JSON') + raise ValueError('Required property \'protocol\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a NetworkACLRulePrototypeNetworkACLRuleProtocolAll object from a json dictionary.""" + """Initialize a NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -81074,22 +84701,22 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this NetworkACLRulePrototypeNetworkACLRuleProtocolAll object.""" + """Return a `str` version of this NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'NetworkACLRulePrototypeNetworkACLRuleProtocolAll') -> bool: + def __eq__(self, other: 'NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'NetworkACLRulePrototypeNetworkACLRuleProtocolAll') -> bool: + def __ne__(self, other: 'NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class ActionEnum(str, Enum): """ - Whether to allow or deny matching traffic. + The action to perform for a packet matching the rule. """ ALLOW = 'allow' DENY = 'deny' @@ -81097,7 +84724,7 @@ class ActionEnum(str, Enum): class DirectionEnum(str, Enum): """ - Whether the traffic to be matched is `inbound` or `outbound`. + The direction of traffic to match. """ INBOUND = 'inbound' OUTBOUND = 'outbound' @@ -81110,26 +84737,26 @@ class ProtocolEnum(str, Enum): ALL = 'all' -class NetworkACLRulePrototypeNetworkACLRuleProtocolICMP(NetworkACLRulePrototype): +class NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype(NetworkACLRulePrototype): """ - NetworkACLRulePrototypeNetworkACLRuleProtocolICMP. + NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype. - :attr str action: Whether to allow or deny matching traffic. + :attr str action: The action to perform for a packet matching the rule. :attr NetworkACLRuleBeforePrototype before: (optional) - :attr str destination: The destination IP address or CIDR block. The CIDR block - `0.0.0.0/0` applies to all addresses. - :attr str direction: Whether the traffic to be matched is `inbound` or - `outbound`. + :attr str destination: The destination IP address or CIDR block to match. The + CIDR block `0.0.0.0/0` matches all destination addresses. + :attr str direction: The direction of traffic to match. :attr str name: (optional) The user-defined name for this rule. Names must be unique within the network ACL the rule resides in. If unspecified, the name will be a hyphenated list of randomly-selected words. - :attr str source: The source IP address or CIDR block. The CIDR block - `0.0.0.0/0` applies to all addresses. - :attr int code: (optional) The ICMP traffic code to allow. If unspecified, all - codes are allowed. This can only be specified if type is also specified. + :attr str source: The source IP address or CIDR block to match. The CIDR block + `0.0.0.0/0` matches all source addresses. + :attr int code: (optional) The ICMP traffic code to match. + If specified, `type` must also be specified. If unspecified, all codes are + matched. :attr str protocol: The protocol to enforce. - :attr int type: (optional) The ICMP traffic type to allow. If unspecified, all - types are allowed by this rule. + :attr int type: (optional) The ICMP traffic type to match. + If unspecified, all types are matched. """ def __init__(self, @@ -81144,25 +84771,24 @@ def __init__(self, code: int = None, type: int = None) -> None: """ - Initialize a NetworkACLRulePrototypeNetworkACLRuleProtocolICMP object. + Initialize a NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype object. - :param str action: Whether to allow or deny matching traffic. - :param str destination: The destination IP address or CIDR block. The CIDR - block `0.0.0.0/0` applies to all addresses. - :param str direction: Whether the traffic to be matched is `inbound` or - `outbound`. - :param str source: The source IP address or CIDR block. The CIDR block - `0.0.0.0/0` applies to all addresses. + :param str action: The action to perform for a packet matching the rule. + :param str destination: The destination IP address or CIDR block to match. + The CIDR block `0.0.0.0/0` matches all destination addresses. + :param str direction: The direction of traffic to match. + :param str source: The source IP address or CIDR block to match. The CIDR + block `0.0.0.0/0` matches all source addresses. :param str protocol: The protocol to enforce. :param NetworkACLRuleBeforePrototype before: (optional) :param str name: (optional) The user-defined name for this rule. Names must be unique within the network ACL the rule resides in. If unspecified, the name will be a hyphenated list of randomly-selected words. - :param int code: (optional) The ICMP traffic code to allow. If unspecified, - all codes are allowed. This can only be specified if type is also - specified. - :param int type: (optional) The ICMP traffic type to allow. If unspecified, - all types are allowed by this rule. + :param int code: (optional) The ICMP traffic code to match. + If specified, `type` must also be specified. If unspecified, all codes are + matched. + :param int type: (optional) The ICMP traffic type to match. + If unspecified, all types are matched. """ # pylint: disable=super-init-not-called self.action = action @@ -81176,42 +84802,42 @@ def __init__(self, self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkACLRulePrototypeNetworkACLRuleProtocolICMP': - """Initialize a NetworkACLRulePrototypeNetworkACLRuleProtocolICMP object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype': + """Initialize a NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype object from a json dictionary.""" args = {} if 'action' in _dict: args['action'] = _dict.get('action') else: - raise ValueError('Required property \'action\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolICMP JSON') + raise ValueError('Required property \'action\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype JSON') if 'before' in _dict: args['before'] = _dict.get('before') if 'destination' in _dict: args['destination'] = _dict.get('destination') else: - raise ValueError('Required property \'destination\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolICMP JSON') + raise ValueError('Required property \'destination\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype JSON') if 'direction' in _dict: args['direction'] = _dict.get('direction') else: - raise ValueError('Required property \'direction\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolICMP JSON') + raise ValueError('Required property \'direction\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype JSON') if 'name' in _dict: args['name'] = _dict.get('name') if 'source' in _dict: args['source'] = _dict.get('source') else: - raise ValueError('Required property \'source\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolICMP JSON') + raise ValueError('Required property \'source\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype JSON') if 'code' in _dict: args['code'] = _dict.get('code') if 'protocol' in _dict: args['protocol'] = _dict.get('protocol') else: - raise ValueError('Required property \'protocol\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolICMP JSON') + raise ValueError('Required property \'protocol\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype JSON') if 'type' in _dict: args['type'] = _dict.get('type') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a NetworkACLRulePrototypeNetworkACLRuleProtocolICMP object from a json dictionary.""" + """Initialize a NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -81245,22 +84871,22 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this NetworkACLRulePrototypeNetworkACLRuleProtocolICMP object.""" + """Return a `str` version of this NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'NetworkACLRulePrototypeNetworkACLRuleProtocolICMP') -> bool: + def __eq__(self, other: 'NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'NetworkACLRulePrototypeNetworkACLRuleProtocolICMP') -> bool: + def __ne__(self, other: 'NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class ActionEnum(str, Enum): """ - Whether to allow or deny matching traffic. + The action to perform for a packet matching the rule. """ ALLOW = 'allow' DENY = 'deny' @@ -81268,7 +84894,7 @@ class ActionEnum(str, Enum): class DirectionEnum(str, Enum): """ - Whether the traffic to be matched is `inbound` or `outbound`. + The direction of traffic to match. """ INBOUND = 'inbound' OUTBOUND = 'outbound' @@ -81281,21 +84907,20 @@ class ProtocolEnum(str, Enum): ICMP = 'icmp' -class NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDP(NetworkACLRulePrototype): +class NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype(NetworkACLRulePrototype): """ - NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDP. + NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype. - :attr str action: Whether to allow or deny matching traffic. + :attr str action: The action to perform for a packet matching the rule. :attr NetworkACLRuleBeforePrototype before: (optional) - :attr str destination: The destination IP address or CIDR block. The CIDR block - `0.0.0.0/0` applies to all addresses. - :attr str direction: Whether the traffic to be matched is `inbound` or - `outbound`. + :attr str destination: The destination IP address or CIDR block to match. The + CIDR block `0.0.0.0/0` matches all destination addresses. + :attr str direction: The direction of traffic to match. :attr str name: (optional) The user-defined name for this rule. Names must be unique within the network ACL the rule resides in. If unspecified, the name will be a hyphenated list of randomly-selected words. - :attr str source: The source IP address or CIDR block. The CIDR block - `0.0.0.0/0` applies to all addresses. + :attr str source: The source IP address or CIDR block to match. The CIDR block + `0.0.0.0/0` matches all source addresses. :attr int destination_port_max: (optional) The inclusive upper bound of TCP/UDP destination port range. :attr int destination_port_min: (optional) The inclusive lower bound of TCP/UDP @@ -81321,15 +84946,14 @@ def __init__(self, source_port_max: int = None, source_port_min: int = None) -> None: """ - Initialize a NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDP object. + Initialize a NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype object. - :param str action: Whether to allow or deny matching traffic. - :param str destination: The destination IP address or CIDR block. The CIDR - block `0.0.0.0/0` applies to all addresses. - :param str direction: Whether the traffic to be matched is `inbound` or - `outbound`. - :param str source: The source IP address or CIDR block. The CIDR block - `0.0.0.0/0` applies to all addresses. + :param str action: The action to perform for a packet matching the rule. + :param str destination: The destination IP address or CIDR block to match. + The CIDR block `0.0.0.0/0` matches all destination addresses. + :param str direction: The direction of traffic to match. + :param str source: The source IP address or CIDR block to match. The CIDR + block `0.0.0.0/0` matches all source addresses. :param str protocol: The protocol to enforce. :param NetworkACLRuleBeforePrototype before: (optional) :param str name: (optional) The user-defined name for this rule. Names must @@ -81358,29 +84982,29 @@ def __init__(self, self.source_port_min = source_port_min @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDP': - """Initialize a NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDP object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype': + """Initialize a NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype object from a json dictionary.""" args = {} if 'action' in _dict: args['action'] = _dict.get('action') else: - raise ValueError('Required property \'action\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDP JSON') + raise ValueError('Required property \'action\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype JSON') if 'before' in _dict: args['before'] = _dict.get('before') if 'destination' in _dict: args['destination'] = _dict.get('destination') else: - raise ValueError('Required property \'destination\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDP JSON') + raise ValueError('Required property \'destination\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype JSON') if 'direction' in _dict: args['direction'] = _dict.get('direction') else: - raise ValueError('Required property \'direction\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDP JSON') + raise ValueError('Required property \'direction\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype JSON') if 'name' in _dict: args['name'] = _dict.get('name') if 'source' in _dict: args['source'] = _dict.get('source') else: - raise ValueError('Required property \'source\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDP JSON') + raise ValueError('Required property \'source\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype JSON') if 'destination_port_max' in _dict: args['destination_port_max'] = _dict.get('destination_port_max') if 'destination_port_min' in _dict: @@ -81388,7 +85012,7 @@ def from_dict(cls, _dict: Dict) -> 'NetworkACLRulePrototypeNetworkACLRuleProtoco if 'protocol' in _dict: args['protocol'] = _dict.get('protocol') else: - raise ValueError('Required property \'protocol\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDP JSON') + raise ValueError('Required property \'protocol\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype JSON') if 'source_port_max' in _dict: args['source_port_max'] = _dict.get('source_port_max') if 'source_port_min' in _dict: @@ -81397,7 +85021,7 @@ def from_dict(cls, _dict: Dict) -> 'NetworkACLRulePrototypeNetworkACLRuleProtoco @classmethod def _from_dict(cls, _dict): - """Initialize a NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDP object from a json dictionary.""" + """Initialize a NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -81435,22 +85059,22 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDP object.""" + """Return a `str` version of this NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDP') -> bool: + def __eq__(self, other: 'NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDP') -> bool: + def __ne__(self, other: 'NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class ActionEnum(str, Enum): """ - Whether to allow or deny matching traffic. + The action to perform for a packet matching the rule. """ ALLOW = 'allow' DENY = 'deny' @@ -81458,7 +85082,7 @@ class ActionEnum(str, Enum): class DirectionEnum(str, Enum): """ - Whether the traffic to be matched is `inbound` or `outbound`. + The direction of traffic to match. """ INBOUND = 'inbound' OUTBOUND = 'outbound' @@ -81476,22 +85100,19 @@ class NetworkACLRuleNetworkACLRuleProtocolAll(NetworkACLRule): """ NetworkACLRuleNetworkACLRuleProtocolAll. - :attr str action: Whether to allow or deny matching traffic. + :attr str action: The action to perform for a packet matching the rule. :attr NetworkACLRuleReference before: (optional) The rule that this rule is immediately before. If absent, this is the last rule. :attr datetime created_at: The date and time that the rule was created. - :attr str destination: The destination CIDR block. The CIDR block `0.0.0.0/0` - applies to all addresses. - :attr str direction: Whether the traffic to be matched is `inbound` or - `outbound`. + :attr str destination: The destination IP address or CIDR block to match. The + CIDR block `0.0.0.0/0` matches all destination addresses. + :attr str direction: The direction of traffic to match. :attr str href: The URL for this network ACL rule. :attr str id: The unique identifier for this network ACL rule. :attr str ip_version: The IP version for this rule. - :attr str name: The user-defined name for this rule. Names must be unique within - the network ACL the rule resides in. If unspecified, the name will be a - hyphenated list of randomly-selected words. - :attr str source: The source CIDR block. The CIDR block `0.0.0.0/0` applies to - all addresses. + :attr str name: The user-defined name for this network ACL rule. + :attr str source: The source IP address or CIDR block to match. The CIDR block + `0.0.0.0/0` matches all source addresses. :attr str protocol: The protocol to enforce. """ @@ -81511,20 +85132,17 @@ def __init__(self, """ Initialize a NetworkACLRuleNetworkACLRuleProtocolAll object. - :param str action: Whether to allow or deny matching traffic. + :param str action: The action to perform for a packet matching the rule. :param datetime created_at: The date and time that the rule was created. - :param str destination: The destination CIDR block. The CIDR block - `0.0.0.0/0` applies to all addresses. - :param str direction: Whether the traffic to be matched is `inbound` or - `outbound`. + :param str destination: The destination IP address or CIDR block to match. + The CIDR block `0.0.0.0/0` matches all destination addresses. + :param str direction: The direction of traffic to match. :param str href: The URL for this network ACL rule. :param str id: The unique identifier for this network ACL rule. :param str ip_version: The IP version for this rule. - :param str name: The user-defined name for this rule. Names must be unique - within the network ACL the rule resides in. If unspecified, the name will - be a hyphenated list of randomly-selected words. - :param str source: The source CIDR block. The CIDR block `0.0.0.0/0` - applies to all addresses. + :param str name: The user-defined name for this network ACL rule. + :param str source: The source IP address or CIDR block to match. The CIDR + block `0.0.0.0/0` matches all source addresses. :param str protocol: The protocol to enforce. :param NetworkACLRuleReference before: (optional) The rule that this rule is immediately before. If absent, this is the last rule. @@ -81642,7 +85260,7 @@ def __ne__(self, other: 'NetworkACLRuleNetworkACLRuleProtocolAll') -> bool: class ActionEnum(str, Enum): """ - Whether to allow or deny matching traffic. + The action to perform for a packet matching the rule. """ ALLOW = 'allow' DENY = 'deny' @@ -81650,7 +85268,7 @@ class ActionEnum(str, Enum): class DirectionEnum(str, Enum): """ - Whether the traffic to be matched is `inbound` or `outbound`. + The direction of traffic to match. """ INBOUND = 'inbound' OUTBOUND = 'outbound' @@ -81661,7 +85279,6 @@ class IpVersionEnum(str, Enum): The IP version for this rule. """ IPV4 = 'ipv4' - IPV6 = 'ipv6' class ProtocolEnum(str, Enum): @@ -81675,27 +85292,24 @@ class NetworkACLRuleNetworkACLRuleProtocolICMP(NetworkACLRule): """ NetworkACLRuleNetworkACLRuleProtocolICMP. - :attr str action: Whether to allow or deny matching traffic. + :attr str action: The action to perform for a packet matching the rule. :attr NetworkACLRuleReference before: (optional) The rule that this rule is immediately before. If absent, this is the last rule. :attr datetime created_at: The date and time that the rule was created. - :attr str destination: The destination CIDR block. The CIDR block `0.0.0.0/0` - applies to all addresses. - :attr str direction: Whether the traffic to be matched is `inbound` or - `outbound`. + :attr str destination: The destination IP address or CIDR block to match. The + CIDR block `0.0.0.0/0` matches all destination addresses. + :attr str direction: The direction of traffic to match. :attr str href: The URL for this network ACL rule. :attr str id: The unique identifier for this network ACL rule. :attr str ip_version: The IP version for this rule. - :attr str name: The user-defined name for this rule. Names must be unique within - the network ACL the rule resides in. If unspecified, the name will be a - hyphenated list of randomly-selected words. - :attr str source: The source CIDR block. The CIDR block `0.0.0.0/0` applies to - all addresses. - :attr int code: (optional) The ICMP traffic code to allow. If unspecified, all - codes are allowed. This can only be specified if type is also specified. + :attr str name: The user-defined name for this network ACL rule. + :attr str source: The source IP address or CIDR block to match. The CIDR block + `0.0.0.0/0` matches all source addresses. + :attr int code: (optional) The ICMP traffic code to match. + If absent, all codes are matched. :attr str protocol: The protocol to enforce. - :attr int type: (optional) The ICMP traffic type to allow. If unspecified, all - types are allowed by this rule. + :attr int type: (optional) The ICMP traffic type to match. + If absent, all types are matched. """ def __init__(self, @@ -81716,28 +85330,24 @@ def __init__(self, """ Initialize a NetworkACLRuleNetworkACLRuleProtocolICMP object. - :param str action: Whether to allow or deny matching traffic. + :param str action: The action to perform for a packet matching the rule. :param datetime created_at: The date and time that the rule was created. - :param str destination: The destination CIDR block. The CIDR block - `0.0.0.0/0` applies to all addresses. - :param str direction: Whether the traffic to be matched is `inbound` or - `outbound`. + :param str destination: The destination IP address or CIDR block to match. + The CIDR block `0.0.0.0/0` matches all destination addresses. + :param str direction: The direction of traffic to match. :param str href: The URL for this network ACL rule. :param str id: The unique identifier for this network ACL rule. :param str ip_version: The IP version for this rule. - :param str name: The user-defined name for this rule. Names must be unique - within the network ACL the rule resides in. If unspecified, the name will - be a hyphenated list of randomly-selected words. - :param str source: The source CIDR block. The CIDR block `0.0.0.0/0` - applies to all addresses. + :param str name: The user-defined name for this network ACL rule. + :param str source: The source IP address or CIDR block to match. The CIDR + block `0.0.0.0/0` matches all source addresses. :param str protocol: The protocol to enforce. :param NetworkACLRuleReference before: (optional) The rule that this rule is immediately before. If absent, this is the last rule. - :param int code: (optional) The ICMP traffic code to allow. If unspecified, - all codes are allowed. This can only be specified if type is also - specified. - :param int type: (optional) The ICMP traffic type to allow. If unspecified, - all types are allowed by this rule. + :param int code: (optional) The ICMP traffic code to match. + If absent, all codes are matched. + :param int type: (optional) The ICMP traffic type to match. + If absent, all types are matched. """ # pylint: disable=super-init-not-called self.action = action @@ -81862,7 +85472,7 @@ def __ne__(self, other: 'NetworkACLRuleNetworkACLRuleProtocolICMP') -> bool: class ActionEnum(str, Enum): """ - Whether to allow or deny matching traffic. + The action to perform for a packet matching the rule. """ ALLOW = 'allow' DENY = 'deny' @@ -81870,7 +85480,7 @@ class ActionEnum(str, Enum): class DirectionEnum(str, Enum): """ - Whether the traffic to be matched is `inbound` or `outbound`. + The direction of traffic to match. """ INBOUND = 'inbound' OUTBOUND = 'outbound' @@ -81881,7 +85491,6 @@ class IpVersionEnum(str, Enum): The IP version for this rule. """ IPV4 = 'ipv4' - IPV6 = 'ipv6' class ProtocolEnum(str, Enum): @@ -81895,31 +85504,28 @@ class NetworkACLRuleNetworkACLRuleProtocolTCPUDP(NetworkACLRule): """ NetworkACLRuleNetworkACLRuleProtocolTCPUDP. - :attr str action: Whether to allow or deny matching traffic. + :attr str action: The action to perform for a packet matching the rule. :attr NetworkACLRuleReference before: (optional) The rule that this rule is immediately before. If absent, this is the last rule. :attr datetime created_at: The date and time that the rule was created. - :attr str destination: The destination CIDR block. The CIDR block `0.0.0.0/0` - applies to all addresses. - :attr str direction: Whether the traffic to be matched is `inbound` or - `outbound`. + :attr str destination: The destination IP address or CIDR block to match. The + CIDR block `0.0.0.0/0` matches all destination addresses. + :attr str direction: The direction of traffic to match. :attr str href: The URL for this network ACL rule. :attr str id: The unique identifier for this network ACL rule. :attr str ip_version: The IP version for this rule. - :attr str name: The user-defined name for this rule. Names must be unique within - the network ACL the rule resides in. If unspecified, the name will be a - hyphenated list of randomly-selected words. - :attr str source: The source CIDR block. The CIDR block `0.0.0.0/0` applies to - all addresses. - :attr int destination_port_max: (optional) The inclusive upper bound of TCP/UDP - destination port range. - :attr int destination_port_min: (optional) The inclusive lower bound of TCP/UDP - destination port range. + :attr str name: The user-defined name for this network ACL rule. + :attr str source: The source IP address or CIDR block to match. The CIDR block + `0.0.0.0/0` matches all source addresses. + :attr int destination_port_max: The inclusive upper bound of TCP/UDP destination + port range. + :attr int destination_port_min: The inclusive lower bound of TCP/UDP destination + port range. :attr str protocol: The protocol to enforce. - :attr int source_port_max: (optional) The inclusive upper bound of TCP/UDP - source port range. - :attr int source_port_min: (optional) The inclusive lower bound of TCP/UDP - source port range. + :attr int source_port_max: The inclusive upper bound of TCP/UDP source port + range. + :attr int source_port_min: The inclusive lower bound of TCP/UDP source port + range. """ def __init__(self, @@ -81932,41 +85538,38 @@ def __init__(self, ip_version: str, name: str, source: str, + destination_port_max: int, + destination_port_min: int, protocol: str, + source_port_max: int, + source_port_min: int, *, - before: 'NetworkACLRuleReference' = None, - destination_port_max: int = None, - destination_port_min: int = None, - source_port_max: int = None, - source_port_min: int = None) -> None: + before: 'NetworkACLRuleReference' = None) -> None: """ Initialize a NetworkACLRuleNetworkACLRuleProtocolTCPUDP object. - :param str action: Whether to allow or deny matching traffic. + :param str action: The action to perform for a packet matching the rule. :param datetime created_at: The date and time that the rule was created. - :param str destination: The destination CIDR block. The CIDR block - `0.0.0.0/0` applies to all addresses. - :param str direction: Whether the traffic to be matched is `inbound` or - `outbound`. + :param str destination: The destination IP address or CIDR block to match. + The CIDR block `0.0.0.0/0` matches all destination addresses. + :param str direction: The direction of traffic to match. :param str href: The URL for this network ACL rule. :param str id: The unique identifier for this network ACL rule. :param str ip_version: The IP version for this rule. - :param str name: The user-defined name for this rule. Names must be unique - within the network ACL the rule resides in. If unspecified, the name will - be a hyphenated list of randomly-selected words. - :param str source: The source CIDR block. The CIDR block `0.0.0.0/0` - applies to all addresses. + :param str name: The user-defined name for this network ACL rule. + :param str source: The source IP address or CIDR block to match. The CIDR + block `0.0.0.0/0` matches all source addresses. + :param int destination_port_max: The inclusive upper bound of TCP/UDP + destination port range. + :param int destination_port_min: The inclusive lower bound of TCP/UDP + destination port range. :param str protocol: The protocol to enforce. + :param int source_port_max: The inclusive upper bound of TCP/UDP source + port range. + :param int source_port_min: The inclusive lower bound of TCP/UDP source + port range. :param NetworkACLRuleReference before: (optional) The rule that this rule is immediately before. If absent, this is the last rule. - :param int destination_port_max: (optional) The inclusive upper bound of - TCP/UDP destination port range. - :param int destination_port_min: (optional) The inclusive lower bound of - TCP/UDP destination port range. - :param int source_port_max: (optional) The inclusive upper bound of TCP/UDP - source port range. - :param int source_port_min: (optional) The inclusive lower bound of TCP/UDP - source port range. """ # pylint: disable=super-init-not-called self.action = action @@ -82029,16 +85632,24 @@ def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleNetworkACLRuleProtocolTCPUDP': raise ValueError('Required property \'source\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON') if 'destination_port_max' in _dict: args['destination_port_max'] = _dict.get('destination_port_max') + else: + raise ValueError('Required property \'destination_port_max\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON') if 'destination_port_min' in _dict: args['destination_port_min'] = _dict.get('destination_port_min') + else: + raise ValueError('Required property \'destination_port_min\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON') if 'protocol' in _dict: args['protocol'] = _dict.get('protocol') else: raise ValueError('Required property \'protocol\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON') if 'source_port_max' in _dict: args['source_port_max'] = _dict.get('source_port_max') + else: + raise ValueError('Required property \'source_port_max\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON') if 'source_port_min' in _dict: args['source_port_min'] = _dict.get('source_port_min') + else: + raise ValueError('Required property \'source_port_min\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON') return cls(**args) @classmethod @@ -82101,7 +85712,7 @@ def __ne__(self, other: 'NetworkACLRuleNetworkACLRuleProtocolTCPUDP') -> bool: class ActionEnum(str, Enum): """ - Whether to allow or deny matching traffic. + The action to perform for a packet matching the rule. """ ALLOW = 'allow' DENY = 'deny' @@ -82109,7 +85720,7 @@ class ActionEnum(str, Enum): class DirectionEnum(str, Enum): """ - Whether the traffic to be matched is `inbound` or `outbound`. + The direction of traffic to match. """ INBOUND = 'inbound' OUTBOUND = 'outbound' @@ -82120,7 +85731,6 @@ class IpVersionEnum(str, Enum): The IP version for this rule. """ IPV4 = 'ipv4' - IPV6 = 'ipv6' class ProtocolEnum(str, Enum): @@ -82633,7 +86243,7 @@ class ReservedIPTargetEndpointGatewayReference(ReservedIPTarget): :attr str crn: The CRN for this endpoint gateway. :attr EndpointGatewayReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted and provides + property indicates the referenced resource has been deleted, and provides some supplementary information. :attr str href: The URL for this endpoint gateway. :attr str id: The unique identifier for this endpoint gateway. @@ -82658,7 +86268,7 @@ def __init__(self, :param str name: The unique user-defined name for this endpoint gateway. :param str resource_type: The resource type. :param EndpointGatewayReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted and provides + property indicates the referenced resource has been deleted, and provides some supplementary information. """ # pylint: disable=super-init-not-called @@ -82750,7 +86360,7 @@ class ReservedIPTargetGenericResourceReference(ReservedIPTarget): :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 + property indicates the referenced resource has been deleted, and provides some supplementary information. :attr str resource_type: The resource type. """ @@ -82766,7 +86376,7 @@ def __init__(self, :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 + property indicates the referenced resource has been deleted, and provides some supplementary information. """ # pylint: disable=super-init-not-called @@ -82837,7 +86447,7 @@ class ReservedIPTargetLoadBalancerReference(ReservedIPTarget): :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 + 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. @@ -82862,7 +86472,7 @@ def __init__(self, :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 + property indicates the referenced resource has been deleted, and provides some supplementary information. """ # pylint: disable=super-init-not-called @@ -82953,7 +86563,7 @@ class ReservedIPTargetNetworkInterfaceReferenceTargetContext(ReservedIPTarget): ReservedIPTargetNetworkInterfaceReferenceTargetContext. :attr NetworkInterfaceReferenceTargetContextDeleted deleted: (optional) If - present, this property indicates the referenced resource has been deleted and + present, this property indicates the referenced resource has been deleted, and provides some supplementary information. :attr str href: The URL for this network interface. @@ -82977,7 +86587,7 @@ def __init__(self, :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 + present, this property indicates the referenced resource has been deleted, and provides some supplementary information. """ @@ -83063,7 +86673,7 @@ class ReservedIPTargetVPNGatewayReference(ReservedIPTarget): :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 + 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. @@ -83088,7 +86698,7 @@ def __init__(self, :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 + property indicates the referenced resource has been deleted, and provides some supplementary information. """ # pylint: disable=super-init-not-called @@ -83180,7 +86790,7 @@ class ReservedIPTargetVPNServerReference(ReservedIPTarget): :attr str crn: The CRN for this VPN server. :attr VPNServerReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted and provides + indicates the referenced resource has been deleted, and provides some supplementary information. :attr str href: The URL for this VPN server. :attr str id: The unique identifier for this VPN server. @@ -83205,7 +86815,7 @@ def __init__(self, :param str name: The unique user-defined name for this VPN server. :param str resource_type: The resource type. :param VPNServerReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted and provides + property indicates the referenced resource has been deleted, and provides some supplementary information. """ # pylint: disable=super-init-not-called @@ -83354,7 +86964,7 @@ class RouteCreatorVPNGatewayReference(RouteCreator): :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 + 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. @@ -83379,7 +86989,7 @@ def __init__(self, :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 + property indicates the referenced resource has been deleted, and provides some supplementary information. """ # pylint: disable=super-init-not-called @@ -83471,7 +87081,7 @@ class RouteCreatorVPNServerReference(RouteCreator): :attr str crn: The CRN for this VPN server. :attr VPNServerReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted and provides + indicates the referenced resource has been deleted, and provides some supplementary information. :attr str href: The URL for this VPN server. :attr str id: The unique identifier for this VPN server. @@ -83496,7 +87106,7 @@ def __init__(self, :param str name: The unique user-defined name for this VPN server. :param str resource_type: The resource type. :param VPNServerReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted and provides + property indicates the referenced resource has been deleted, and provides some supplementary information. """ # pylint: disable=super-init-not-called @@ -83653,7 +87263,7 @@ class RouteNextHopVPNGatewayConnectionReference(RouteNextHop): RouteNextHopVPNGatewayConnectionReference. :attr VPNGatewayConnectionReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted and provides + property indicates the referenced resource has been deleted, and provides some supplementary information. :attr str href: The VPN connection's canonical URL. :attr str id: The unique identifier for this VPN gateway connection. @@ -83676,7 +87286,7 @@ def __init__(self, :param str name: The user-defined name for this VPN connection. :param str resource_type: The resource type. :param VPNGatewayConnectionReferenceDeleted deleted: (optional) If present, - this property indicates the referenced resource has been deleted and + this property indicates the referenced resource has been deleted, and provides some supplementary information. """ @@ -84125,12 +87735,9 @@ def __ne__(self, other: 'SecurityGroupIdentityById') -> bool: class SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll(SecurityGroupRulePrototype): """ - When `protocol` is `all`, then it's invalid to specify `port_min`, `port_max`, `type` - or - `code`. + A rule allowing traffic for all supported protocols. - :attr str direction: The direction of traffic to enforce, either `inbound` or - `outbound`. + :attr str direction: The direction of traffic to enforce. :attr str ip_version: (optional) The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they are used. Alternatively, if `remote` references a security group, then this rule @@ -84138,12 +87745,13 @@ class SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll(SecurityGroupRulePr version. :attr str protocol: The protocol to enforce. :attr SecurityGroupRuleRemotePrototype remote: (optional) The IP addresses or - security groups from which this rule will allow traffic (or to - which, for outbound rules). Can be specified as an IP address, a CIDR block, or - a - security group. If omitted, a CIDR block of `0.0.0.0/0` will be used to allow - traffic - from any source (or to any source, for outbound rules). + security groups from which this rule will allow traffic (or to which, + for outbound rules). Can be specified as an IP address, a CIDR block, or a + security group + within the VPC. + If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic from + any source + (or to any destination, for outbound rules). """ def __init__(self, @@ -84155,8 +87763,7 @@ def __init__(self, """ Initialize a SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll object. - :param str direction: The direction of traffic to enforce, either `inbound` - or `outbound`. + :param str direction: The direction of traffic to enforce. :param str protocol: The protocol to enforce. :param str ip_version: (optional) The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they @@ -84164,12 +87771,13 @@ def __init__(self, rule only applies to IP addresses (network interfaces) in that group matching this IP version. :param SecurityGroupRuleRemotePrototype remote: (optional) The IP addresses - or security groups from which this rule will allow traffic (or to - which, for outbound rules). Can be specified as an IP address, a CIDR - block, or a - security group. If omitted, a CIDR block of `0.0.0.0/0` will be used to - allow traffic - from any source (or to any source, for outbound rules). + or security groups from which this rule will allow traffic (or to which, + for outbound rules). Can be specified as an IP address, a CIDR block, or a + security group + within the VPC. + If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic + from any source + (or to any destination, for outbound rules). """ # pylint: disable=super-init-not-called self.direction = direction @@ -84236,7 +87844,7 @@ def __ne__(self, other: 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll' class DirectionEnum(str, Enum): """ - The direction of traffic to enforce, either `inbound` or `outbound`. + The direction of traffic to enforce. """ INBOUND = 'inbound' OUTBOUND = 'outbound' @@ -84261,14 +87869,12 @@ class ProtocolEnum(str, Enum): class SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP(SecurityGroupRulePrototype): """ - When `protocol` is `icmp`, the `type` property may optionally be specified. If - specified, then ICMP traffic is allowed only for the specified ICMP type. Further, if - `type` is specified, the `code` property may optionally be specified to allow traffic - only for the specified ICMP code. + A rule specifying the ICMP traffic to allow. :attr int code: (optional) The ICMP traffic code to allow. - :attr str direction: The direction of traffic to enforce, either `inbound` or - `outbound`. + If specified, `type` must also be specified. If unspecified, all codes are + allowed. + :attr str direction: The direction of traffic to enforce. :attr str ip_version: (optional) The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they are used. Alternatively, if `remote` references a security group, then this rule @@ -84276,13 +87882,15 @@ class SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP(SecurityGroupRuleP version. :attr str protocol: The protocol to enforce. :attr SecurityGroupRuleRemotePrototype remote: (optional) The IP addresses or - security groups from which this rule will allow traffic (or to - which, for outbound rules). Can be specified as an IP address, a CIDR block, or - a - security group. If omitted, a CIDR block of `0.0.0.0/0` will be used to allow - traffic - from any source (or to any source, for outbound rules). + security groups from which this rule will allow traffic (or to which, + for outbound rules). Can be specified as an IP address, a CIDR block, or a + security group + within the VPC. + If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic from + any source + (or to any destination, for outbound rules). :attr int type: (optional) The ICMP traffic type to allow. + If unspecified, all types are allowed. """ def __init__(self, @@ -84296,23 +87904,26 @@ def __init__(self, """ Initialize a SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP object. - :param str direction: The direction of traffic to enforce, either `inbound` - or `outbound`. + :param str direction: The direction of traffic to enforce. :param str protocol: The protocol to enforce. :param int code: (optional) The ICMP traffic code to allow. + If specified, `type` must also be specified. If unspecified, all codes are + allowed. :param str ip_version: (optional) The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses (network interfaces) in that group matching this IP version. :param SecurityGroupRuleRemotePrototype remote: (optional) The IP addresses - or security groups from which this rule will allow traffic (or to - which, for outbound rules). Can be specified as an IP address, a CIDR - block, or a - security group. If omitted, a CIDR block of `0.0.0.0/0` will be used to - allow traffic - from any source (or to any source, for outbound rules). + or security groups from which this rule will allow traffic (or to which, + for outbound rules). Can be specified as an IP address, a CIDR block, or a + security group + within the VPC. + If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic + from any source + (or to any destination, for outbound rules). :param int type: (optional) The ICMP traffic type to allow. + If unspecified, all types are allowed. """ # pylint: disable=super-init-not-called self.code = code @@ -84389,7 +88000,7 @@ def __ne__(self, other: 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP class DirectionEnum(str, Enum): """ - The direction of traffic to enforce, either `inbound` or `outbound`. + The direction of traffic to enforce. """ INBOUND = 'inbound' OUTBOUND = 'outbound' @@ -84414,27 +88025,32 @@ class ProtocolEnum(str, Enum): class SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP(SecurityGroupRulePrototype): """ - If `protocol` is either `tcp` or `udp`, then the rule may also contain `port_min` and - `port_max`. Either both must be set, or neither. When neither is set then traffic is - allowed on all ports. For a single port, set both to the same value. + A rule specifying the TCP or UDP traffic to allow. + Either both `port_min` and `port_max` will be present, or neither. When neither is + present, all ports are allowed for the protocol. When both have the same value, that + single port is allowed. - :attr str direction: The direction of traffic to enforce, either `inbound` or - `outbound`. + :attr str direction: The direction of traffic to enforce. :attr str ip_version: (optional) The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they are used. Alternatively, if `remote` references a security group, then this rule only applies to IP addresses (network interfaces) in that group matching this IP version. :attr int port_max: (optional) The inclusive upper bound of TCP/UDP port range. - :attr int port_min: (optional) The inclusive lower bound of TCP/UDP port range. + If specified, `port_min` must also be specified, and must not be larger. If + unspecified, `port_min` must also be unspecified, allowing traffic on all ports. + :attr int port_min: (optional) The inclusive lower bound of TCP/UDP port range + If specified, `port_max` must also be specified, and must not be smaller. If + unspecified, `port_max` must also be unspecified, allowing traffic on all ports. :attr str protocol: The protocol to enforce. :attr SecurityGroupRuleRemotePrototype remote: (optional) The IP addresses or - security groups from which this rule will allow traffic (or to - which, for outbound rules). Can be specified as an IP address, a CIDR block, or - a - security group. If omitted, a CIDR block of `0.0.0.0/0` will be used to allow - traffic - from any source (or to any source, for outbound rules). + security groups from which this rule will allow traffic (or to which, + for outbound rules). Can be specified as an IP address, a CIDR block, or a + security group + within the VPC. + If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic from + any source + (or to any destination, for outbound rules). """ def __init__(self, @@ -84448,8 +88064,7 @@ def __init__(self, """ Initialize a SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP object. - :param str direction: The direction of traffic to enforce, either `inbound` - or `outbound`. + :param str direction: The direction of traffic to enforce. :param str protocol: The protocol to enforce. :param str ip_version: (optional) The IP version to enforce. The format of `remote.address` or `remote.cidr_block` must match this property, if they @@ -84458,15 +88073,22 @@ def __init__(self, matching this IP version. :param int port_max: (optional) The inclusive upper bound of TCP/UDP port range. + If specified, `port_min` must also be specified, and must not be larger. If + unspecified, `port_min` must also be unspecified, allowing traffic on all + ports. :param int port_min: (optional) The inclusive lower bound of TCP/UDP port - range. + range + If specified, `port_max` must also be specified, and must not be smaller. + If unspecified, `port_max` must also be unspecified, allowing traffic on + all ports. :param SecurityGroupRuleRemotePrototype remote: (optional) The IP addresses - or security groups from which this rule will allow traffic (or to - which, for outbound rules). Can be specified as an IP address, a CIDR - block, or a - security group. If omitted, a CIDR block of `0.0.0.0/0` will be used to - allow traffic - from any source (or to any source, for outbound rules). + or security groups from which this rule will allow traffic (or to which, + for outbound rules). Can be specified as an IP address, a CIDR block, or a + security group + within the VPC. + If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic + from any source + (or to any destination, for outbound rules). """ # pylint: disable=super-init-not-called self.direction = direction @@ -84543,7 +88165,7 @@ def __ne__(self, other: 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPU class DirectionEnum(str, Enum): """ - The direction of traffic to enforce, either `inbound` or `outbound`. + The direction of traffic to enforce. """ INBOUND = 'inbound' OUTBOUND = 'outbound' @@ -84998,7 +88620,7 @@ class SecurityGroupRuleRemoteSecurityGroupReference(SecurityGroupRuleRemote): :attr str crn: The security group's CRN. :attr SecurityGroupReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted and provides + property indicates the referenced resource has been deleted, and provides some supplementary information. :attr str href: The security group's canonical URL. :attr str id: The unique identifier for this security group. @@ -85022,7 +88644,7 @@ def __init__(self, :param str name: The user-defined name for this security group. Names must be unique within the VPC the security group resides in. :param SecurityGroupReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted and provides + property indicates the referenced resource has been deleted, and provides some supplementary information. """ # pylint: disable=super-init-not-called @@ -85096,12 +88718,9 @@ def __ne__(self, other: 'SecurityGroupRuleRemoteSecurityGroupReference') -> bool class SecurityGroupRuleSecurityGroupRuleProtocolAll(SecurityGroupRule): """ - When `protocol` is `all`, then it's invalid to specify `port_min`, `port_max`, `type` - or - `code`. + A rule allowing traffic for all supported protocols. - :attr str direction: The direction of traffic to enforce, either `inbound` or - `outbound`. + :attr str direction: The direction of traffic to enforce. :attr str href: The URL for this security group rule. :attr str id: The unique identifier for this security group rule. :attr str ip_version: The IP version to enforce. The format of `remote.address` @@ -85123,8 +88742,7 @@ def __init__(self, """ Initialize a SecurityGroupRuleSecurityGroupRuleProtocolAll object. - :param str direction: The direction of traffic to enforce, either `inbound` - or `outbound`. + :param str direction: The direction of traffic to enforce. :param str href: The URL for this security group rule. :param str id: The unique identifier for this security group rule. :param str ip_version: The IP version to enforce. The format of @@ -85218,7 +88836,7 @@ def __ne__(self, other: 'SecurityGroupRuleSecurityGroupRuleProtocolAll') -> bool class DirectionEnum(str, Enum): """ - The direction of traffic to enforce, either `inbound` or `outbound`. + The direction of traffic to enforce. """ INBOUND = 'inbound' OUTBOUND = 'outbound' @@ -85243,13 +88861,9 @@ class ProtocolEnum(str, Enum): class SecurityGroupRuleSecurityGroupRuleProtocolICMP(SecurityGroupRule): """ - When `protocol` is `icmp`, the `type` property may optionally be specified. If - specified, then ICMP traffic is allowed only for the specified ICMP type. Further, if - `type` is specified, the `code` property may optionally be specified to allow traffic - only for the specified ICMP code. + A rule specifying the ICMP traffic to allow. - :attr str direction: The direction of traffic to enforce, either `inbound` or - `outbound`. + :attr str direction: The direction of traffic to enforce. :attr str href: The URL for this security group rule. :attr str id: The unique identifier for this security group rule. :attr str ip_version: The IP version to enforce. The format of `remote.address` @@ -85258,9 +88872,11 @@ class SecurityGroupRuleSecurityGroupRuleProtocolICMP(SecurityGroupRule): applies to IP addresses (network interfaces) in that group matching this IP version. :attr SecurityGroupRuleRemote remote: - :attr int code: (optional) The ICMP traffic code to allow. + :attr int code: (optional) The ICMP traffic code to allow. If absent, all codes + are allowed. :attr str protocol: The protocol to enforce. - :attr int type: (optional) The ICMP traffic type to allow. + :attr int type: (optional) The ICMP traffic type to allow. If absent, all types + are allowed. """ def __init__(self, @@ -85276,8 +88892,7 @@ def __init__(self, """ Initialize a SecurityGroupRuleSecurityGroupRuleProtocolICMP object. - :param str direction: The direction of traffic to enforce, either `inbound` - or `outbound`. + :param str direction: The direction of traffic to enforce. :param str href: The URL for this security group rule. :param str id: The unique identifier for this security group rule. :param str ip_version: The IP version to enforce. The format of @@ -85287,8 +88902,10 @@ def __init__(self, matching this IP version. :param SecurityGroupRuleRemote remote: :param str protocol: The protocol to enforce. - :param int code: (optional) The ICMP traffic code to allow. - :param int type: (optional) The ICMP traffic type to allow. + :param int code: (optional) The ICMP traffic code to allow. If absent, all + codes are allowed. + :param int type: (optional) The ICMP traffic type to allow. If absent, all + types are allowed. """ # pylint: disable=super-init-not-called self.direction = direction @@ -85383,7 +89000,7 @@ def __ne__(self, other: 'SecurityGroupRuleSecurityGroupRuleProtocolICMP') -> boo class DirectionEnum(str, Enum): """ - The direction of traffic to enforce, either `inbound` or `outbound`. + The direction of traffic to enforce. """ INBOUND = 'inbound' OUTBOUND = 'outbound' @@ -85408,12 +89025,12 @@ class ProtocolEnum(str, Enum): class SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP(SecurityGroupRule): """ - If `protocol` is either `tcp` or `udp`, then the rule may also contain `port_min` and - `port_max`. Either both must be set, or neither. When neither is set then traffic is - allowed on all ports. For a single port, set both to the same value. + A rule specifying the TCP or UDP traffic to allow. + Either both `port_min` and `port_max` will be present, or neither. When neither is + present, all ports are allowed for the protocol. When both have the same value, that + single port is allowed. - :attr str direction: The direction of traffic to enforce, either `inbound` or - `outbound`. + :attr str direction: The direction of traffic to enforce. :attr str href: The URL for this security group rule. :attr str id: The unique identifier for this security group rule. :attr str ip_version: The IP version to enforce. The format of `remote.address` @@ -85440,8 +89057,7 @@ def __init__(self, """ Initialize a SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP object. - :param str direction: The direction of traffic to enforce, either `inbound` - or `outbound`. + :param str direction: The direction of traffic to enforce. :param str href: The URL for this security group rule. :param str id: The unique identifier for this security group rule. :param str ip_version: The IP version to enforce. The format of @@ -85549,7 +89165,7 @@ def __ne__(self, other: 'SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP') -> b class DirectionEnum(str, Enum): """ - The direction of traffic to enforce, either `inbound` or `outbound`. + The direction of traffic to enforce. """ INBOUND = 'inbound' OUTBOUND = 'outbound' @@ -85579,7 +89195,7 @@ class SecurityGroupTargetReferenceEndpointGatewayReference(SecurityGroupTargetRe :attr str crn: The CRN for this endpoint gateway. :attr EndpointGatewayReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted and provides + property indicates the referenced resource has been deleted, and provides some supplementary information. :attr str href: The URL for this endpoint gateway. :attr str id: The unique identifier for this endpoint gateway. @@ -85604,7 +89220,7 @@ def __init__(self, :param str name: The unique user-defined name for this endpoint gateway. :param str resource_type: The resource type. :param EndpointGatewayReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted and provides + property indicates the referenced resource has been deleted, and provides some supplementary information. """ # pylint: disable=super-init-not-called @@ -85696,7 +89312,7 @@ class SecurityGroupTargetReferenceLoadBalancerReference(SecurityGroupTargetRefer :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 + 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. @@ -85721,7 +89337,7 @@ def __init__(self, :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 + property indicates the referenced resource has been deleted, and provides some supplementary information. """ # pylint: disable=super-init-not-called @@ -85812,7 +89428,7 @@ class SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext(Securit SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext. :attr NetworkInterfaceReferenceTargetContextDeleted deleted: (optional) If - present, this property indicates the referenced resource has been deleted and + present, this property indicates the referenced resource has been deleted, and provides some supplementary information. :attr str href: The URL for this network interface. @@ -85836,7 +89452,7 @@ def __init__(self, :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 + present, this property indicates the referenced resource has been deleted, and provides some supplementary information. """ @@ -85922,7 +89538,7 @@ class SecurityGroupTargetReferenceVPNServerReference(SecurityGroupTargetReferenc :attr str crn: The CRN for this VPN server. :attr VPNServerReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted and provides + indicates the referenced resource has been deleted, and provides some supplementary information. :attr str href: The URL for this VPN server. :attr str id: The unique identifier for this VPN server. @@ -85947,7 +89563,7 @@ def __init__(self, :param str name: The unique user-defined name for this VPN server. :param str resource_type: The resource type. :param VPNServerReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted and provides + property indicates the referenced resource has been deleted, and provides some supplementary information. """ # pylint: disable=super-init-not-called @@ -86488,8 +90104,9 @@ class SubnetPrototypeSubnetByCIDR(SubnetPrototype): :attr RoutingTableIdentity routing_table: (optional) The routing table to use for this subnet. If unspecified, the default routing table for the VPC is used. The routing table properties `route_direct_link_ingress`, - `route_transit_gateway_ingress`, and `route_vpc_zone_ingress` must be `false`. - :attr VPCIdentity vpc: The VPC the subnet is to be a part of. + `route_internet_ingress`, `route_transit_gateway_ingress`, and + `route_vpc_zone_ingress` must be `false`. + :attr VPCIdentity vpc: The VPC the subnet will reside in. :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 @@ -86514,7 +90131,7 @@ def __init__(self, """ Initialize a SubnetPrototypeSubnetByCIDR object. - :param VPCIdentity vpc: The VPC the subnet is to be a part of. + :param VPCIdentity vpc: The VPC the subnet will reside in. :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 @@ -86538,8 +90155,8 @@ def __init__(self, :param RoutingTableIdentity routing_table: (optional) The routing table to use for this subnet. If unspecified, the default routing table for the VPC is used. The routing table properties `route_direct_link_ingress`, - `route_transit_gateway_ingress`, and `route_vpc_zone_ingress` must be - `false`. + `route_internet_ingress`, `route_transit_gateway_ingress`, and + `route_vpc_zone_ingress` must be `false`. :param ZoneIdentity zone: (optional) The zone this subnet will reside in. """ # pylint: disable=super-init-not-called @@ -86669,8 +90286,9 @@ class SubnetPrototypeSubnetByTotalCount(SubnetPrototype): :attr RoutingTableIdentity routing_table: (optional) The routing table to use for this subnet. If unspecified, the default routing table for the VPC is used. The routing table properties `route_direct_link_ingress`, - `route_transit_gateway_ingress`, and `route_vpc_zone_ingress` must be `false`. - :attr VPCIdentity vpc: The VPC the subnet is to be a part of. + `route_internet_ingress`, `route_transit_gateway_ingress`, and + `route_vpc_zone_ingress` must be `false`. + :attr VPCIdentity vpc: The VPC the subnet will reside in. :attr int total_ipv4_address_count: The total number of IPv4 addresses required. Must be a power of 2. The VPC must have a default address prefix in the specified zone, and that prefix must have a free CIDR range with at least this @@ -86692,7 +90310,7 @@ def __init__(self, """ Initialize a SubnetPrototypeSubnetByTotalCount object. - :param VPCIdentity vpc: The VPC the subnet is to be a part of. + :param VPCIdentity vpc: The VPC the subnet will reside in. :param int total_ipv4_address_count: The total number of IPv4 addresses required. Must be a power of 2. The VPC must have a default address prefix in the specified zone, and that prefix must have a free CIDR range with at @@ -86713,8 +90331,8 @@ def __init__(self, :param RoutingTableIdentity routing_table: (optional) The routing table to use for this subnet. If unspecified, the default routing table for the VPC is used. The routing table properties `route_direct_link_ingress`, - `route_transit_gateway_ingress`, and `route_vpc_zone_ingress` must be - `false`. + `route_internet_ingress`, `route_transit_gateway_ingress`, and + `route_vpc_zone_ingress` must be `false`. """ # pylint: disable=super-init-not-called self.ip_version = ip_version @@ -88669,6 +92287,7 @@ class VPNGatewayPolicyMode(VPNGateway): :attr str resource_type: The resource type. :attr str status: The status of the VPN gateway. :attr SubnetReference subnet: + :attr VPCReference vpc: The VPC this VPN gateway resides in. :attr str mode: Policy mode VPN gateway. """ @@ -88684,6 +92303,7 @@ def __init__(self, resource_type: str, status: str, subnet: 'SubnetReference', + vpc: 'VPCReference', mode: str) -> None: """ Initialize a VPNGatewayPolicyMode object. @@ -88702,6 +92322,7 @@ def __init__(self, :param str resource_type: The resource type. :param str status: The status of the VPN gateway. :param SubnetReference subnet: + :param VPCReference vpc: The VPC this VPN gateway resides in. :param str mode: Policy mode VPN gateway. """ # pylint: disable=super-init-not-called @@ -88716,6 +92337,7 @@ def __init__(self, self.resource_type = resource_type self.status = status self.subnet = subnet + self.vpc = vpc self.mode = mode @classmethod @@ -88766,6 +92388,10 @@ def from_dict(cls, _dict: Dict) -> 'VPNGatewayPolicyMode': args['subnet'] = SubnetReference.from_dict(_dict.get('subnet')) else: raise ValueError('Required property \'subnet\' not present in VPNGatewayPolicyMode JSON') + if 'vpc' in _dict: + args['vpc'] = VPCReference.from_dict(_dict.get('vpc')) + else: + raise ValueError('Required property \'vpc\' not present in VPNGatewayPolicyMode JSON') if 'mode' in _dict: args['mode'] = _dict.get('mode') else: @@ -88802,6 +92428,8 @@ def to_dict(self) -> Dict: _dict['status'] = self.status if hasattr(self, 'subnet') and self.subnet is not None: _dict['subnet'] = self.subnet.to_dict() + if hasattr(self, 'vpc') and self.vpc is not None: + _dict['vpc'] = self.vpc.to_dict() if hasattr(self, 'mode') and self.mode is not None: _dict['mode'] = self.mode return _dict @@ -89055,6 +92683,7 @@ class VPNGatewayRouteMode(VPNGateway): :attr str resource_type: The resource type. :attr str status: The status of the VPN gateway. :attr SubnetReference subnet: + :attr VPCReference vpc: The VPC this VPN gateway resides in. :attr str mode: Route mode VPN gateway. """ @@ -89070,6 +92699,7 @@ def __init__(self, resource_type: str, status: str, subnet: 'SubnetReference', + vpc: 'VPCReference', mode: str) -> None: """ Initialize a VPNGatewayRouteMode object. @@ -89088,6 +92718,7 @@ def __init__(self, :param str resource_type: The resource type. :param str status: The status of the VPN gateway. :param SubnetReference subnet: + :param VPCReference vpc: The VPC this VPN gateway resides in. :param str mode: Route mode VPN gateway. """ # pylint: disable=super-init-not-called @@ -89102,6 +92733,7 @@ def __init__(self, self.resource_type = resource_type self.status = status self.subnet = subnet + self.vpc = vpc self.mode = mode @classmethod @@ -89152,6 +92784,10 @@ def from_dict(cls, _dict: Dict) -> 'VPNGatewayRouteMode': args['subnet'] = SubnetReference.from_dict(_dict.get('subnet')) else: raise ValueError('Required property \'subnet\' not present in VPNGatewayRouteMode JSON') + if 'vpc' in _dict: + args['vpc'] = VPCReference.from_dict(_dict.get('vpc')) + else: + raise ValueError('Required property \'vpc\' not present in VPNGatewayRouteMode JSON') if 'mode' in _dict: args['mode'] = _dict.get('mode') else: @@ -89188,6 +92824,8 @@ def to_dict(self) -> Dict: _dict['status'] = self.status if hasattr(self, 'subnet') and self.subnet is not None: _dict['subnet'] = self.subnet.to_dict() + if hasattr(self, 'vpc') and self.vpc is not None: + _dict['vpc'] = self.vpc.to_dict() if hasattr(self, 'mode') and self.mode is not None: _dict['mode'] = self.mode return _dict @@ -89677,22 +93315,34 @@ class VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext(VolumeAttach :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 VolumeProfileIdentity profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to + use for this volume. + :attr List[str] user_tags: (optional) The [user + tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this + volume. """ def __init__(self, profile: 'VolumeProfileIdentity', *, iops: int = None, - name: str = None) -> None: + name: str = None, + user_tags: List[str] = None) -> None: """ Initialize a VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext object. - :param VolumeProfileIdentity profile: The profile to use for this volume. + :param VolumeProfileIdentity profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) + to + use for this volume. :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. + :param List[str] user_tags: (optional) The [user + tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with + this volume. """ # pylint: disable=super-init-not-called msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( @@ -89722,22 +93372,34 @@ class VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceConte :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 VolumeProfileIdentity profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to + use for this volume. + :attr List[str] user_tags: (optional) The [user + tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this + volume. """ def __init__(self, profile: 'VolumeProfileIdentity', *, iops: int = None, - name: str = None) -> None: + name: str = None, + user_tags: List[str] = None) -> None: """ Initialize a VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContext object. - :param VolumeProfileIdentity profile: The profile to use for this volume. + :param VolumeProfileIdentity profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) + to + use for this volume. :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. + :param List[str] user_tags: (optional) The [user + tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with + this volume. """ # pylint: disable=super-init-not-called msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( @@ -90036,7 +93698,9 @@ class VolumePrototypeVolumeByCapacity(VolumePrototype): :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 VolumeProfileIdentity profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to + use for this volume. :attr ResourceGroupIdentity resource_group: (optional) :attr List[str] user_tags: (optional) The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this @@ -90063,7 +93727,9 @@ def __init__(self, """ Initialize a VolumePrototypeVolumeByCapacity object. - :param VolumeProfileIdentity profile: The profile to use for this volume. + :param VolumeProfileIdentity profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) + to use for this volume. :param ZoneIdentity zone: The zone this volume will reside in. :param int capacity: The capacity to use for the volume (in gigabytes). The specified minimum and maximum capacity values for creating or updating @@ -90182,7 +93848,9 @@ class VolumePrototypeVolumeBySourceSnapshot(VolumePrototype): :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 VolumeProfileIdentity profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to + use for this volume. :attr ResourceGroupIdentity resource_group: (optional) :attr List[str] user_tags: (optional) The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this @@ -90194,7 +93862,7 @@ class VolumePrototypeVolumeBySourceSnapshot(VolumePrototype): 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. + If unspecified, the `encryption` type for the volume will be `provider_managed`. :attr SnapshotIdentity source_snapshot: The snapshot from which to clone the volume. """ @@ -90213,7 +93881,9 @@ def __init__(self, """ Initialize a VolumePrototypeVolumeBySourceSnapshot object. - :param VolumeProfileIdentity profile: The profile to use for this volume. + :param VolumeProfileIdentity profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) + to use for this volume. :param ZoneIdentity zone: The zone this volume will reside in. :param SnapshotIdentity source_snapshot: The snapshot from which to clone the volume. @@ -90232,7 +93902,8 @@ def __init__(self, `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. + If unspecified, the `encryption` type for the volume will be + `provider_managed`. """ # pylint: disable=super-init-not-called self.iops = iops @@ -91429,7 +95100,7 @@ class InstanceGroupManagerActionScheduledActionGroupTarget(InstanceGroupManagerA - `incompatible`: Action parameters are not compatible with the group or manager - `omitted`: Action was not applied because this action's manager was disabled. :attr datetime updated_at: The date and time that the instance group manager - action was modified. + action was updated. :attr str action_type: The type of action for the instance group. :attr str cron_spec: (optional) The cron specification for a recurring scheduled action. Actions can be applied a maximum of one time within a 5 min period. @@ -91484,7 +95155,7 @@ def __init__(self, - `omitted`: Action was not applied because this action's manager was disabled. :param datetime updated_at: The date and time that the instance group - manager action was modified. + manager action was updated. :param str action_type: The type of action for the instance group. :param InstanceGroupManagerScheduledActionGroup group: :param str cron_spec: (optional) The cron specification for a recurring @@ -91679,7 +95350,7 @@ class InstanceGroupManagerActionScheduledActionManagerTarget(InstanceGroupManage - `incompatible`: Action parameters are not compatible with the group or manager - `omitted`: Action was not applied because this action's manager was disabled. :attr datetime updated_at: The date and time that the instance group manager - action was modified. + action was updated. :attr str action_type: The type of action for the instance group. :attr str cron_spec: (optional) The cron specification for a recurring scheduled action. Actions can be applied a maximum of one time within a 5 min period. @@ -91734,7 +95405,7 @@ def __init__(self, - `omitted`: Action was not applied because this action's manager was disabled. :param datetime updated_at: The date and time that the instance group - manager action was modified. + manager action was updated. :param str action_type: The type of action for the instance group. :param InstanceGroupManagerScheduledActionManager manager: :param str cron_spec: (optional) The cron specification for a recurring @@ -94464,7 +98135,12 @@ class VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototy :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 VolumeProfileIdentity profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to + use for this volume. + :attr List[str] user_tags: (optional) The [user + tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this + volume. :attr int capacity: The capacity to use for the volume (in gigabytes). The specified minimum and maximum capacity values for creating or updating volumes may expand in the future. @@ -94479,11 +98155,14 @@ def __init__(self, *, iops: int = None, name: str = None, + user_tags: List[str] = None, encryption_key: 'EncryptionKeyIdentity' = None) -> None: """ Initialize a VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity object. - :param VolumeProfileIdentity profile: The profile to use for this volume. + :param VolumeProfileIdentity profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) + to use for this volume. :param int capacity: The capacity to use for the volume (in gigabytes). The specified minimum and maximum capacity values for creating or updating volumes may expand in the future. @@ -94491,6 +98170,9 @@ def __init__(self, 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. + :param List[str] user_tags: (optional) The [user + tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with + this volume. :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 @@ -94500,6 +98182,7 @@ def __init__(self, self.iops = iops self.name = name self.profile = profile + self.user_tags = user_tags self.capacity = capacity self.encryption_key = encryption_key @@ -94515,6 +98198,8 @@ def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentPrototypeVolumeVolumePrototy args['profile'] = _dict.get('profile') else: raise ValueError('Required property \'profile\' not present in VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity JSON') + if 'user_tags' in _dict: + args['user_tags'] = _dict.get('user_tags') if 'capacity' in _dict: args['capacity'] = _dict.get('capacity') else: @@ -94540,6 +98225,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 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: @@ -94574,14 +98261,19 @@ class VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototy :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 VolumeProfileIdentity profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to + use for this volume. + :attr List[str] user_tags: (optional) The [user + tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this + volume. :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. + If unspecified, the `encryption` type for the volume will be `provider_managed`. :attr SnapshotIdentity source_snapshot: The snapshot from which to clone the volume. """ @@ -94592,18 +98284,24 @@ def __init__(self, *, iops: int = None, name: str = None, + user_tags: List[str] = None, capacity: int = None, encryption_key: 'EncryptionKeyIdentity' = None) -> None: """ Initialize a VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot object. - :param VolumeProfileIdentity profile: The profile to use for this volume. + :param VolumeProfileIdentity profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) + to use for this volume. :param SnapshotIdentity source_snapshot: The snapshot from which to clone the volume. :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. + :param List[str] user_tags: (optional) The [user + tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with + this 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. @@ -94611,12 +98309,14 @@ def __init__(self, `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. + If unspecified, the `encryption` type for the volume will be + `provider_managed`. """ # pylint: disable=super-init-not-called self.iops = iops self.name = name self.profile = profile + self.user_tags = user_tags self.capacity = capacity self.encryption_key = encryption_key self.source_snapshot = source_snapshot @@ -94633,6 +98333,8 @@ def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentPrototypeVolumeVolumePrototy args['profile'] = _dict.get('profile') else: raise ValueError('Required property \'profile\' not present in VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot JSON') + if 'user_tags' in _dict: + args['user_tags'] = _dict.get('user_tags') if 'capacity' in _dict: args['capacity'] = _dict.get('capacity') if 'encryption_key' in _dict: @@ -94660,6 +98362,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 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: @@ -94870,7 +98574,12 @@ class VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceConte :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 VolumeProfileIdentity profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to + use for this volume. + :attr List[str] user_tags: (optional) The [user + tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this + volume. :attr int capacity: The capacity to use for the volume (in gigabytes). The specified minimum and maximum capacity values for creating or updating volumes may expand in the future. @@ -94885,11 +98594,14 @@ def __init__(self, *, iops: int = None, name: str = None, + user_tags: List[str] = None, encryption_key: 'EncryptionKeyIdentity' = None) -> None: """ Initialize a VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity object. - :param VolumeProfileIdentity profile: The profile to use for this volume. + :param VolumeProfileIdentity profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) + to use for this volume. :param int capacity: The capacity to use for the volume (in gigabytes). The specified minimum and maximum capacity values for creating or updating volumes may expand in the future. @@ -94897,6 +98609,9 @@ def __init__(self, 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. + :param List[str] user_tags: (optional) The [user + tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with + this volume. :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 @@ -94906,6 +98621,7 @@ def __init__(self, self.iops = iops self.name = name self.profile = profile + self.user_tags = user_tags self.capacity = capacity self.encryption_key = encryption_key @@ -94921,6 +98637,8 @@ def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentVolumePrototypeInstanceConte args['profile'] = _dict.get('profile') else: raise ValueError('Required property \'profile\' not present in VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity JSON') + if 'user_tags' in _dict: + args['user_tags'] = _dict.get('user_tags') if 'capacity' in _dict: args['capacity'] = _dict.get('capacity') else: @@ -94946,6 +98664,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 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: @@ -94980,14 +98700,19 @@ class VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceConte :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 VolumeProfileIdentity profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to + use for this volume. + :attr List[str] user_tags: (optional) The [user + tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this + volume. :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. + If unspecified, the `encryption` type for the volume will be `provider_managed`. :attr SnapshotIdentity source_snapshot: The snapshot from which to clone the volume. """ @@ -94998,18 +98723,24 @@ def __init__(self, *, iops: int = None, name: str = None, + user_tags: List[str] = None, capacity: int = None, encryption_key: 'EncryptionKeyIdentity' = None) -> None: """ Initialize a VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot object. - :param VolumeProfileIdentity profile: The profile to use for this volume. + :param VolumeProfileIdentity profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) + to use for this volume. :param SnapshotIdentity source_snapshot: The snapshot from which to clone the volume. :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. + :param List[str] user_tags: (optional) The [user + tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with + this 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. @@ -95017,12 +98748,14 @@ def __init__(self, `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. + If unspecified, the `encryption` type for the volume will be + `provider_managed`. """ # pylint: disable=super-init-not-called self.iops = iops self.name = name self.profile = profile + self.user_tags = user_tags self.capacity = capacity self.encryption_key = encryption_key self.source_snapshot = source_snapshot @@ -95039,6 +98772,8 @@ def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentVolumePrototypeInstanceConte args['profile'] = _dict.get('profile') else: raise ValueError('Required property \'profile\' not present in VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot JSON') + if 'user_tags' in _dict: + args['user_tags'] = _dict.get('user_tags') if 'capacity' in _dict: args['capacity'] = _dict.get('capacity') if 'encryption_key' in _dict: @@ -95066,6 +98801,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 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: @@ -95425,3 +99162,3298 @@ def __eq__(self, other: 'InstanceGroupManagerActionPrototypeScheduledActionProto def __ne__(self, other: 'InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + +############################################################################## +# Pagers +############################################################################## + +class VpcsPager(): + """ + VpcsPager can be used to simplify the use of the "list_vpcs" method. + """ + + def __init__(self, + *, + client: VpcV1, + limit: int = None, + resource_group_id: str = None, + classic_access: bool = None, + ) -> None: + """ + Initialize a VpcsPager object. + :param int limit: (optional) The number of resources to return on a page. + :param str resource_group_id: (optional) Filters the collection to + resources in the resource group with the specified identifier. + :param bool classic_access: (optional) Filters the collection to VPCs with + the specified `classic_access` value. + """ + self._has_next = True + self._client = client + self._page_context = { 'next': None } + self._limit = limit + self._resource_group_id = resource_group_id + self._classic_access = classic_access + + def has_next(self) -> bool: + """ + Returns true if there are potentially more results to be retrieved. + """ + return self._has_next + + def get_next(self) -> List[dict]: + """ + Returns the next page of results. + :return: A List[dict], where each element is a dict that represents an instance of VPC. + :rtype: List[dict] + """ + if not self.has_next(): + raise StopIteration(message='No more results available') + + result = self._client.list_vpcs( + limit=self._limit, + resource_group_id=self._resource_group_id, + classic_access=self._classic_access, + start=self._page_context.get('next'), + ).get_result() + + next = None + next_page_link = result.get('next') + if next_page_link is not None: + next = get_query_param(next_page_link.get('href'), 'start') + self._page_context['next'] = next + if next is None: + self._has_next = False + + return result.get('vpcs') + + def get_all(self) -> List[dict]: + """ + Returns all results by invoking get_next() repeatedly + until all pages of results have been retrieved. + :return: A List[dict], where each element is a dict that represents an instance of VPC. + :rtype: List[dict] + """ + results = [] + while self.has_next(): + next_page = self.get_next() + results.extend(next_page) + return results + +class VpcAddressPrefixesPager(): + """ + VpcAddressPrefixesPager can be used to simplify the use of the "list_vpc_address_prefixes" method. + """ + + def __init__(self, + *, + client: VpcV1, + vpc_id: str, + limit: int = None, + ) -> None: + """ + Initialize a VpcAddressPrefixesPager object. + :param str vpc_id: The VPC identifier. + :param int limit: (optional) The number of resources to return on a page. + """ + self._has_next = True + self._client = client + self._page_context = { 'next': None } + self._vpc_id = vpc_id + self._limit = limit + + def has_next(self) -> bool: + """ + Returns true if there are potentially more results to be retrieved. + """ + return self._has_next + + def get_next(self) -> List[dict]: + """ + Returns the next page of results. + :return: A List[dict], where each element is a dict that represents an instance of AddressPrefix. + :rtype: List[dict] + """ + if not self.has_next(): + raise StopIteration(message='No more results available') + + result = self._client.list_vpc_address_prefixes( + vpc_id=self._vpc_id, + limit=self._limit, + start=self._page_context.get('next'), + ).get_result() + + next = None + next_page_link = result.get('next') + if next_page_link is not None: + next = get_query_param(next_page_link.get('href'), 'start') + self._page_context['next'] = next + if next is None: + self._has_next = False + + return result.get('address_prefixes') + + def get_all(self) -> List[dict]: + """ + Returns all results by invoking get_next() repeatedly + until all pages of results have been retrieved. + :return: A List[dict], where each element is a dict that represents an instance of AddressPrefix. + :rtype: List[dict] + """ + results = [] + while self.has_next(): + next_page = self.get_next() + results.extend(next_page) + return results + +class VpcRoutesPager(): + """ + VpcRoutesPager can be used to simplify the use of the "list_vpc_routes" method. + """ + + def __init__(self, + *, + client: VpcV1, + vpc_id: str, + zone_name: str = None, + limit: int = None, + ) -> None: + """ + Initialize a VpcRoutesPager object. + :param str vpc_id: The VPC identifier. + :param str zone_name: (optional) Filters the collection to resources in the + zone with the exact specified name. + :param int limit: (optional) The number of resources to return on a page. + """ + self._has_next = True + self._client = client + self._page_context = { 'next': None } + self._vpc_id = vpc_id + self._zone_name = zone_name + self._limit = limit + + def has_next(self) -> bool: + """ + Returns true if there are potentially more results to be retrieved. + """ + return self._has_next + + def get_next(self) -> List[dict]: + """ + Returns the next page of results. + :return: A List[dict], where each element is a dict that represents an instance of Route. + :rtype: List[dict] + """ + if not self.has_next(): + raise StopIteration(message='No more results available') + + result = self._client.list_vpc_routes( + vpc_id=self._vpc_id, + zone_name=self._zone_name, + limit=self._limit, + start=self._page_context.get('next'), + ).get_result() + + next = None + next_page_link = result.get('next') + if next_page_link is not None: + next = get_query_param(next_page_link.get('href'), 'start') + self._page_context['next'] = next + if next is None: + self._has_next = False + + return result.get('routes') + + def get_all(self) -> List[dict]: + """ + Returns all results by invoking get_next() repeatedly + until all pages of results have been retrieved. + :return: A List[dict], where each element is a dict that represents an instance of Route. + :rtype: List[dict] + """ + results = [] + while self.has_next(): + next_page = self.get_next() + results.extend(next_page) + return results + +class VpcRoutingTablesPager(): + """ + VpcRoutingTablesPager can be used to simplify the use of the "list_vpc_routing_tables" method. + """ + + def __init__(self, + *, + client: VpcV1, + vpc_id: str, + limit: int = None, + is_default: bool = None, + ) -> None: + """ + Initialize a VpcRoutingTablesPager object. + :param str vpc_id: The VPC identifier. + :param int limit: (optional) The number of resources to return on a page. + :param bool is_default: (optional) Filters the collection to routing tables + with the specified `is_default` value. + """ + self._has_next = True + self._client = client + self._page_context = { 'next': None } + self._vpc_id = vpc_id + self._limit = limit + self._is_default = is_default + + def has_next(self) -> bool: + """ + Returns true if there are potentially more results to be retrieved. + """ + return self._has_next + + def get_next(self) -> List[dict]: + """ + Returns the next page of results. + :return: A List[dict], where each element is a dict that represents an instance of RoutingTable. + :rtype: List[dict] + """ + if not self.has_next(): + raise StopIteration(message='No more results available') + + result = self._client.list_vpc_routing_tables( + vpc_id=self._vpc_id, + limit=self._limit, + is_default=self._is_default, + start=self._page_context.get('next'), + ).get_result() + + next = None + next_page_link = result.get('next') + if next_page_link is not None: + next = get_query_param(next_page_link.get('href'), 'start') + self._page_context['next'] = next + if next is None: + self._has_next = False + + return result.get('routing_tables') + + def get_all(self) -> List[dict]: + """ + Returns all results by invoking get_next() repeatedly + until all pages of results have been retrieved. + :return: A List[dict], where each element is a dict that represents an instance of RoutingTable. + :rtype: List[dict] + """ + results = [] + while self.has_next(): + next_page = self.get_next() + results.extend(next_page) + return results + +class VpcRoutingTableRoutesPager(): + """ + VpcRoutingTableRoutesPager can be used to simplify the use of the "list_vpc_routing_table_routes" method. + """ + + def __init__(self, + *, + client: VpcV1, + vpc_id: str, + routing_table_id: str, + limit: int = None, + ) -> None: + """ + Initialize a VpcRoutingTableRoutesPager object. + :param str vpc_id: The VPC identifier. + :param str routing_table_id: The routing table identifier. + :param int limit: (optional) The number of resources to return on a page. + """ + self._has_next = True + self._client = client + self._page_context = { 'next': None } + self._vpc_id = vpc_id + self._routing_table_id = routing_table_id + self._limit = limit + + def has_next(self) -> bool: + """ + Returns true if there are potentially more results to be retrieved. + """ + return self._has_next + + def get_next(self) -> List[dict]: + """ + Returns the next page of results. + :return: A List[dict], where each element is a dict that represents an instance of Route. + :rtype: List[dict] + """ + if not self.has_next(): + raise StopIteration(message='No more results available') + + result = self._client.list_vpc_routing_table_routes( + vpc_id=self._vpc_id, + routing_table_id=self._routing_table_id, + limit=self._limit, + start=self._page_context.get('next'), + ).get_result() + + next = None + next_page_link = result.get('next') + if next_page_link is not None: + next = get_query_param(next_page_link.get('href'), 'start') + self._page_context['next'] = next + if next is None: + self._has_next = False + + return result.get('routes') + + def get_all(self) -> List[dict]: + """ + Returns all results by invoking get_next() repeatedly + until all pages of results have been retrieved. + :return: A List[dict], where each element is a dict that represents an instance of Route. + :rtype: List[dict] + """ + results = [] + while self.has_next(): + next_page = self.get_next() + results.extend(next_page) + return results + +class SubnetsPager(): + """ + SubnetsPager can be used to simplify the use of the "list_subnets" method. + """ + + def __init__(self, + *, + client: VpcV1, + limit: int = None, + resource_group_id: str = None, + routing_table_id: str = None, + routing_table_name: str = None, + ) -> None: + """ + Initialize a SubnetsPager object. + :param int limit: (optional) The number of resources to return on a page. + :param str resource_group_id: (optional) Filters the collection to + resources in the resource group with the specified identifier. + :param str routing_table_id: (optional) Filters the collection to subnets + attached to the routing table with the specified identifier. + :param str routing_table_name: (optional) Filters the collection to subnets + attached to the routing table with the specified name. + """ + self._has_next = True + self._client = client + self._page_context = { 'next': None } + self._limit = limit + self._resource_group_id = resource_group_id + self._routing_table_id = routing_table_id + self._routing_table_name = routing_table_name + + def has_next(self) -> bool: + """ + Returns true if there are potentially more results to be retrieved. + """ + return self._has_next + + def get_next(self) -> List[dict]: + """ + Returns the next page of results. + :return: A List[dict], where each element is a dict that represents an instance of Subnet. + :rtype: List[dict] + """ + if not self.has_next(): + raise StopIteration(message='No more results available') + + result = self._client.list_subnets( + limit=self._limit, + resource_group_id=self._resource_group_id, + routing_table_id=self._routing_table_id, + routing_table_name=self._routing_table_name, + start=self._page_context.get('next'), + ).get_result() + + next = None + next_page_link = result.get('next') + if next_page_link is not None: + next = get_query_param(next_page_link.get('href'), 'start') + self._page_context['next'] = next + if next is None: + self._has_next = False + + return result.get('subnets') + + def get_all(self) -> List[dict]: + """ + Returns all results by invoking get_next() repeatedly + until all pages of results have been retrieved. + :return: A List[dict], where each element is a dict that represents an instance of Subnet. + :rtype: List[dict] + """ + results = [] + while self.has_next(): + next_page = self.get_next() + results.extend(next_page) + return results + +class SubnetReservedIpsPager(): + """ + SubnetReservedIpsPager can be used to simplify the use of the "list_subnet_reserved_ips" method. + """ + + def __init__(self, + *, + client: VpcV1, + subnet_id: str, + limit: int = None, + sort: str = None, + ) -> None: + """ + Initialize a SubnetReservedIpsPager object. + :param str subnet_id: The subnet identifier. + :param int limit: (optional) The number of resources to return on a page. + :param str sort: (optional) Sorts the returned collection by the specified + property name in ascending order. A `-` may be prepended to the name to + sort in descending order. For example, the value `-created_at` sorts the + collection by the `created_at` property in descending order, and the value + `name` sorts it by the `name` property in ascending order. + """ + self._has_next = True + self._client = client + self._page_context = { 'next': None } + self._subnet_id = subnet_id + self._limit = limit + self._sort = sort + + def has_next(self) -> bool: + """ + Returns true if there are potentially more results to be retrieved. + """ + return self._has_next + + def get_next(self) -> List[dict]: + """ + Returns the next page of results. + :return: A List[dict], where each element is a dict that represents an instance of ReservedIP. + :rtype: List[dict] + """ + if not self.has_next(): + raise StopIteration(message='No more results available') + + result = self._client.list_subnet_reserved_ips( + subnet_id=self._subnet_id, + limit=self._limit, + sort=self._sort, + start=self._page_context.get('next'), + ).get_result() + + next = None + next_page_link = result.get('next') + if next_page_link is not None: + next = get_query_param(next_page_link.get('href'), 'start') + self._page_context['next'] = next + if next is None: + self._has_next = False + + return result.get('reserved_ips') + + def get_all(self) -> List[dict]: + """ + Returns all results by invoking get_next() repeatedly + until all pages of results have been retrieved. + :return: A List[dict], where each element is a dict that represents an instance of ReservedIP. + :rtype: List[dict] + """ + results = [] + while self.has_next(): + next_page = self.get_next() + results.extend(next_page) + return results + +class ImagesPager(): + """ + ImagesPager can be used to simplify the use of the "list_images" method. + """ + + def __init__(self, + *, + client: VpcV1, + limit: int = None, + resource_group_id: str = None, + name: str = None, + visibility: str = None, + ) -> None: + """ + Initialize a ImagesPager object. + :param int limit: (optional) The number of resources to return on a page. + :param str resource_group_id: (optional) Filters the collection to + resources in the resource group with the specified identifier. + :param str name: (optional) Filters the collection to resources with the + exact specified name. + :param str visibility: (optional) Filters the collection to images with the + specified `visibility`. + """ + self._has_next = True + self._client = client + self._page_context = { 'next': None } + self._limit = limit + self._resource_group_id = resource_group_id + self._name = name + self._visibility = visibility + + def has_next(self) -> bool: + """ + Returns true if there are potentially more results to be retrieved. + """ + return self._has_next + + def get_next(self) -> List[dict]: + """ + Returns the next page of results. + :return: A List[dict], where each element is a dict that represents an instance of Image. + :rtype: List[dict] + """ + if not self.has_next(): + raise StopIteration(message='No more results available') + + result = self._client.list_images( + limit=self._limit, + resource_group_id=self._resource_group_id, + name=self._name, + visibility=self._visibility, + start=self._page_context.get('next'), + ).get_result() + + next = None + next_page_link = result.get('next') + if next_page_link is not None: + next = get_query_param(next_page_link.get('href'), 'start') + self._page_context['next'] = next + if next is None: + self._has_next = False + + return result.get('images') + + def get_all(self) -> List[dict]: + """ + Returns all results by invoking get_next() repeatedly + until all pages of results have been retrieved. + :return: A List[dict], where each element is a dict that represents an instance of Image. + :rtype: List[dict] + """ + results = [] + while self.has_next(): + next_page = self.get_next() + results.extend(next_page) + return results + +class OperatingSystemsPager(): + """ + OperatingSystemsPager can be used to simplify the use of the "list_operating_systems" method. + """ + + def __init__(self, + *, + client: VpcV1, + limit: int = None, + ) -> None: + """ + Initialize a OperatingSystemsPager object. + :param int limit: (optional) The number of resources to return on a page. + """ + self._has_next = True + self._client = client + self._page_context = { 'next': None } + self._limit = limit + + def has_next(self) -> bool: + """ + Returns true if there are potentially more results to be retrieved. + """ + return self._has_next + + def get_next(self) -> List[dict]: + """ + Returns the next page of results. + :return: A List[dict], where each element is a dict that represents an instance of OperatingSystem. + :rtype: List[dict] + """ + if not self.has_next(): + raise StopIteration(message='No more results available') + + result = self._client.list_operating_systems( + limit=self._limit, + start=self._page_context.get('next'), + ).get_result() + + next = None + next_page_link = result.get('next') + if next_page_link is not None: + next = get_query_param(next_page_link.get('href'), 'start') + self._page_context['next'] = next + if next is None: + self._has_next = False + + return result.get('operating_systems') + + def get_all(self) -> List[dict]: + """ + Returns all results by invoking get_next() repeatedly + until all pages of results have been retrieved. + :return: A List[dict], where each element is a dict that represents an instance of OperatingSystem. + :rtype: List[dict] + """ + results = [] + while self.has_next(): + next_page = self.get_next() + results.extend(next_page) + return results + +class KeysPager(): + """ + KeysPager can be used to simplify the use of the "list_keys" method. + """ + + def __init__(self, + *, + client: VpcV1, + limit: int = None, + ) -> None: + """ + Initialize a KeysPager object. + :param int limit: (optional) The number of resources to return on a page. + """ + self._has_next = True + self._client = client + self._page_context = { 'next': None } + self._limit = limit + + def has_next(self) -> bool: + """ + Returns true if there are potentially more results to be retrieved. + """ + return self._has_next + + def get_next(self) -> List[dict]: + """ + Returns the next page of results. + :return: A List[dict], where each element is a dict that represents an instance of Key. + :rtype: List[dict] + """ + if not self.has_next(): + raise StopIteration(message='No more results available') + + result = self._client.list_keys( + limit=self._limit, + start=self._page_context.get('next'), + ).get_result() + + next = None + next_page_link = result.get('next') + if next_page_link is not None: + next = get_query_param(next_page_link.get('href'), 'start') + self._page_context['next'] = next + if next is None: + self._has_next = False + + return result.get('keys') + + def get_all(self) -> List[dict]: + """ + Returns all results by invoking get_next() repeatedly + until all pages of results have been retrieved. + :return: A List[dict], where each element is a dict that represents an instance of Key. + :rtype: List[dict] + """ + results = [] + while self.has_next(): + next_page = self.get_next() + results.extend(next_page) + return results + +class InstancesPager(): + """ + InstancesPager can be used to simplify the use of the "list_instances" method. + """ + + def __init__(self, + *, + client: VpcV1, + limit: int = None, + resource_group_id: str = None, + name: str = None, + vpc_id: str = None, + vpc_crn: str = None, + vpc_name: str = None, + dedicated_host_id: str = None, + dedicated_host_crn: str = None, + dedicated_host_name: str = None, + placement_group_id: str = None, + placement_group_crn: str = None, + placement_group_name: str = None, + ) -> None: + """ + Initialize a InstancesPager object. + :param int limit: (optional) The number of resources to return on a page. + :param str resource_group_id: (optional) Filters the collection to + resources in the resource group with the specified identifier. + :param str name: (optional) Filters the collection to resources with the + exact specified name. + :param str vpc_id: (optional) Filters the collection to resources in the + VPC with the specified identifier. + :param str vpc_crn: (optional) Filters the collection to resources in the + VPC with the specified CRN. + :param str vpc_name: (optional) Filters the collection to resources in the + VPC with the exact specified name. + :param str dedicated_host_id: (optional) Filters the collection to + instances on the dedicated host with the specified identifier. + :param str dedicated_host_crn: (optional) Filters the collection to + instances on the dedicated host with the specified CRN. + :param str dedicated_host_name: (optional) Filters the collection to + instances on the dedicated host with the specified name. + :param str placement_group_id: (optional) Filters the collection to + instances in the placement group with the specified identifier. + :param str placement_group_crn: (optional) Filters the collection to + instances in the placement group with the specified CRN. + :param str placement_group_name: (optional) Filters the collection to + instances in the placement group with the specified name. + """ + self._has_next = True + self._client = client + self._page_context = { 'next': None } + self._limit = limit + self._resource_group_id = resource_group_id + self._name = name + self._vpc_id = vpc_id + self._vpc_crn = vpc_crn + self._vpc_name = vpc_name + self._dedicated_host_id = dedicated_host_id + self._dedicated_host_crn = dedicated_host_crn + self._dedicated_host_name = dedicated_host_name + self._placement_group_id = placement_group_id + self._placement_group_crn = placement_group_crn + self._placement_group_name = placement_group_name + + def has_next(self) -> bool: + """ + Returns true if there are potentially more results to be retrieved. + """ + return self._has_next + + def get_next(self) -> List[dict]: + """ + Returns the next page of results. + :return: A List[dict], where each element is a dict that represents an instance of Instance. + :rtype: List[dict] + """ + if not self.has_next(): + raise StopIteration(message='No more results available') + + result = self._client.list_instances( + limit=self._limit, + resource_group_id=self._resource_group_id, + name=self._name, + vpc_id=self._vpc_id, + vpc_crn=self._vpc_crn, + vpc_name=self._vpc_name, + dedicated_host_id=self._dedicated_host_id, + dedicated_host_crn=self._dedicated_host_crn, + dedicated_host_name=self._dedicated_host_name, + placement_group_id=self._placement_group_id, + placement_group_crn=self._placement_group_crn, + placement_group_name=self._placement_group_name, + start=self._page_context.get('next'), + ).get_result() + + next = None + next_page_link = result.get('next') + if next_page_link is not None: + next = get_query_param(next_page_link.get('href'), 'start') + self._page_context['next'] = next + if next is None: + self._has_next = False + + return result.get('instances') + + def get_all(self) -> List[dict]: + """ + Returns all results by invoking get_next() repeatedly + until all pages of results have been retrieved. + :return: A List[dict], where each element is a dict that represents an instance of Instance. + :rtype: List[dict] + """ + results = [] + while self.has_next(): + next_page = self.get_next() + results.extend(next_page) + return results + +class InstanceNetworkInterfaceIpsPager(): + """ + InstanceNetworkInterfaceIpsPager can be used to simplify the use of the "list_instance_network_interface_ips" method. + """ + + def __init__(self, + *, + client: VpcV1, + instance_id: str, + network_interface_id: str, + limit: int = None, + ) -> None: + """ + Initialize a InstanceNetworkInterfaceIpsPager object. + :param str instance_id: The instance identifier. + :param str network_interface_id: The network interface identifier. + :param int limit: (optional) The number of resources to return on a page. + """ + self._has_next = True + self._client = client + self._page_context = { 'next': None } + self._instance_id = instance_id + self._network_interface_id = network_interface_id + self._limit = limit + + def has_next(self) -> bool: + """ + Returns true if there are potentially more results to be retrieved. + """ + return self._has_next + + def get_next(self) -> List[dict]: + """ + Returns the next page of results. + :return: A List[dict], where each element is a dict that represents an instance of ReservedIP. + :rtype: List[dict] + """ + if not self.has_next(): + raise StopIteration(message='No more results available') + + result = self._client.list_instance_network_interface_ips( + instance_id=self._instance_id, + network_interface_id=self._network_interface_id, + limit=self._limit, + start=self._page_context.get('next'), + ).get_result() + + next = None + next_page_link = result.get('next') + if next_page_link is not None: + next = get_query_param(next_page_link.get('href'), 'start') + self._page_context['next'] = next + if next is None: + self._has_next = False + + return result.get('ips') + + def get_all(self) -> List[dict]: + """ + Returns all results by invoking get_next() repeatedly + until all pages of results have been retrieved. + :return: A List[dict], where each element is a dict that represents an instance of ReservedIP. + :rtype: List[dict] + """ + results = [] + while self.has_next(): + next_page = self.get_next() + results.extend(next_page) + return results + +class InstanceGroupsPager(): + """ + InstanceGroupsPager can be used to simplify the use of the "list_instance_groups" method. + """ + + def __init__(self, + *, + client: VpcV1, + limit: int = None, + ) -> None: + """ + Initialize a InstanceGroupsPager object. + :param int limit: (optional) The number of resources to return on a page. + """ + self._has_next = True + self._client = client + self._page_context = { 'next': None } + self._limit = limit + + def has_next(self) -> bool: + """ + Returns true if there are potentially more results to be retrieved. + """ + return self._has_next + + def get_next(self) -> List[dict]: + """ + Returns the next page of results. + :return: A List[dict], where each element is a dict that represents an instance of InstanceGroup. + :rtype: List[dict] + """ + if not self.has_next(): + raise StopIteration(message='No more results available') + + result = self._client.list_instance_groups( + limit=self._limit, + start=self._page_context.get('next'), + ).get_result() + + next = None + next_page_link = result.get('next') + if next_page_link is not None: + next = get_query_param(next_page_link.get('href'), 'start') + self._page_context['next'] = next + if next is None: + self._has_next = False + + return result.get('instance_groups') + + def get_all(self) -> List[dict]: + """ + Returns all results by invoking get_next() repeatedly + until all pages of results have been retrieved. + :return: A List[dict], where each element is a dict that represents an instance of InstanceGroup. + :rtype: List[dict] + """ + results = [] + while self.has_next(): + next_page = self.get_next() + results.extend(next_page) + return results + +class InstanceGroupManagersPager(): + """ + InstanceGroupManagersPager can be used to simplify the use of the "list_instance_group_managers" method. + """ + + def __init__(self, + *, + client: VpcV1, + instance_group_id: str, + limit: int = None, + ) -> None: + """ + Initialize a InstanceGroupManagersPager object. + :param str instance_group_id: The instance group identifier. + :param int limit: (optional) The number of resources to return on a page. + """ + self._has_next = True + self._client = client + self._page_context = { 'next': None } + self._instance_group_id = instance_group_id + self._limit = limit + + def has_next(self) -> bool: + """ + Returns true if there are potentially more results to be retrieved. + """ + return self._has_next + + def get_next(self) -> List[dict]: + """ + Returns the next page of results. + :return: A List[dict], where each element is a dict that represents an instance of InstanceGroupManager. + :rtype: List[dict] + """ + if not self.has_next(): + raise StopIteration(message='No more results available') + + result = self._client.list_instance_group_managers( + instance_group_id=self._instance_group_id, + limit=self._limit, + start=self._page_context.get('next'), + ).get_result() + + next = None + next_page_link = result.get('next') + if next_page_link is not None: + next = get_query_param(next_page_link.get('href'), 'start') + self._page_context['next'] = next + if next is None: + self._has_next = False + + return result.get('managers') + + def get_all(self) -> List[dict]: + """ + Returns all results by invoking get_next() repeatedly + until all pages of results have been retrieved. + :return: A List[dict], where each element is a dict that represents an instance of InstanceGroupManager. + :rtype: List[dict] + """ + results = [] + while self.has_next(): + next_page = self.get_next() + results.extend(next_page) + return results + +class InstanceGroupManagerActionsPager(): + """ + InstanceGroupManagerActionsPager can be used to simplify the use of the "list_instance_group_manager_actions" method. + """ + + def __init__(self, + *, + client: VpcV1, + instance_group_id: str, + instance_group_manager_id: str, + limit: int = None, + ) -> None: + """ + Initialize a InstanceGroupManagerActionsPager object. + :param str instance_group_id: The instance group identifier. + :param str instance_group_manager_id: The instance group manager + identifier. + :param int limit: (optional) The number of resources to return on a page. + """ + self._has_next = True + self._client = client + self._page_context = { 'next': None } + self._instance_group_id = instance_group_id + self._instance_group_manager_id = instance_group_manager_id + self._limit = limit + + def has_next(self) -> bool: + """ + Returns true if there are potentially more results to be retrieved. + """ + return self._has_next + + def get_next(self) -> List[dict]: + """ + Returns the next page of results. + :return: A List[dict], where each element is a dict that represents an instance of InstanceGroupManagerAction. + :rtype: List[dict] + """ + if not self.has_next(): + raise StopIteration(message='No more results available') + + result = self._client.list_instance_group_manager_actions( + instance_group_id=self._instance_group_id, + instance_group_manager_id=self._instance_group_manager_id, + limit=self._limit, + start=self._page_context.get('next'), + ).get_result() + + next = None + next_page_link = result.get('next') + if next_page_link is not None: + next = get_query_param(next_page_link.get('href'), 'start') + self._page_context['next'] = next + if next is None: + self._has_next = False + + return result.get('actions') + + def get_all(self) -> List[dict]: + """ + Returns all results by invoking get_next() repeatedly + until all pages of results have been retrieved. + :return: A List[dict], where each element is a dict that represents an instance of InstanceGroupManagerAction. + :rtype: List[dict] + """ + results = [] + while self.has_next(): + next_page = self.get_next() + results.extend(next_page) + return results + +class InstanceGroupManagerPoliciesPager(): + """ + InstanceGroupManagerPoliciesPager can be used to simplify the use of the "list_instance_group_manager_policies" method. + """ + + def __init__(self, + *, + client: VpcV1, + instance_group_id: str, + instance_group_manager_id: str, + limit: int = None, + ) -> None: + """ + Initialize a InstanceGroupManagerPoliciesPager object. + :param str instance_group_id: The instance group identifier. + :param str instance_group_manager_id: The instance group manager + identifier. + :param int limit: (optional) The number of resources to return on a page. + """ + self._has_next = True + self._client = client + self._page_context = { 'next': None } + self._instance_group_id = instance_group_id + self._instance_group_manager_id = instance_group_manager_id + self._limit = limit + + def has_next(self) -> bool: + """ + Returns true if there are potentially more results to be retrieved. + """ + return self._has_next + + def get_next(self) -> List[dict]: + """ + Returns the next page of results. + :return: A List[dict], where each element is a dict that represents an instance of InstanceGroupManagerPolicy. + :rtype: List[dict] + """ + if not self.has_next(): + raise StopIteration(message='No more results available') + + result = self._client.list_instance_group_manager_policies( + instance_group_id=self._instance_group_id, + instance_group_manager_id=self._instance_group_manager_id, + limit=self._limit, + start=self._page_context.get('next'), + ).get_result() + + next = None + next_page_link = result.get('next') + if next_page_link is not None: + next = get_query_param(next_page_link.get('href'), 'start') + self._page_context['next'] = next + if next is None: + self._has_next = False + + return result.get('policies') + + def get_all(self) -> List[dict]: + """ + Returns all results by invoking get_next() repeatedly + until all pages of results have been retrieved. + :return: A List[dict], where each element is a dict that represents an instance of InstanceGroupManagerPolicy. + :rtype: List[dict] + """ + results = [] + while self.has_next(): + next_page = self.get_next() + results.extend(next_page) + return results + +class InstanceGroupMembershipsPager(): + """ + InstanceGroupMembershipsPager can be used to simplify the use of the "list_instance_group_memberships" method. + """ + + def __init__(self, + *, + client: VpcV1, + instance_group_id: str, + limit: int = None, + ) -> None: + """ + Initialize a InstanceGroupMembershipsPager object. + :param str instance_group_id: The instance group identifier. + :param int limit: (optional) The number of resources to return on a page. + """ + self._has_next = True + self._client = client + self._page_context = { 'next': None } + self._instance_group_id = instance_group_id + self._limit = limit + + def has_next(self) -> bool: + """ + Returns true if there are potentially more results to be retrieved. + """ + return self._has_next + + def get_next(self) -> List[dict]: + """ + Returns the next page of results. + :return: A List[dict], where each element is a dict that represents an instance of InstanceGroupMembership. + :rtype: List[dict] + """ + if not self.has_next(): + raise StopIteration(message='No more results available') + + result = self._client.list_instance_group_memberships( + instance_group_id=self._instance_group_id, + limit=self._limit, + start=self._page_context.get('next'), + ).get_result() + + next = None + next_page_link = result.get('next') + if next_page_link is not None: + next = get_query_param(next_page_link.get('href'), 'start') + self._page_context['next'] = next + if next is None: + self._has_next = False + + return result.get('memberships') + + def get_all(self) -> List[dict]: + """ + Returns all results by invoking get_next() repeatedly + until all pages of results have been retrieved. + :return: A List[dict], where each element is a dict that represents an instance of InstanceGroupMembership. + :rtype: List[dict] + """ + results = [] + while self.has_next(): + next_page = self.get_next() + results.extend(next_page) + return results + +class DedicatedHostGroupsPager(): + """ + DedicatedHostGroupsPager can be used to simplify the use of the "list_dedicated_host_groups" method. + """ + + def __init__(self, + *, + client: VpcV1, + limit: int = None, + resource_group_id: str = None, + zone_name: str = None, + name: str = None, + ) -> None: + """ + Initialize a DedicatedHostGroupsPager object. + :param int limit: (optional) The number of resources to return on a page. + :param str resource_group_id: (optional) Filters the collection to + resources in the resource group with the specified identifier. + :param str zone_name: (optional) Filters the collection to resources in the + zone with the exact specified name. + :param str name: (optional) Filters the collection to resources with the + exact specified name. + """ + self._has_next = True + self._client = client + self._page_context = { 'next': None } + self._limit = limit + self._resource_group_id = resource_group_id + self._zone_name = zone_name + self._name = name + + def has_next(self) -> bool: + """ + Returns true if there are potentially more results to be retrieved. + """ + return self._has_next + + def get_next(self) -> List[dict]: + """ + Returns the next page of results. + :return: A List[dict], where each element is a dict that represents an instance of DedicatedHostGroup. + :rtype: List[dict] + """ + if not self.has_next(): + raise StopIteration(message='No more results available') + + result = self._client.list_dedicated_host_groups( + limit=self._limit, + resource_group_id=self._resource_group_id, + zone_name=self._zone_name, + name=self._name, + start=self._page_context.get('next'), + ).get_result() + + next = None + next_page_link = result.get('next') + if next_page_link is not None: + next = get_query_param(next_page_link.get('href'), 'start') + self._page_context['next'] = next + if next is None: + self._has_next = False + + return result.get('groups') + + def get_all(self) -> List[dict]: + """ + Returns all results by invoking get_next() repeatedly + until all pages of results have been retrieved. + :return: A List[dict], where each element is a dict that represents an instance of DedicatedHostGroup. + :rtype: List[dict] + """ + results = [] + while self.has_next(): + next_page = self.get_next() + results.extend(next_page) + return results + +class DedicatedHostProfilesPager(): + """ + DedicatedHostProfilesPager can be used to simplify the use of the "list_dedicated_host_profiles" method. + """ + + def __init__(self, + *, + client: VpcV1, + limit: int = None, + ) -> None: + """ + Initialize a DedicatedHostProfilesPager object. + :param int limit: (optional) The number of resources to return on a page. + """ + self._has_next = True + self._client = client + self._page_context = { 'next': None } + self._limit = limit + + def has_next(self) -> bool: + """ + Returns true if there are potentially more results to be retrieved. + """ + return self._has_next + + def get_next(self) -> List[dict]: + """ + Returns the next page of results. + :return: A List[dict], where each element is a dict that represents an instance of DedicatedHostProfile. + :rtype: List[dict] + """ + if not self.has_next(): + raise StopIteration(message='No more results available') + + result = self._client.list_dedicated_host_profiles( + limit=self._limit, + start=self._page_context.get('next'), + ).get_result() + + next = None + next_page_link = result.get('next') + if next_page_link is not None: + next = get_query_param(next_page_link.get('href'), 'start') + self._page_context['next'] = next + if next is None: + self._has_next = False + + return result.get('profiles') + + def get_all(self) -> List[dict]: + """ + Returns all results by invoking get_next() repeatedly + until all pages of results have been retrieved. + :return: A List[dict], where each element is a dict that represents an instance of DedicatedHostProfile. + :rtype: List[dict] + """ + results = [] + while self.has_next(): + next_page = self.get_next() + results.extend(next_page) + return results + +class DedicatedHostsPager(): + """ + DedicatedHostsPager can be used to simplify the use of the "list_dedicated_hosts" method. + """ + + def __init__(self, + *, + client: VpcV1, + dedicated_host_group_id: str = None, + limit: int = None, + resource_group_id: str = None, + zone_name: str = None, + name: str = None, + ) -> None: + """ + Initialize a DedicatedHostsPager object. + :param str dedicated_host_group_id: (optional) Filters the collection to + dedicated host groups with the specified identifier. + :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 zone_name: (optional) Filters the collection to resources in the + zone with the exact specified name. + :param str name: (optional) Filters the collection to resources with the + exact specified name. + """ + self._has_next = True + self._client = client + self._page_context = { 'next': None } + self._dedicated_host_group_id = dedicated_host_group_id + self._limit = limit + self._resource_group_id = resource_group_id + self._zone_name = zone_name + self._name = name + + def has_next(self) -> bool: + """ + Returns true if there are potentially more results to be retrieved. + """ + return self._has_next + + def get_next(self) -> List[dict]: + """ + Returns the next page of results. + :return: A List[dict], where each element is a dict that represents an instance of DedicatedHost. + :rtype: List[dict] + """ + if not self.has_next(): + raise StopIteration(message='No more results available') + + result = self._client.list_dedicated_hosts( + dedicated_host_group_id=self._dedicated_host_group_id, + limit=self._limit, + resource_group_id=self._resource_group_id, + zone_name=self._zone_name, + name=self._name, + start=self._page_context.get('next'), + ).get_result() + + next = None + next_page_link = result.get('next') + if next_page_link is not None: + next = get_query_param(next_page_link.get('href'), 'start') + self._page_context['next'] = next + if next is None: + self._has_next = False + + return result.get('dedicated_hosts') + + def get_all(self) -> List[dict]: + """ + Returns all results by invoking get_next() repeatedly + until all pages of results have been retrieved. + :return: A List[dict], where each element is a dict that represents an instance of DedicatedHost. + :rtype: List[dict] + """ + results = [] + while self.has_next(): + next_page = self.get_next() + results.extend(next_page) + return results + +class BackupPoliciesPager(): + """ + BackupPoliciesPager can be used to simplify the use of the "list_backup_policies" method. + """ + + def __init__(self, + *, + client: VpcV1, + limit: int = None, + resource_group_id: str = None, + name: str = None, + tag: str = None, + ) -> None: + """ + Initialize a BackupPoliciesPager object. + :param int limit: (optional) The number of resources to return on a page. + :param str resource_group_id: (optional) Filters the collection to + resources in the resource group with the specified identifier. + :param str name: (optional) Filters the collection to resources with the + exact specified name. + :param str tag: (optional) Filters the collection to resources with the + exact tag value. + """ + self._has_next = True + self._client = client + self._page_context = { 'next': None } + self._limit = limit + self._resource_group_id = resource_group_id + self._name = name + self._tag = tag + + def has_next(self) -> bool: + """ + Returns true if there are potentially more results to be retrieved. + """ + return self._has_next + + def get_next(self) -> List[dict]: + """ + Returns the next page of results. + :return: A List[dict], where each element is a dict that represents an instance of BackupPolicy. + :rtype: List[dict] + """ + if not self.has_next(): + raise StopIteration(message='No more results available') + + result = self._client.list_backup_policies( + limit=self._limit, + resource_group_id=self._resource_group_id, + name=self._name, + tag=self._tag, + start=self._page_context.get('next'), + ).get_result() + + next = None + next_page_link = result.get('next') + if next_page_link is not None: + next = get_query_param(next_page_link.get('href'), 'start') + self._page_context['next'] = next + if next is None: + self._has_next = False + + return result.get('backup_policies') + + def get_all(self) -> List[dict]: + """ + Returns all results by invoking get_next() repeatedly + until all pages of results have been retrieved. + :return: A List[dict], where each element is a dict that represents an instance of BackupPolicy. + :rtype: List[dict] + """ + results = [] + while self.has_next(): + next_page = self.get_next() + results.extend(next_page) + return results + +class PlacementGroupsPager(): + """ + PlacementGroupsPager can be used to simplify the use of the "list_placement_groups" method. + """ + + def __init__(self, + *, + client: VpcV1, + limit: int = None, + ) -> None: + """ + Initialize a PlacementGroupsPager object. + :param int limit: (optional) The number of resources to return on a page. + """ + self._has_next = True + self._client = client + self._page_context = { 'next': None } + self._limit = limit + + def has_next(self) -> bool: + """ + Returns true if there are potentially more results to be retrieved. + """ + return self._has_next + + def get_next(self) -> List[dict]: + """ + Returns the next page of results. + :return: A List[dict], where each element is a dict that represents an instance of PlacementGroup. + :rtype: List[dict] + """ + if not self.has_next(): + raise StopIteration(message='No more results available') + + result = self._client.list_placement_groups( + limit=self._limit, + start=self._page_context.get('next'), + ).get_result() + + next = None + next_page_link = result.get('next') + if next_page_link is not None: + next = get_query_param(next_page_link.get('href'), 'start') + self._page_context['next'] = next + if next is None: + self._has_next = False + + return result.get('placement_groups') + + def get_all(self) -> List[dict]: + """ + Returns all results by invoking get_next() repeatedly + until all pages of results have been retrieved. + :return: A List[dict], where each element is a dict that represents an instance of PlacementGroup. + :rtype: List[dict] + """ + results = [] + while self.has_next(): + next_page = self.get_next() + results.extend(next_page) + return results + +class BareMetalServerProfilesPager(): + """ + BareMetalServerProfilesPager can be used to simplify the use of the "list_bare_metal_server_profiles" method. + """ + + def __init__(self, + *, + client: VpcV1, + limit: int = None, + ) -> None: + """ + Initialize a BareMetalServerProfilesPager object. + :param int limit: (optional) The number of resources to return on a page. + """ + self._has_next = True + self._client = client + self._page_context = { 'next': None } + self._limit = limit + + def has_next(self) -> bool: + """ + Returns true if there are potentially more results to be retrieved. + """ + return self._has_next + + def get_next(self) -> List[dict]: + """ + Returns the next page of results. + :return: A List[dict], where each element is a dict that represents an instance of BareMetalServerProfile. + :rtype: List[dict] + """ + if not self.has_next(): + raise StopIteration(message='No more results available') + + result = self._client.list_bare_metal_server_profiles( + limit=self._limit, + start=self._page_context.get('next'), + ).get_result() + + next = None + next_page_link = result.get('next') + if next_page_link is not None: + next = get_query_param(next_page_link.get('href'), 'start') + self._page_context['next'] = next + if next is None: + self._has_next = False + + return result.get('profiles') + + def get_all(self) -> List[dict]: + """ + Returns all results by invoking get_next() repeatedly + until all pages of results have been retrieved. + :return: A List[dict], where each element is a dict that represents an instance of BareMetalServerProfile. + :rtype: List[dict] + """ + results = [] + while self.has_next(): + next_page = self.get_next() + results.extend(next_page) + return results + +class BareMetalServersPager(): + """ + BareMetalServersPager can be used to simplify the use of the "list_bare_metal_servers" method. + """ + + def __init__(self, + *, + client: VpcV1, + limit: int = None, + resource_group_id: str = None, + name: str = None, + vpc_id: str = None, + vpc_crn: str = None, + vpc_name: str = None, + network_interfaces_subnet_id: str = None, + network_interfaces_subnet_crn: str = None, + network_interfaces_subnet_name: str = None, + ) -> None: + """ + Initialize a BareMetalServersPager object. + :param int limit: (optional) The number of resources to return on a page. + :param str resource_group_id: (optional) Filters the collection to + resources in the resource group with the specified identifier. + :param str name: (optional) Filters the collection to resources with the + exact specified name. + :param str vpc_id: (optional) Filters the collection to resources in the + VPC with the specified identifier. + :param str vpc_crn: (optional) Filters the collection to resources in the + VPC with the specified CRN. + :param str vpc_name: (optional) Filters the collection to resources in the + VPC with the exact specified name. + :param str network_interfaces_subnet_id: (optional) Filters the collection + to bare metal servers on the subnet with the specified identifier. + :param str network_interfaces_subnet_crn: (optional) Filters the collection + to bare metal servers on the subnet with the specified CRN. + :param str network_interfaces_subnet_name: (optional) Filters the + collection to bare metal servers on the subnet with the specified name. + """ + self._has_next = True + self._client = client + self._page_context = { 'next': None } + self._limit = limit + self._resource_group_id = resource_group_id + self._name = name + self._vpc_id = vpc_id + self._vpc_crn = vpc_crn + self._vpc_name = vpc_name + self._network_interfaces_subnet_id = network_interfaces_subnet_id + self._network_interfaces_subnet_crn = network_interfaces_subnet_crn + self._network_interfaces_subnet_name = network_interfaces_subnet_name + + def has_next(self) -> bool: + """ + Returns true if there are potentially more results to be retrieved. + """ + return self._has_next + + def get_next(self) -> List[dict]: + """ + Returns the next page of results. + :return: A List[dict], where each element is a dict that represents an instance of BareMetalServer. + :rtype: List[dict] + """ + if not self.has_next(): + raise StopIteration(message='No more results available') + + result = self._client.list_bare_metal_servers( + limit=self._limit, + resource_group_id=self._resource_group_id, + name=self._name, + vpc_id=self._vpc_id, + vpc_crn=self._vpc_crn, + vpc_name=self._vpc_name, + network_interfaces_subnet_id=self._network_interfaces_subnet_id, + network_interfaces_subnet_crn=self._network_interfaces_subnet_crn, + network_interfaces_subnet_name=self._network_interfaces_subnet_name, + start=self._page_context.get('next'), + ).get_result() + + next = None + next_page_link = result.get('next') + if next_page_link is not None: + next = get_query_param(next_page_link.get('href'), 'start') + self._page_context['next'] = next + if next is None: + self._has_next = False + + return result.get('bare_metal_servers') + + def get_all(self) -> List[dict]: + """ + Returns all results by invoking get_next() repeatedly + until all pages of results have been retrieved. + :return: A List[dict], where each element is a dict that represents an instance of BareMetalServer. + :rtype: List[dict] + """ + results = [] + while self.has_next(): + next_page = self.get_next() + results.extend(next_page) + return results + +class BareMetalServerNetworkInterfacesPager(): + """ + BareMetalServerNetworkInterfacesPager can be used to simplify the use of the "list_bare_metal_server_network_interfaces" method. + """ + + def __init__(self, + *, + client: VpcV1, + bare_metal_server_id: str, + limit: int = None, + ) -> None: + """ + Initialize a BareMetalServerNetworkInterfacesPager object. + :param str bare_metal_server_id: The bare metal server identifier. + :param int limit: (optional) The number of resources to return on a page. + """ + self._has_next = True + self._client = client + self._page_context = { 'next': None } + self._bare_metal_server_id = bare_metal_server_id + self._limit = limit + + def has_next(self) -> bool: + """ + Returns true if there are potentially more results to be retrieved. + """ + return self._has_next + + def get_next(self) -> List[dict]: + """ + Returns the next page of results. + :return: A List[dict], where each element is a dict that represents an instance of BareMetalServerNetworkInterface. + :rtype: List[dict] + """ + if not self.has_next(): + raise StopIteration(message='No more results available') + + result = self._client.list_bare_metal_server_network_interfaces( + bare_metal_server_id=self._bare_metal_server_id, + limit=self._limit, + start=self._page_context.get('next'), + ).get_result() + + next = None + next_page_link = result.get('next') + if next_page_link is not None: + next = get_query_param(next_page_link.get('href'), 'start') + self._page_context['next'] = next + if next is None: + self._has_next = False + + return result.get('network_interfaces') + + def get_all(self) -> List[dict]: + """ + Returns all results by invoking get_next() repeatedly + until all pages of results have been retrieved. + :return: A List[dict], where each element is a dict that represents an instance of BareMetalServerNetworkInterface. + :rtype: List[dict] + """ + results = [] + while self.has_next(): + next_page = self.get_next() + results.extend(next_page) + return results + +class VolumeProfilesPager(): + """ + VolumeProfilesPager can be used to simplify the use of the "list_volume_profiles" method. + """ + + def __init__(self, + *, + client: VpcV1, + limit: int = None, + ) -> None: + """ + Initialize a VolumeProfilesPager object. + :param int limit: (optional) The number of resources to return on a page. + """ + self._has_next = True + self._client = client + self._page_context = { 'next': None } + self._limit = limit + + def has_next(self) -> bool: + """ + Returns true if there are potentially more results to be retrieved. + """ + return self._has_next + + def get_next(self) -> List[dict]: + """ + Returns the next page of results. + :return: A List[dict], where each element is a dict that represents an instance of VolumeProfile. + :rtype: List[dict] + """ + if not self.has_next(): + raise StopIteration(message='No more results available') + + result = self._client.list_volume_profiles( + limit=self._limit, + start=self._page_context.get('next'), + ).get_result() + + next = None + next_page_link = result.get('next') + if next_page_link is not None: + next = get_query_param(next_page_link.get('href'), 'start') + self._page_context['next'] = next + if next is None: + self._has_next = False + + return result.get('profiles') + + def get_all(self) -> List[dict]: + """ + Returns all results by invoking get_next() repeatedly + until all pages of results have been retrieved. + :return: A List[dict], where each element is a dict that represents an instance of VolumeProfile. + :rtype: List[dict] + """ + results = [] + while self.has_next(): + next_page = self.get_next() + results.extend(next_page) + return results + +class VolumesPager(): + """ + VolumesPager can be used to simplify the use of the "list_volumes" method. + """ + + def __init__(self, + *, + client: VpcV1, + limit: int = None, + name: str = None, + zone_name: str = None, + ) -> None: + """ + Initialize a VolumesPager object. + :param int limit: (optional) The number of resources to return on a page. + :param str name: (optional) Filters the collection to resources with the + exact specified name. + :param str zone_name: (optional) Filters the collection to resources in the + zone with the exact specified name. + """ + self._has_next = True + self._client = client + self._page_context = { 'next': None } + self._limit = limit + self._name = name + self._zone_name = zone_name + + def has_next(self) -> bool: + """ + Returns true if there are potentially more results to be retrieved. + """ + return self._has_next + + def get_next(self) -> List[dict]: + """ + Returns the next page of results. + :return: A List[dict], where each element is a dict that represents an instance of Volume. + :rtype: List[dict] + """ + if not self.has_next(): + raise StopIteration(message='No more results available') + + result = self._client.list_volumes( + limit=self._limit, + name=self._name, + zone_name=self._zone_name, + start=self._page_context.get('next'), + ).get_result() + + next = None + next_page_link = result.get('next') + if next_page_link is not None: + next = get_query_param(next_page_link.get('href'), 'start') + self._page_context['next'] = next + if next is None: + self._has_next = False + + return result.get('volumes') + + def get_all(self) -> List[dict]: + """ + Returns all results by invoking get_next() repeatedly + until all pages of results have been retrieved. + :return: A List[dict], where each element is a dict that represents an instance of Volume. + :rtype: List[dict] + """ + results = [] + while self.has_next(): + next_page = self.get_next() + results.extend(next_page) + return results + +class SnapshotsPager(): + """ + SnapshotsPager can be used to simplify the use of the "list_snapshots" method. + """ + + def __init__(self, + *, + client: VpcV1, + limit: int = None, + tag: str = None, + resource_group_id: str = None, + name: str = None, + source_volume_id: str = None, + source_volume_crn: str = None, + source_image_id: str = None, + source_image_crn: str = None, + sort: str = None, + backup_policy_plan_id: str = None, + ) -> None: + """ + Initialize a SnapshotsPager object. + :param int limit: (optional) The number of resources to return on a page. + :param str tag: (optional) Filters the collection to resources with the + exact tag value. + :param str resource_group_id: (optional) Filters the collection to + resources in the resource group with the specified identifier. + :param str name: (optional) Filters the collection to resources with the + exact specified name. + :param str source_volume_id: (optional) Filters the collection to resources + with the source volume with the specified identifier. + :param str source_volume_crn: (optional) Filters the collection to + resources with the source volume with the specified CRN. + :param str source_image_id: (optional) Filters the collection to resources + with the source image with the specified identifier. + This parameter also supports the values `null` and `not:null` which filter + the collection to resources which have no source image or any existent + source image, respectively. + :param str source_image_crn: (optional) Filters the collection to resources + with the source volume with the specified CRN. + This parameter also supports the values `null` and `not:null` which filter + the collection to resources which have no source image or any existent + source image, respectively. + :param str sort: (optional) Sorts the returned collection by the specified + property name in ascending order. A `-` may be prepended to the name to + sort in descending order. For example, the value `-created_at` sorts the + collection by the `created_at` property in descending order, and the value + `name` sorts it by the `name` property in ascending order. + :param str backup_policy_plan_id: (optional) Filters the collection to + backup policy jobs with the backup plan with the specified identifier. + """ + self._has_next = True + self._client = client + self._page_context = { 'next': None } + self._limit = limit + self._tag = tag + self._resource_group_id = resource_group_id + self._name = name + self._source_volume_id = source_volume_id + self._source_volume_crn = source_volume_crn + self._source_image_id = source_image_id + self._source_image_crn = source_image_crn + self._sort = sort + self._backup_policy_plan_id = backup_policy_plan_id + + def has_next(self) -> bool: + """ + Returns true if there are potentially more results to be retrieved. + """ + return self._has_next + + def get_next(self) -> List[dict]: + """ + Returns the next page of results. + :return: A List[dict], where each element is a dict that represents an instance of Snapshot. + :rtype: List[dict] + """ + if not self.has_next(): + raise StopIteration(message='No more results available') + + result = self._client.list_snapshots( + limit=self._limit, + tag=self._tag, + resource_group_id=self._resource_group_id, + name=self._name, + source_volume_id=self._source_volume_id, + source_volume_crn=self._source_volume_crn, + source_image_id=self._source_image_id, + source_image_crn=self._source_image_crn, + sort=self._sort, + backup_policy_plan_id=self._backup_policy_plan_id, + start=self._page_context.get('next'), + ).get_result() + + next = None + next_page_link = result.get('next') + if next_page_link is not None: + next = get_query_param(next_page_link.get('href'), 'start') + self._page_context['next'] = next + if next is None: + self._has_next = False + + return result.get('snapshots') + + def get_all(self) -> List[dict]: + """ + Returns all results by invoking get_next() repeatedly + until all pages of results have been retrieved. + :return: A List[dict], where each element is a dict that represents an instance of Snapshot. + :rtype: List[dict] + """ + results = [] + while self.has_next(): + next_page = self.get_next() + results.extend(next_page) + return results + +class PublicGatewaysPager(): + """ + PublicGatewaysPager can be used to simplify the use of the "list_public_gateways" method. + """ + + def __init__(self, + *, + client: VpcV1, + limit: int = None, + resource_group_id: str = None, + ) -> None: + """ + Initialize a PublicGatewaysPager object. + :param int limit: (optional) The number of resources to return on a page. + :param str resource_group_id: (optional) Filters the collection to + resources in the resource group with the specified identifier. + """ + self._has_next = True + self._client = client + self._page_context = { 'next': None } + self._limit = limit + self._resource_group_id = resource_group_id + + def has_next(self) -> bool: + """ + Returns true if there are potentially more results to be retrieved. + """ + return self._has_next + + def get_next(self) -> List[dict]: + """ + Returns the next page of results. + :return: A List[dict], where each element is a dict that represents an instance of PublicGateway. + :rtype: List[dict] + """ + if not self.has_next(): + raise StopIteration(message='No more results available') + + result = self._client.list_public_gateways( + limit=self._limit, + resource_group_id=self._resource_group_id, + start=self._page_context.get('next'), + ).get_result() + + next = None + next_page_link = result.get('next') + if next_page_link is not None: + next = get_query_param(next_page_link.get('href'), 'start') + self._page_context['next'] = next + if next is None: + self._has_next = False + + return result.get('public_gateways') + + def get_all(self) -> List[dict]: + """ + Returns all results by invoking get_next() repeatedly + until all pages of results have been retrieved. + :return: A List[dict], where each element is a dict that represents an instance of PublicGateway. + :rtype: List[dict] + """ + results = [] + while self.has_next(): + next_page = self.get_next() + results.extend(next_page) + return results + +class FloatingIpsPager(): + """ + FloatingIpsPager can be used to simplify the use of the "list_floating_ips" method. + """ + + def __init__(self, + *, + client: VpcV1, + limit: int = None, + resource_group_id: str = None, + sort: str = None, + ) -> None: + """ + Initialize a FloatingIpsPager object. + :param int limit: (optional) The number of resources to return on a page. + :param str resource_group_id: (optional) Filters the collection to + resources 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. + """ + self._has_next = True + self._client = client + self._page_context = { 'next': None } + self._limit = limit + self._resource_group_id = resource_group_id + self._sort = sort + + def has_next(self) -> bool: + """ + Returns true if there are potentially more results to be retrieved. + """ + return self._has_next + + def get_next(self) -> List[dict]: + """ + Returns the next page of results. + :return: A List[dict], where each element is a dict that represents an instance of FloatingIP. + :rtype: List[dict] + """ + if not self.has_next(): + raise StopIteration(message='No more results available') + + result = self._client.list_floating_ips( + limit=self._limit, + resource_group_id=self._resource_group_id, + sort=self._sort, + start=self._page_context.get('next'), + ).get_result() + + next = None + next_page_link = result.get('next') + if next_page_link is not None: + next = get_query_param(next_page_link.get('href'), 'start') + self._page_context['next'] = next + if next is None: + self._has_next = False + + return result.get('floating_ips') + + def get_all(self) -> List[dict]: + """ + Returns all results by invoking get_next() repeatedly + until all pages of results have been retrieved. + :return: A List[dict], where each element is a dict that represents an instance of FloatingIP. + :rtype: List[dict] + """ + results = [] + while self.has_next(): + next_page = self.get_next() + results.extend(next_page) + return results + +class NetworkAclsPager(): + """ + NetworkAclsPager can be used to simplify the use of the "list_network_acls" method. + """ + + def __init__(self, + *, + client: VpcV1, + limit: int = None, + resource_group_id: str = None, + ) -> None: + """ + Initialize a NetworkAclsPager object. + :param int limit: (optional) The number of resources to return on a page. + :param str resource_group_id: (optional) Filters the collection to + resources in the resource group with the specified identifier. + """ + self._has_next = True + self._client = client + self._page_context = { 'next': None } + self._limit = limit + self._resource_group_id = resource_group_id + + def has_next(self) -> bool: + """ + Returns true if there are potentially more results to be retrieved. + """ + return self._has_next + + def get_next(self) -> List[dict]: + """ + Returns the next page of results. + :return: A List[dict], where each element is a dict that represents an instance of NetworkACL. + :rtype: List[dict] + """ + if not self.has_next(): + raise StopIteration(message='No more results available') + + result = self._client.list_network_acls( + limit=self._limit, + resource_group_id=self._resource_group_id, + start=self._page_context.get('next'), + ).get_result() + + next = None + next_page_link = result.get('next') + if next_page_link is not None: + next = get_query_param(next_page_link.get('href'), 'start') + self._page_context['next'] = next + if next is None: + self._has_next = False + + return result.get('network_acls') + + def get_all(self) -> List[dict]: + """ + Returns all results by invoking get_next() repeatedly + until all pages of results have been retrieved. + :return: A List[dict], where each element is a dict that represents an instance of NetworkACL. + :rtype: List[dict] + """ + results = [] + while self.has_next(): + next_page = self.get_next() + results.extend(next_page) + return results + +class NetworkAclRulesPager(): + """ + NetworkAclRulesPager can be used to simplify the use of the "list_network_acl_rules" method. + """ + + def __init__(self, + *, + client: VpcV1, + network_acl_id: str, + limit: int = None, + direction: str = None, + ) -> None: + """ + Initialize a NetworkAclRulesPager object. + :param str network_acl_id: The network ACL identifier. + :param int limit: (optional) The number of resources to return on a page. + :param str direction: (optional) Filters the collection to rules with the + specified direction. + """ + self._has_next = True + self._client = client + self._page_context = { 'next': None } + self._network_acl_id = network_acl_id + self._limit = limit + self._direction = direction + + def has_next(self) -> bool: + """ + Returns true if there are potentially more results to be retrieved. + """ + return self._has_next + + def get_next(self) -> List[dict]: + """ + Returns the next page of results. + :return: A List[dict], where each element is a dict that represents an instance of NetworkACLRuleItem. + :rtype: List[dict] + """ + if not self.has_next(): + raise StopIteration(message='No more results available') + + result = self._client.list_network_acl_rules( + network_acl_id=self._network_acl_id, + limit=self._limit, + direction=self._direction, + start=self._page_context.get('next'), + ).get_result() + + next = None + next_page_link = result.get('next') + if next_page_link is not None: + next = get_query_param(next_page_link.get('href'), 'start') + self._page_context['next'] = next + if next is None: + self._has_next = False + + return result.get('rules') + + def get_all(self) -> List[dict]: + """ + Returns all results by invoking get_next() repeatedly + until all pages of results have been retrieved. + :return: A List[dict], where each element is a dict that represents an instance of NetworkACLRuleItem. + :rtype: List[dict] + """ + results = [] + while self.has_next(): + next_page = self.get_next() + results.extend(next_page) + return results + +class SecurityGroupsPager(): + """ + SecurityGroupsPager can be used to simplify the use of the "list_security_groups" method. + """ + + def __init__(self, + *, + client: VpcV1, + limit: int = None, + resource_group_id: str = None, + vpc_id: str = None, + vpc_crn: str = None, + vpc_name: str = None, + ) -> None: + """ + Initialize a SecurityGroupsPager object. + :param int limit: (optional) The number of resources to return on a page. + :param str resource_group_id: (optional) Filters the collection to + resources in the resource group with the specified identifier. + :param str vpc_id: (optional) Filters the collection to resources in the + VPC with the specified identifier. + :param str vpc_crn: (optional) Filters the collection to resources in the + VPC with the specified CRN. + :param str vpc_name: (optional) Filters the collection to resources in the + VPC with the exact specified name. + """ + self._has_next = True + self._client = client + self._page_context = { 'next': None } + self._limit = limit + self._resource_group_id = resource_group_id + self._vpc_id = vpc_id + self._vpc_crn = vpc_crn + self._vpc_name = vpc_name + + def has_next(self) -> bool: + """ + Returns true if there are potentially more results to be retrieved. + """ + return self._has_next + + def get_next(self) -> List[dict]: + """ + Returns the next page of results. + :return: A List[dict], where each element is a dict that represents an instance of SecurityGroup. + :rtype: List[dict] + """ + if not self.has_next(): + raise StopIteration(message='No more results available') + + result = self._client.list_security_groups( + limit=self._limit, + resource_group_id=self._resource_group_id, + vpc_id=self._vpc_id, + vpc_crn=self._vpc_crn, + vpc_name=self._vpc_name, + start=self._page_context.get('next'), + ).get_result() + + next = None + next_page_link = result.get('next') + if next_page_link is not None: + next = get_query_param(next_page_link.get('href'), 'start') + self._page_context['next'] = next + if next is None: + self._has_next = False + + return result.get('security_groups') + + def get_all(self) -> List[dict]: + """ + Returns all results by invoking get_next() repeatedly + until all pages of results have been retrieved. + :return: A List[dict], where each element is a dict that represents an instance of SecurityGroup. + :rtype: List[dict] + """ + results = [] + while self.has_next(): + next_page = self.get_next() + results.extend(next_page) + return results + +class SecurityGroupTargetsPager(): + """ + SecurityGroupTargetsPager can be used to simplify the use of the "list_security_group_targets" method. + """ + + def __init__(self, + *, + client: VpcV1, + security_group_id: str, + limit: int = None, + ) -> None: + """ + Initialize a SecurityGroupTargetsPager object. + :param str security_group_id: The security group identifier. + :param int limit: (optional) The number of resources to return on a page. + """ + self._has_next = True + self._client = client + self._page_context = { 'next': None } + self._security_group_id = security_group_id + self._limit = limit + + def has_next(self) -> bool: + """ + Returns true if there are potentially more results to be retrieved. + """ + return self._has_next + + def get_next(self) -> List[dict]: + """ + Returns the next page of results. + :return: A List[dict], where each element is a dict that represents an instance of SecurityGroupTargetReference. + :rtype: List[dict] + """ + if not self.has_next(): + raise StopIteration(message='No more results available') + + result = self._client.list_security_group_targets( + security_group_id=self._security_group_id, + limit=self._limit, + start=self._page_context.get('next'), + ).get_result() + + next = None + next_page_link = result.get('next') + if next_page_link is not None: + next = get_query_param(next_page_link.get('href'), 'start') + self._page_context['next'] = next + if next is None: + self._has_next = False + + return result.get('targets') + + def get_all(self) -> List[dict]: + """ + Returns all results by invoking get_next() repeatedly + until all pages of results have been retrieved. + :return: A List[dict], where each element is a dict that represents an instance of SecurityGroupTargetReference. + :rtype: List[dict] + """ + results = [] + while self.has_next(): + next_page = self.get_next() + results.extend(next_page) + return results + +class IkePoliciesPager(): + """ + IkePoliciesPager can be used to simplify the use of the "list_ike_policies" method. + """ + + def __init__(self, + *, + client: VpcV1, + limit: int = None, + ) -> None: + """ + Initialize a IkePoliciesPager object. + :param int limit: (optional) The number of resources to return on a page. + """ + self._has_next = True + self._client = client + self._page_context = { 'next': None } + self._limit = limit + + def has_next(self) -> bool: + """ + Returns true if there are potentially more results to be retrieved. + """ + return self._has_next + + def get_next(self) -> List[dict]: + """ + Returns the next page of results. + :return: A List[dict], where each element is a dict that represents an instance of IKEPolicy. + :rtype: List[dict] + """ + if not self.has_next(): + raise StopIteration(message='No more results available') + + result = self._client.list_ike_policies( + limit=self._limit, + start=self._page_context.get('next'), + ).get_result() + + next = None + next_page_link = result.get('next') + if next_page_link is not None: + next = get_query_param(next_page_link.get('href'), 'start') + self._page_context['next'] = next + if next is None: + self._has_next = False + + return result.get('ike_policies') + + def get_all(self) -> List[dict]: + """ + Returns all results by invoking get_next() repeatedly + until all pages of results have been retrieved. + :return: A List[dict], where each element is a dict that represents an instance of IKEPolicy. + :rtype: List[dict] + """ + results = [] + while self.has_next(): + next_page = self.get_next() + results.extend(next_page) + return results + +class IpsecPoliciesPager(): + """ + IpsecPoliciesPager can be used to simplify the use of the "list_ipsec_policies" method. + """ + + def __init__(self, + *, + client: VpcV1, + limit: int = None, + ) -> None: + """ + Initialize a IpsecPoliciesPager object. + :param int limit: (optional) The number of resources to return on a page. + """ + self._has_next = True + self._client = client + self._page_context = { 'next': None } + self._limit = limit + + def has_next(self) -> bool: + """ + Returns true if there are potentially more results to be retrieved. + """ + return self._has_next + + def get_next(self) -> List[dict]: + """ + Returns the next page of results. + :return: A List[dict], where each element is a dict that represents an instance of IPsecPolicy. + :rtype: List[dict] + """ + if not self.has_next(): + raise StopIteration(message='No more results available') + + result = self._client.list_ipsec_policies( + limit=self._limit, + start=self._page_context.get('next'), + ).get_result() + + next = None + next_page_link = result.get('next') + if next_page_link is not None: + next = get_query_param(next_page_link.get('href'), 'start') + self._page_context['next'] = next + if next is None: + self._has_next = False + + return result.get('ipsec_policies') + + def get_all(self) -> List[dict]: + """ + Returns all results by invoking get_next() repeatedly + until all pages of results have been retrieved. + :return: A List[dict], where each element is a dict that represents an instance of IPsecPolicy. + :rtype: List[dict] + """ + results = [] + while self.has_next(): + next_page = self.get_next() + results.extend(next_page) + return results + +class VpnGatewaysPager(): + """ + VpnGatewaysPager can be used to simplify the use of the "list_vpn_gateways" method. + """ + + def __init__(self, + *, + client: VpcV1, + limit: int = None, + resource_group_id: str = None, + sort: str = None, + mode: str = None, + ) -> None: + """ + Initialize a VpnGatewaysPager object. + :param int limit: (optional) The number of resources to return on a page. + :param str resource_group_id: (optional) Filters the collection to + resources 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 str mode: (optional) Filters the collection to VPN gateways with the + specified mode. + """ + self._has_next = True + self._client = client + self._page_context = { 'next': None } + self._limit = limit + self._resource_group_id = resource_group_id + self._sort = sort + self._mode = mode + + def has_next(self) -> bool: + """ + Returns true if there are potentially more results to be retrieved. + """ + return self._has_next + + def get_next(self) -> List[dict]: + """ + Returns the next page of results. + :return: A List[dict], where each element is a dict that represents an instance of VPNGateway. + :rtype: List[dict] + """ + if not self.has_next(): + raise StopIteration(message='No more results available') + + result = self._client.list_vpn_gateways( + limit=self._limit, + resource_group_id=self._resource_group_id, + sort=self._sort, + mode=self._mode, + start=self._page_context.get('next'), + ).get_result() + + next = None + next_page_link = result.get('next') + if next_page_link is not None: + next = get_query_param(next_page_link.get('href'), 'start') + self._page_context['next'] = next + if next is None: + self._has_next = False + + return result.get('vpn_gateways') + + def get_all(self) -> List[dict]: + """ + Returns all results by invoking get_next() repeatedly + until all pages of results have been retrieved. + :return: A List[dict], where each element is a dict that represents an instance of VPNGateway. + :rtype: List[dict] + """ + results = [] + while self.has_next(): + next_page = self.get_next() + results.extend(next_page) + return results + +class VpnServersPager(): + """ + VpnServersPager can be used to simplify the use of the "list_vpn_servers" method. + """ + + def __init__(self, + *, + client: VpcV1, + name: str = None, + limit: int = None, + resource_group_id: str = None, + sort: str = None, + ) -> None: + """ + Initialize a VpnServersPager object. + :param str name: (optional) Filters the collection to resources with the + exact specified name. + :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. + """ + self._has_next = True + self._client = client + self._page_context = { 'next': None } + self._name = name + self._limit = limit + self._resource_group_id = resource_group_id + self._sort = sort + + def has_next(self) -> bool: + """ + Returns true if there are potentially more results to be retrieved. + """ + return self._has_next + + def get_next(self) -> List[dict]: + """ + Returns the next page of results. + :return: A List[dict], where each element is a dict that represents an instance of VPNServer. + :rtype: List[dict] + """ + if not self.has_next(): + raise StopIteration(message='No more results available') + + result = self._client.list_vpn_servers( + name=self._name, + limit=self._limit, + resource_group_id=self._resource_group_id, + sort=self._sort, + start=self._page_context.get('next'), + ).get_result() + + next = None + next_page_link = result.get('next') + if next_page_link is not None: + next = get_query_param(next_page_link.get('href'), 'start') + self._page_context['next'] = next + if next is None: + self._has_next = False + + return result.get('vpn_servers') + + def get_all(self) -> List[dict]: + """ + Returns all results by invoking get_next() repeatedly + until all pages of results have been retrieved. + :return: A List[dict], where each element is a dict that represents an instance of VPNServer. + :rtype: List[dict] + """ + results = [] + while self.has_next(): + next_page = self.get_next() + results.extend(next_page) + return results + +class VpnServerClientsPager(): + """ + VpnServerClientsPager can be used to simplify the use of the "list_vpn_server_clients" method. + """ + + def __init__(self, + *, + client: VpcV1, + vpn_server_id: str, + limit: int = None, + sort: str = None, + ) -> None: + """ + Initialize a VpnServerClientsPager object. + :param str vpn_server_id: The VPN server identifier. + :param int limit: (optional) The number of resources to return on a page. + :param str sort: (optional) Sorts the returned collection by the specified + property name in ascending order. A `-` may be prepended to the name to + sort in descending order. For example, the value `-created_at` sorts the + collection by the `created_at` property in descending order. + """ + self._has_next = True + self._client = client + self._page_context = { 'next': None } + self._vpn_server_id = vpn_server_id + self._limit = limit + self._sort = sort + + def has_next(self) -> bool: + """ + Returns true if there are potentially more results to be retrieved. + """ + return self._has_next + + def get_next(self) -> List[dict]: + """ + Returns the next page of results. + :return: A List[dict], where each element is a dict that represents an instance of VPNServerClient. + :rtype: List[dict] + """ + if not self.has_next(): + raise StopIteration(message='No more results available') + + result = self._client.list_vpn_server_clients( + vpn_server_id=self._vpn_server_id, + limit=self._limit, + sort=self._sort, + start=self._page_context.get('next'), + ).get_result() + + next = None + next_page_link = result.get('next') + if next_page_link is not None: + next = get_query_param(next_page_link.get('href'), 'start') + self._page_context['next'] = next + if next is None: + self._has_next = False + + return result.get('clients') + + def get_all(self) -> List[dict]: + """ + Returns all results by invoking get_next() repeatedly + until all pages of results have been retrieved. + :return: A List[dict], where each element is a dict that represents an instance of VPNServerClient. + :rtype: List[dict] + """ + results = [] + while self.has_next(): + next_page = self.get_next() + results.extend(next_page) + return results + +class VpnServerRoutesPager(): + """ + VpnServerRoutesPager can be used to simplify the use of the "list_vpn_server_routes" method. + """ + + def __init__(self, + *, + client: VpcV1, + vpn_server_id: str, + limit: int = None, + sort: str = None, + ) -> None: + """ + Initialize a VpnServerRoutesPager object. + :param str vpn_server_id: The VPN server identifier. + :param int limit: (optional) The number of resources to return on a page. + :param str sort: (optional) Sorts the returned collection by the specified + property name in ascending order. A `-` may be prepended to the name to + sort in descending order. For example, the value `-created_at` sorts the + collection by the `created_at` property in descending order, and the value + `name` sorts it by the `name` property in ascending order. + """ + self._has_next = True + self._client = client + self._page_context = { 'next': None } + self._vpn_server_id = vpn_server_id + self._limit = limit + self._sort = sort + + def has_next(self) -> bool: + """ + Returns true if there are potentially more results to be retrieved. + """ + return self._has_next + + def get_next(self) -> List[dict]: + """ + Returns the next page of results. + :return: A List[dict], where each element is a dict that represents an instance of VPNServerRoute. + :rtype: List[dict] + """ + if not self.has_next(): + raise StopIteration(message='No more results available') + + result = self._client.list_vpn_server_routes( + vpn_server_id=self._vpn_server_id, + limit=self._limit, + sort=self._sort, + start=self._page_context.get('next'), + ).get_result() + + next = None + next_page_link = result.get('next') + if next_page_link is not None: + next = get_query_param(next_page_link.get('href'), 'start') + self._page_context['next'] = next + if next is None: + self._has_next = False + + return result.get('routes') + + def get_all(self) -> List[dict]: + """ + Returns all results by invoking get_next() repeatedly + until all pages of results have been retrieved. + :return: A List[dict], where each element is a dict that represents an instance of VPNServerRoute. + :rtype: List[dict] + """ + results = [] + while self.has_next(): + next_page = self.get_next() + results.extend(next_page) + return results + +class LoadBalancerProfilesPager(): + """ + LoadBalancerProfilesPager can be used to simplify the use of the "list_load_balancer_profiles" method. + """ + + def __init__(self, + *, + client: VpcV1, + limit: int = None, + ) -> None: + """ + Initialize a LoadBalancerProfilesPager object. + :param int limit: (optional) The number of resources to return on a page. + """ + self._has_next = True + self._client = client + self._page_context = { 'next': None } + self._limit = limit + + def has_next(self) -> bool: + """ + Returns true if there are potentially more results to be retrieved. + """ + return self._has_next + + def get_next(self) -> List[dict]: + """ + Returns the next page of results. + :return: A List[dict], where each element is a dict that represents an instance of LoadBalancerProfile. + :rtype: List[dict] + """ + if not self.has_next(): + raise StopIteration(message='No more results available') + + result = self._client.list_load_balancer_profiles( + limit=self._limit, + start=self._page_context.get('next'), + ).get_result() + + next = None + next_page_link = result.get('next') + if next_page_link is not None: + next = get_query_param(next_page_link.get('href'), 'start') + self._page_context['next'] = next + if next is None: + self._has_next = False + + return result.get('profiles') + + def get_all(self) -> List[dict]: + """ + Returns all results by invoking get_next() repeatedly + until all pages of results have been retrieved. + :return: A List[dict], where each element is a dict that represents an instance of LoadBalancerProfile. + :rtype: List[dict] + """ + results = [] + while self.has_next(): + next_page = self.get_next() + results.extend(next_page) + return results + +class LoadBalancersPager(): + """ + LoadBalancersPager can be used to simplify the use of the "list_load_balancers" method. + """ + + def __init__(self, + *, + client: VpcV1, + limit: int = None, + ) -> None: + """ + Initialize a LoadBalancersPager object. + :param int limit: (optional) The number of resources to return on a page. + """ + self._has_next = True + self._client = client + self._page_context = { 'next': None } + self._limit = limit + + def has_next(self) -> bool: + """ + Returns true if there are potentially more results to be retrieved. + """ + return self._has_next + + def get_next(self) -> List[dict]: + """ + Returns the next page of results. + :return: A List[dict], where each element is a dict that represents an instance of LoadBalancer. + :rtype: List[dict] + """ + if not self.has_next(): + raise StopIteration(message='No more results available') + + result = self._client.list_load_balancers( + limit=self._limit, + start=self._page_context.get('next'), + ).get_result() + + next = None + next_page_link = result.get('next') + if next_page_link is not None: + next = get_query_param(next_page_link.get('href'), 'start') + self._page_context['next'] = next + if next is None: + self._has_next = False + + return result.get('load_balancers') + + def get_all(self) -> List[dict]: + """ + Returns all results by invoking get_next() repeatedly + until all pages of results have been retrieved. + :return: A List[dict], where each element is a dict that represents an instance of LoadBalancer. + :rtype: List[dict] + """ + results = [] + while self.has_next(): + next_page = self.get_next() + results.extend(next_page) + return results + +class EndpointGatewaysPager(): + """ + EndpointGatewaysPager can be used to simplify the use of the "list_endpoint_gateways" method. + """ + + def __init__(self, + *, + client: VpcV1, + name: str = None, + limit: int = None, + resource_group_id: str = None, + ) -> None: + """ + Initialize a EndpointGatewaysPager object. + :param str name: (optional) Filters the collection to resources with the + exact specified name. + :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. + """ + self._has_next = True + self._client = client + self._page_context = { 'next': None } + self._name = name + self._limit = limit + self._resource_group_id = resource_group_id + + def has_next(self) -> bool: + """ + Returns true if there are potentially more results to be retrieved. + """ + return self._has_next + + def get_next(self) -> List[dict]: + """ + Returns the next page of results. + :return: A List[dict], where each element is a dict that represents an instance of EndpointGateway. + :rtype: List[dict] + """ + if not self.has_next(): + raise StopIteration(message='No more results available') + + result = self._client.list_endpoint_gateways( + name=self._name, + limit=self._limit, + resource_group_id=self._resource_group_id, + start=self._page_context.get('next'), + ).get_result() + + next = None + next_page_link = result.get('next') + if next_page_link is not None: + next = get_query_param(next_page_link.get('href'), 'start') + self._page_context['next'] = next + if next is None: + self._has_next = False + + return result.get('endpoint_gateways') + + def get_all(self) -> List[dict]: + """ + Returns all results by invoking get_next() repeatedly + until all pages of results have been retrieved. + :return: A List[dict], where each element is a dict that represents an instance of EndpointGateway. + :rtype: List[dict] + """ + results = [] + while self.has_next(): + next_page = self.get_next() + results.extend(next_page) + return results + +class EndpointGatewayIpsPager(): + """ + EndpointGatewayIpsPager can be used to simplify the use of the "list_endpoint_gateway_ips" method. + """ + + def __init__(self, + *, + client: VpcV1, + endpoint_gateway_id: str, + limit: int = None, + sort: str = None, + ) -> None: + """ + Initialize a EndpointGatewayIpsPager object. + :param str endpoint_gateway_id: The endpoint gateway identifier. + :param int limit: (optional) The number of resources to return on a page. + :param str sort: (optional) Sorts the returned collection by the specified + property name in ascending order. A `-` may be prepended to the name to + sort in descending order. For example, the value `-created_at` sorts the + collection by the `created_at` property in descending order, and the value + `name` sorts it by the `name` property in ascending order. + """ + self._has_next = True + self._client = client + self._page_context = { 'next': None } + self._endpoint_gateway_id = endpoint_gateway_id + self._limit = limit + self._sort = sort + + def has_next(self) -> bool: + """ + Returns true if there are potentially more results to be retrieved. + """ + return self._has_next + + def get_next(self) -> List[dict]: + """ + Returns the next page of results. + :return: A List[dict], where each element is a dict that represents an instance of ReservedIP. + :rtype: List[dict] + """ + if not self.has_next(): + raise StopIteration(message='No more results available') + + result = self._client.list_endpoint_gateway_ips( + endpoint_gateway_id=self._endpoint_gateway_id, + limit=self._limit, + sort=self._sort, + start=self._page_context.get('next'), + ).get_result() + + next = None + next_page_link = result.get('next') + if next_page_link is not None: + next = get_query_param(next_page_link.get('href'), 'start') + self._page_context['next'] = next + if next is None: + self._has_next = False + + return result.get('ips') + + def get_all(self) -> List[dict]: + """ + Returns all results by invoking get_next() repeatedly + until all pages of results have been retrieved. + :return: A List[dict], where each element is a dict that represents an instance of ReservedIP. + :rtype: List[dict] + """ + results = [] + while self.has_next(): + next_page = self.get_next() + results.extend(next_page) + return results + +class FlowLogCollectorsPager(): + """ + FlowLogCollectorsPager can be used to simplify the use of the "list_flow_log_collectors" method. + """ + + def __init__(self, + *, + client: VpcV1, + limit: int = None, + resource_group_id: str = None, + name: str = None, + vpc_id: str = None, + vpc_crn: str = None, + vpc_name: str = None, + target_id: str = None, + target_resource_type: str = None, + ) -> None: + """ + Initialize a FlowLogCollectorsPager object. + :param int limit: (optional) The number of resources to return on a page. + :param str resource_group_id: (optional) Filters the collection to + resources in the resource group with the specified identifier. + :param str name: (optional) Filters the collection to resources with the + exact specified name. + :param str vpc_id: (optional) Filters the collection to resources in the + VPC with the specified identifier. + :param str vpc_crn: (optional) Filters the collection to resources in the + VPC with the specified CRN. + :param str vpc_name: (optional) Filters the collection to resources in the + VPC with the exact specified name. + :param str target_id: (optional) Filters the collection to flow log + collectors that target the specified resource. + :param str target_resource_type: (optional) Filters the collection to flow + log collectors that target the specified resource type. + """ + self._has_next = True + self._client = client + self._page_context = { 'next': None } + self._limit = limit + self._resource_group_id = resource_group_id + self._name = name + self._vpc_id = vpc_id + self._vpc_crn = vpc_crn + self._vpc_name = vpc_name + self._target_id = target_id + self._target_resource_type = target_resource_type + + def has_next(self) -> bool: + """ + Returns true if there are potentially more results to be retrieved. + """ + return self._has_next + + def get_next(self) -> List[dict]: + """ + Returns the next page of results. + :return: A List[dict], where each element is a dict that represents an instance of FlowLogCollector. + :rtype: List[dict] + """ + if not self.has_next(): + raise StopIteration(message='No more results available') + + result = self._client.list_flow_log_collectors( + limit=self._limit, + resource_group_id=self._resource_group_id, + name=self._name, + vpc_id=self._vpc_id, + vpc_crn=self._vpc_crn, + vpc_name=self._vpc_name, + target_id=self._target_id, + target_resource_type=self._target_resource_type, + start=self._page_context.get('next'), + ).get_result() + + next = None + next_page_link = result.get('next') + if next_page_link is not None: + next = get_query_param(next_page_link.get('href'), 'start') + self._page_context['next'] = next + if next is None: + self._has_next = False + + return result.get('flow_log_collectors') + + def get_all(self) -> List[dict]: + """ + Returns all results by invoking get_next() repeatedly + until all pages of results have been retrieved. + :return: A List[dict], where each element is a dict that represents an instance of FlowLogCollector. + :rtype: List[dict] + """ + results = [] + while self.has_next(): + next_page = self.get_next() + results.extend(next_page) + return results diff --git a/requirements-dev.txt b/requirements-dev.txt index c764632..b9a5528 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,7 +1,7 @@ # test dependencies coverage>=4.5.4 pylint>=2.6.0,<3.0.0 -pytest>=6.2.1,<=7.0.0 +pytest>=7.0.1,<8.0.0 pytest-cov>=2.2.1,<3.0.0 pytest-rerunfailures>=3.1 responses>=0.12.1,<1.0.0 diff --git a/requirements.txt b/requirements.txt index fa59106..f67fdfe 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ python_dateutil>=2.5.3,<3.0.0 -ibm_cloud_sdk_core>=3.15.2 +ibm_cloud_sdk_core>=3.16.0 diff --git a/test/integration/test_gen2.py b/test/integration/test_gen2.py index 77bfb1b..ce65e32 100644 --- a/test/integration/test_gen2.py +++ b/test/integration/test_gen2.py @@ -1097,10 +1097,12 @@ def test_get_load_balancer(self, createGen2Service): load_balancer = get_load_balancer( createGen2Service, store['created_load_balancer']) assertGetPatchResponse(load_balancer) + store['created_load_balancer_etag'] = load_balancer.get_headers()['ETag'] def test_update_load_balancer(self, createGen2Service): load_balancer = update_load_balancer( - createGen2Service, store['created_load_balancer']) + createGen2Service, store['created_load_balancer'], + store['created_load_balancer_etag']) assertGetPatchResponse(load_balancer) def test_get_load_balancer_statistics(self, createGen2Service): @@ -1265,7 +1267,8 @@ def test_delete_pool(self, createGen2Service): # delete load balancer def test_delete_load_balancer(self, createGen2Service): load_balancer = delete_load_balancer( - createGen2Service, store['created_load_balancer']) + createGen2Service, store['created_load_balancer'], + store['created_load_balancer_etag']) assertDeleteResponse(load_balancer) @@ -2842,8 +2845,8 @@ def create_load_balancer(service, subnet): # -------------------------------------------------------- -def delete_load_balancer(service, id): - response = service.delete_load_balancer(id) +def delete_load_balancer(service, id, etag): + response = service.delete_load_balancer(id, if_match=etag) return response # -------------------------------------------------------- @@ -2859,12 +2862,13 @@ def get_load_balancer(service, id): # -------------------------------------------------------- # update_load_balancer() # -------------------------------------------------------- -def update_load_balancer(service, id): +def update_load_balancer(service, id, etag): load_balancer_patch = {} load_balancer_patch['name'] = generate_name('lb') response = service.update_load_balancer( id, load_balancer_patch, + if_match = etag, ) return response diff --git a/test/unit/test_vpc_v1.py b/test/unit/test_vpc_v1.py index cbcbd87..ac2ac47 100644 --- a/test/unit/test_vpc_v1.py +++ b/test/unit/test_vpc_v1.py @@ -118,6 +118,7 @@ def test_new_instance_required_param_none(self): service = VpcV1.new_instance( version=None, ) + class TestListVpcs(): """ Test Class for list_vpcs @@ -225,7 +226,6 @@ def test_list_vpcs_value_error(self): with pytest.raises(ValueError): _service.list_vpcs(**req_copy) - def test_list_vpcs_value_error_with_retries(self): # Enable retries and run test_list_vpcs_value_error. _service.enable_retries() @@ -235,6 +235,71 @@ def test_list_vpcs_value_error_with_retries(self): _service.disable_retries() self.test_list_vpcs_value_error() + @responses.activate + def test_list_vpcs_with_pager_get_next(self): + """ + test_list_vpcs_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/vpcs') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"vpcs":[{"classic_access":false,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","cse_source_ips":[{"ip":{"address":"192.168.3.4"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"default_network_acl":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf","id":"a4e28308-8ee7-46ab-8108-9f881f22bdbf","name":"my-network-acl"},"default_routing_table":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","name":"my-routing-table-1","resource_type":"routing_table"},"default_security_group":{"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"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"vpc","status":"available"}]}' + mock_response2 = '{"total_count":2,"limit":1,"vpcs":[{"classic_access":false,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","cse_source_ips":[{"ip":{"address":"192.168.3.4"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"default_network_acl":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf","id":"a4e28308-8ee7-46ab-8108-9f881f22bdbf","name":"my-network-acl"},"default_routing_table":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","name":"my-routing-table-1","resource_type":"routing_table"},"default_security_group":{"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"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"vpc","status":"available"}]}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + all_results = [] + pager = VpcsPager( + client=_service, + limit=10, + resource_group_id='testString', + classic_access=True, + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 + + @responses.activate + def test_list_vpcs_with_pager_get_all(self): + """ + test_list_vpcs_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/vpcs') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"vpcs":[{"classic_access":false,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","cse_source_ips":[{"ip":{"address":"192.168.3.4"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"default_network_acl":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf","id":"a4e28308-8ee7-46ab-8108-9f881f22bdbf","name":"my-network-acl"},"default_routing_table":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","name":"my-routing-table-1","resource_type":"routing_table"},"default_security_group":{"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"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"vpc","status":"available"}]}' + mock_response2 = '{"total_count":2,"limit":1,"vpcs":[{"classic_access":false,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","cse_source_ips":[{"ip":{"address":"192.168.3.4"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"default_network_acl":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf","id":"a4e28308-8ee7-46ab-8108-9f881f22bdbf","name":"my-network-acl"},"default_routing_table":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","name":"my-routing-table-1","resource_type":"routing_table"},"default_security_group":{"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"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"vpc","status":"available"}]}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + pager = VpcsPager( + client=_service, + limit=10, + resource_group_id='testString', + classic_access=True, + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + class TestCreateVpc(): """ Test Class for create_vpc @@ -345,7 +410,6 @@ def test_create_vpc_value_error(self): with pytest.raises(ValueError): _service.create_vpc(**req_copy) - def test_create_vpc_value_error_with_retries(self): # Enable retries and run test_create_vpc_value_error. _service.enable_retries() @@ -416,7 +480,6 @@ def test_delete_vpc_value_error(self): with pytest.raises(ValueError): _service.delete_vpc(**req_copy) - def test_delete_vpc_value_error_with_retries(self): # Enable retries and run test_delete_vpc_value_error. _service.enable_retries() @@ -493,7 +556,6 @@ def test_get_vpc_value_error(self): with pytest.raises(ValueError): _service.get_vpc(**req_copy) - def test_get_vpc_value_error_with_retries(self): # Enable retries and run test_get_vpc_value_error. _service.enable_retries() @@ -585,7 +647,6 @@ def test_update_vpc_value_error(self): with pytest.raises(ValueError): _service.update_vpc(**req_copy) - def test_update_vpc_value_error_with_retries(self): # Enable retries and run test_update_vpc_value_error. _service.enable_retries() @@ -607,7 +668,7 @@ def test_get_vpc_default_network_acl_all_params(self): """ # Set up mock url = preprocess_url('/vpcs/testString/default_network_acl') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "mnemonic-ersatz-eatery-malaise", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}], "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", "resource_type": "subnet"}], "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", "resource_type": "vpc"}}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "mnemonic-ersatz-eatery-mythology", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/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", "resource_type": "subnet"}], "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", "resource_type": "vpc"}}' responses.add(responses.GET, url, body=mock_response, @@ -643,7 +704,7 @@ def test_get_vpc_default_network_acl_value_error(self): """ # Set up mock url = preprocess_url('/vpcs/testString/default_network_acl') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "mnemonic-ersatz-eatery-malaise", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}], "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", "resource_type": "subnet"}], "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", "resource_type": "vpc"}}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "mnemonic-ersatz-eatery-mythology", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/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", "resource_type": "subnet"}], "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", "resource_type": "vpc"}}' responses.add(responses.GET, url, body=mock_response, @@ -662,7 +723,6 @@ def test_get_vpc_default_network_acl_value_error(self): with pytest.raises(ValueError): _service.get_vpc_default_network_acl(**req_copy) - def test_get_vpc_default_network_acl_value_error_with_retries(self): # Enable retries and run test_get_vpc_default_network_acl_value_error. _service.enable_retries() @@ -684,7 +744,7 @@ def test_get_vpc_default_routing_table_all_params(self): """ # Set up mock url = preprocess_url('/vpcs/testString/default_routing_table') - mock_response = '{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "milled-easy-equine-machines", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/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", "resource_type": "subnet"}]}' + mock_response = '{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "milled-easy-equine-machines", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_internet_ingress": true, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/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", "resource_type": "subnet"}]}' responses.add(responses.GET, url, body=mock_response, @@ -720,7 +780,7 @@ def test_get_vpc_default_routing_table_value_error(self): """ # Set up mock url = preprocess_url('/vpcs/testString/default_routing_table') - mock_response = '{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "milled-easy-equine-machines", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/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", "resource_type": "subnet"}]}' + mock_response = '{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "milled-easy-equine-machines", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_internet_ingress": true, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/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", "resource_type": "subnet"}]}' responses.add(responses.GET, url, body=mock_response, @@ -739,7 +799,6 @@ def test_get_vpc_default_routing_table_value_error(self): with pytest.raises(ValueError): _service.get_vpc_default_routing_table(**req_copy) - def test_get_vpc_default_routing_table_value_error_with_retries(self): # Enable retries and run test_get_vpc_default_routing_table_value_error. _service.enable_retries() @@ -816,7 +875,6 @@ def test_get_vpc_default_security_group_value_error(self): with pytest.raises(ValueError): _service.get_vpc_default_security_group(**req_copy) - def test_get_vpc_default_security_group_value_error_with_retries(self): # Enable retries and run test_get_vpc_default_security_group_value_error. _service.enable_retries() @@ -938,7 +996,6 @@ def test_list_vpc_address_prefixes_value_error(self): with pytest.raises(ValueError): _service.list_vpc_address_prefixes(**req_copy) - def test_list_vpc_address_prefixes_value_error_with_retries(self): # Enable retries and run test_list_vpc_address_prefixes_value_error. _service.enable_retries() @@ -948,6 +1005,69 @@ def test_list_vpc_address_prefixes_value_error_with_retries(self): _service.disable_retries() self.test_list_vpc_address_prefixes_value_error() + @responses.activate + def test_list_vpc_address_prefixes_with_pager_get_next(self): + """ + test_list_vpc_address_prefixes_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/vpcs/testString/address_prefixes') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"address_prefixes":[{"cidr":"192.168.3.0/24","created_at":"2019-01-01T12:00:00.000Z","has_subnets":false,"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/address_prefixes/1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","is_default":false,"name":"my-address-prefix-2","zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' + mock_response2 = '{"address_prefixes":[{"cidr":"192.168.3.0/24","created_at":"2019-01-01T12:00:00.000Z","has_subnets":false,"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/address_prefixes/1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","is_default":false,"name":"my-address-prefix-2","zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + all_results = [] + pager = VpcAddressPrefixesPager( + client=_service, + vpc_id='testString', + limit=10, + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 + + @responses.activate + def test_list_vpc_address_prefixes_with_pager_get_all(self): + """ + test_list_vpc_address_prefixes_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/vpcs/testString/address_prefixes') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"address_prefixes":[{"cidr":"192.168.3.0/24","created_at":"2019-01-01T12:00:00.000Z","has_subnets":false,"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/address_prefixes/1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","is_default":false,"name":"my-address-prefix-2","zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' + mock_response2 = '{"address_prefixes":[{"cidr":"192.168.3.0/24","created_at":"2019-01-01T12:00:00.000Z","has_subnets":false,"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/address_prefixes/1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","is_default":false,"name":"my-address-prefix-2","zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + pager = VpcAddressPrefixesPager( + client=_service, + vpc_id='testString', + limit=10, + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + class TestCreateVpcAddressPrefix(): """ Test Class for create_vpc_address_prefix @@ -1043,7 +1163,6 @@ def test_create_vpc_address_prefix_value_error(self): with pytest.raises(ValueError): _service.create_vpc_address_prefix(**req_copy) - def test_create_vpc_address_prefix_value_error_with_retries(self): # Enable retries and run test_create_vpc_address_prefix_value_error. _service.enable_retries() @@ -1118,7 +1237,6 @@ def test_delete_vpc_address_prefix_value_error(self): with pytest.raises(ValueError): _service.delete_vpc_address_prefix(**req_copy) - def test_delete_vpc_address_prefix_value_error_with_retries(self): # Enable retries and run test_delete_vpc_address_prefix_value_error. _service.enable_retries() @@ -1199,7 +1317,6 @@ def test_get_vpc_address_prefix_value_error(self): with pytest.raises(ValueError): _service.get_vpc_address_prefix(**req_copy) - def test_get_vpc_address_prefix_value_error_with_retries(self): # Enable retries and run test_get_vpc_address_prefix_value_error. _service.enable_retries() @@ -1297,7 +1414,6 @@ def test_update_vpc_address_prefix_value_error(self): with pytest.raises(ValueError): _service.update_vpc_address_prefix(**req_copy) - def test_update_vpc_address_prefix_value_error_with_retries(self): # Enable retries and run test_update_vpc_address_prefix_value_error. _service.enable_retries() @@ -1422,7 +1538,6 @@ def test_list_vpc_routes_value_error(self): with pytest.raises(ValueError): _service.list_vpc_routes(**req_copy) - def test_list_vpc_routes_value_error_with_retries(self): # Enable retries and run test_list_vpc_routes_value_error. _service.enable_retries() @@ -1432,6 +1547,71 @@ def test_list_vpc_routes_value_error_with_retries(self): _service.disable_retries() self.test_list_vpc_routes_value_error() + @responses.activate + def test_list_vpc_routes_with_pager_get_next(self): + """ + test_list_vpc_routes_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/vpcs/testString/routes') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"routes":[{"action":"delegate","created_at":"2019-01-01T12:00:00.000Z","creator":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-vpn-gateway","resource_type":"vpn_gateway"},"destination":"192.168.3.0/24","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","lifecycle_state":"stable","name":"my-route-1","next_hop":{"address":"192.168.3.4"},"origin":"service","zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' + mock_response2 = '{"routes":[{"action":"delegate","created_at":"2019-01-01T12:00:00.000Z","creator":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-vpn-gateway","resource_type":"vpn_gateway"},"destination":"192.168.3.0/24","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","lifecycle_state":"stable","name":"my-route-1","next_hop":{"address":"192.168.3.4"},"origin":"service","zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + all_results = [] + pager = VpcRoutesPager( + client=_service, + vpc_id='testString', + zone_name='testString', + limit=10, + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 + + @responses.activate + def test_list_vpc_routes_with_pager_get_all(self): + """ + test_list_vpc_routes_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/vpcs/testString/routes') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"routes":[{"action":"delegate","created_at":"2019-01-01T12:00:00.000Z","creator":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-vpn-gateway","resource_type":"vpn_gateway"},"destination":"192.168.3.0/24","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","lifecycle_state":"stable","name":"my-route-1","next_hop":{"address":"192.168.3.4"},"origin":"service","zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' + mock_response2 = '{"routes":[{"action":"delegate","created_at":"2019-01-01T12:00:00.000Z","creator":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-vpn-gateway","resource_type":"vpn_gateway"},"destination":"192.168.3.0/24","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","lifecycle_state":"stable","name":"my-route-1","next_hop":{"address":"192.168.3.4"},"origin":"service","zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + pager = VpcRoutesPager( + client=_service, + vpc_id='testString', + zone_name='testString', + limit=10, + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + class TestCreateVpcRoute(): """ Test Class for create_vpc_route @@ -1539,7 +1719,6 @@ def test_create_vpc_route_value_error(self): with pytest.raises(ValueError): _service.create_vpc_route(**req_copy) - def test_create_vpc_route_value_error_with_retries(self): # Enable retries and run test_create_vpc_route_value_error. _service.enable_retries() @@ -1614,7 +1793,6 @@ def test_delete_vpc_route_value_error(self): with pytest.raises(ValueError): _service.delete_vpc_route(**req_copy) - def test_delete_vpc_route_value_error_with_retries(self): # Enable retries and run test_delete_vpc_route_value_error. _service.enable_retries() @@ -1695,7 +1873,6 @@ def test_get_vpc_route_value_error(self): with pytest.raises(ValueError): _service.get_vpc_route(**req_copy) - def test_get_vpc_route_value_error_with_retries(self): # Enable retries and run test_get_vpc_route_value_error. _service.enable_retries() @@ -1791,7 +1968,6 @@ def test_update_vpc_route_value_error(self): with pytest.raises(ValueError): _service.update_vpc_route(**req_copy) - def test_update_vpc_route_value_error_with_retries(self): # Enable retries and run test_update_vpc_route_value_error. _service.enable_retries() @@ -1813,7 +1989,7 @@ def test_list_vpc_routing_tables_all_params(self): """ # Set up mock url = preprocess_url('/vpcs/testString/routing_tables') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "routing_tables": [{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/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", "resource_type": "subnet"}]}], "total_count": 132}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "routing_tables": [{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_internet_ingress": true, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/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", "resource_type": "subnet"}]}], "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -1861,7 +2037,7 @@ def test_list_vpc_routing_tables_required_params(self): """ # Set up mock url = preprocess_url('/vpcs/testString/routing_tables') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "routing_tables": [{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/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", "resource_type": "subnet"}]}], "total_count": 132}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "routing_tables": [{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_internet_ingress": true, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/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", "resource_type": "subnet"}]}], "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -1897,7 +2073,7 @@ def test_list_vpc_routing_tables_value_error(self): """ # Set up mock url = preprocess_url('/vpcs/testString/routing_tables') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "routing_tables": [{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/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", "resource_type": "subnet"}]}], "total_count": 132}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "routing_tables": [{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_internet_ingress": true, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/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", "resource_type": "subnet"}]}], "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -1916,7 +2092,6 @@ def test_list_vpc_routing_tables_value_error(self): with pytest.raises(ValueError): _service.list_vpc_routing_tables(**req_copy) - def test_list_vpc_routing_tables_value_error_with_retries(self): # Enable retries and run test_list_vpc_routing_tables_value_error. _service.enable_retries() @@ -1926,6 +2101,71 @@ def test_list_vpc_routing_tables_value_error_with_retries(self): _service.disable_retries() self.test_list_vpc_routing_tables_value_error() + @responses.activate + def test_list_vpc_routing_tables_with_pager_get_next(self): + """ + test_list_vpc_routing_tables_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/vpcs/testString/routing_tables') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"routing_tables":[{"accept_routes_from":[{"resource_type":"vpn_gateway"}],"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","is_default":true,"lifecycle_state":"stable","name":"my-routing-table-1","resource_type":"routing_table","route_direct_link_ingress":false,"route_internet_ingress":true,"route_transit_gateway_ingress":false,"route_vpc_zone_ingress":true,"routes":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","name":"my-route-1"}],"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/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","resource_type":"subnet"}]}],"total_count":2,"limit":1}' + mock_response2 = '{"routing_tables":[{"accept_routes_from":[{"resource_type":"vpn_gateway"}],"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","is_default":true,"lifecycle_state":"stable","name":"my-routing-table-1","resource_type":"routing_table","route_direct_link_ingress":false,"route_internet_ingress":true,"route_transit_gateway_ingress":false,"route_vpc_zone_ingress":true,"routes":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","name":"my-route-1"}],"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/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","resource_type":"subnet"}]}],"total_count":2,"limit":1}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + all_results = [] + pager = VpcRoutingTablesPager( + client=_service, + vpc_id='testString', + limit=10, + is_default=True, + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 + + @responses.activate + def test_list_vpc_routing_tables_with_pager_get_all(self): + """ + test_list_vpc_routing_tables_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/vpcs/testString/routing_tables') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"routing_tables":[{"accept_routes_from":[{"resource_type":"vpn_gateway"}],"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","is_default":true,"lifecycle_state":"stable","name":"my-routing-table-1","resource_type":"routing_table","route_direct_link_ingress":false,"route_internet_ingress":true,"route_transit_gateway_ingress":false,"route_vpc_zone_ingress":true,"routes":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","name":"my-route-1"}],"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/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","resource_type":"subnet"}]}],"total_count":2,"limit":1}' + mock_response2 = '{"routing_tables":[{"accept_routes_from":[{"resource_type":"vpn_gateway"}],"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","is_default":true,"lifecycle_state":"stable","name":"my-routing-table-1","resource_type":"routing_table","route_direct_link_ingress":false,"route_internet_ingress":true,"route_transit_gateway_ingress":false,"route_vpc_zone_ingress":true,"routes":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","name":"my-route-1"}],"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/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","resource_type":"subnet"}]}],"total_count":2,"limit":1}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + pager = VpcRoutingTablesPager( + client=_service, + vpc_id='testString', + limit=10, + is_default=True, + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + class TestCreateVpcRoutingTable(): """ Test Class for create_vpc_routing_table @@ -1938,7 +2178,7 @@ def test_create_vpc_routing_table_all_params(self): """ # Set up mock url = preprocess_url('/vpcs/testString/routing_tables') - mock_response = '{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/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", "resource_type": "subnet"}]}' + mock_response = '{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_internet_ingress": true, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/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", "resource_type": "subnet"}]}' responses.add(responses.POST, url, body=mock_response, @@ -1970,6 +2210,7 @@ def test_create_vpc_routing_table_all_params(self): accept_routes_from = [resource_filter_model] name = 'my-routing-table-2' route_direct_link_ingress = False + route_internet_ingress = False route_transit_gateway_ingress = False route_vpc_zone_ingress = False routes = [route_prototype_model] @@ -1980,6 +2221,7 @@ def test_create_vpc_routing_table_all_params(self): accept_routes_from=accept_routes_from, name=name, route_direct_link_ingress=route_direct_link_ingress, + route_internet_ingress=route_internet_ingress, route_transit_gateway_ingress=route_transit_gateway_ingress, route_vpc_zone_ingress=route_vpc_zone_ingress, routes=routes, @@ -1994,6 +2236,7 @@ def test_create_vpc_routing_table_all_params(self): assert req_body['accept_routes_from'] == [resource_filter_model] assert req_body['name'] == 'my-routing-table-2' assert req_body['route_direct_link_ingress'] == False + assert req_body['route_internet_ingress'] == False assert req_body['route_transit_gateway_ingress'] == False assert req_body['route_vpc_zone_ingress'] == False assert req_body['routes'] == [route_prototype_model] @@ -2014,7 +2257,7 @@ def test_create_vpc_routing_table_value_error(self): """ # Set up mock url = preprocess_url('/vpcs/testString/routing_tables') - mock_response = '{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/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", "resource_type": "subnet"}]}' + mock_response = '{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_internet_ingress": true, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/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", "resource_type": "subnet"}]}' responses.add(responses.POST, url, body=mock_response, @@ -2046,6 +2289,7 @@ def test_create_vpc_routing_table_value_error(self): accept_routes_from = [resource_filter_model] name = 'my-routing-table-2' route_direct_link_ingress = False + route_internet_ingress = False route_transit_gateway_ingress = False route_vpc_zone_ingress = False routes = [route_prototype_model] @@ -2059,7 +2303,6 @@ def test_create_vpc_routing_table_value_error(self): with pytest.raises(ValueError): _service.create_vpc_routing_table(**req_copy) - def test_create_vpc_routing_table_value_error_with_retries(self): # Enable retries and run test_create_vpc_routing_table_value_error. _service.enable_retries() @@ -2171,7 +2414,6 @@ def test_delete_vpc_routing_table_value_error(self): with pytest.raises(ValueError): _service.delete_vpc_routing_table(**req_copy) - def test_delete_vpc_routing_table_value_error_with_retries(self): # Enable retries and run test_delete_vpc_routing_table_value_error. _service.enable_retries() @@ -2193,7 +2435,7 @@ def test_get_vpc_routing_table_all_params(self): """ # Set up mock url = preprocess_url('/vpcs/testString/routing_tables/testString') - mock_response = '{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/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", "resource_type": "subnet"}]}' + mock_response = '{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_internet_ingress": true, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/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", "resource_type": "subnet"}]}' responses.add(responses.GET, url, body=mock_response, @@ -2231,7 +2473,7 @@ def test_get_vpc_routing_table_value_error(self): """ # Set up mock url = preprocess_url('/vpcs/testString/routing_tables/testString') - mock_response = '{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/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", "resource_type": "subnet"}]}' + mock_response = '{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_internet_ingress": true, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/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", "resource_type": "subnet"}]}' responses.add(responses.GET, url, body=mock_response, @@ -2252,7 +2494,6 @@ def test_get_vpc_routing_table_value_error(self): with pytest.raises(ValueError): _service.get_vpc_routing_table(**req_copy) - def test_get_vpc_routing_table_value_error_with_retries(self): # Enable retries and run test_get_vpc_routing_table_value_error. _service.enable_retries() @@ -2274,7 +2515,7 @@ def test_update_vpc_routing_table_all_params(self): """ # Set up mock url = preprocess_url('/vpcs/testString/routing_tables/testString') - mock_response = '{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/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", "resource_type": "subnet"}]}' + mock_response = '{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_internet_ingress": true, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/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", "resource_type": "subnet"}]}' responses.add(responses.PATCH, url, body=mock_response, @@ -2290,6 +2531,7 @@ def test_update_vpc_routing_table_all_params(self): routing_table_patch_model['accept_routes_from'] = [resource_filter_model] routing_table_patch_model['name'] = 'my-routing-table-2' routing_table_patch_model['route_direct_link_ingress'] = True + routing_table_patch_model['route_internet_ingress'] = True routing_table_patch_model['route_transit_gateway_ingress'] = True routing_table_patch_model['route_vpc_zone_ingress'] = True @@ -2331,7 +2573,7 @@ def test_update_vpc_routing_table_required_params(self): """ # Set up mock url = preprocess_url('/vpcs/testString/routing_tables/testString') - mock_response = '{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/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", "resource_type": "subnet"}]}' + mock_response = '{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_internet_ingress": true, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/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", "resource_type": "subnet"}]}' responses.add(responses.PATCH, url, body=mock_response, @@ -2347,6 +2589,7 @@ def test_update_vpc_routing_table_required_params(self): routing_table_patch_model['accept_routes_from'] = [resource_filter_model] routing_table_patch_model['name'] = 'my-routing-table-2' routing_table_patch_model['route_direct_link_ingress'] = True + routing_table_patch_model['route_internet_ingress'] = True routing_table_patch_model['route_transit_gateway_ingress'] = True routing_table_patch_model['route_vpc_zone_ingress'] = True @@ -2386,7 +2629,7 @@ def test_update_vpc_routing_table_value_error(self): """ # Set up mock url = preprocess_url('/vpcs/testString/routing_tables/testString') - mock_response = '{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/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", "resource_type": "subnet"}]}' + mock_response = '{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_internet_ingress": true, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/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", "resource_type": "subnet"}]}' responses.add(responses.PATCH, url, body=mock_response, @@ -2402,6 +2645,7 @@ def test_update_vpc_routing_table_value_error(self): routing_table_patch_model['accept_routes_from'] = [resource_filter_model] routing_table_patch_model['name'] = 'my-routing-table-2' routing_table_patch_model['route_direct_link_ingress'] = True + routing_table_patch_model['route_internet_ingress'] = True routing_table_patch_model['route_transit_gateway_ingress'] = True routing_table_patch_model['route_vpc_zone_ingress'] = True @@ -2421,7 +2665,6 @@ def test_update_vpc_routing_table_value_error(self): with pytest.raises(ValueError): _service.update_vpc_routing_table(**req_copy) - def test_update_vpc_routing_table_value_error_with_retries(self): # Enable retries and run test_update_vpc_routing_table_value_error. _service.enable_retries() @@ -2549,7 +2792,6 @@ def test_list_vpc_routing_table_routes_value_error(self): with pytest.raises(ValueError): _service.list_vpc_routing_table_routes(**req_copy) - def test_list_vpc_routing_table_routes_value_error_with_retries(self): # Enable retries and run test_list_vpc_routing_table_routes_value_error. _service.enable_retries() @@ -2559,6 +2801,71 @@ def test_list_vpc_routing_table_routes_value_error_with_retries(self): _service.disable_retries() self.test_list_vpc_routing_table_routes_value_error() + @responses.activate + def test_list_vpc_routing_table_routes_with_pager_get_next(self): + """ + test_list_vpc_routing_table_routes_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/vpcs/testString/routing_tables/testString/routes') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"routes":[{"action":"delegate","created_at":"2019-01-01T12:00:00.000Z","creator":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-vpn-gateway","resource_type":"vpn_gateway"},"destination":"192.168.3.0/24","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","lifecycle_state":"stable","name":"my-route-1","next_hop":{"address":"192.168.3.4"},"origin":"service","zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' + mock_response2 = '{"routes":[{"action":"delegate","created_at":"2019-01-01T12:00:00.000Z","creator":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-vpn-gateway","resource_type":"vpn_gateway"},"destination":"192.168.3.0/24","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","lifecycle_state":"stable","name":"my-route-1","next_hop":{"address":"192.168.3.4"},"origin":"service","zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + all_results = [] + pager = VpcRoutingTableRoutesPager( + client=_service, + vpc_id='testString', + routing_table_id='testString', + limit=10, + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 + + @responses.activate + def test_list_vpc_routing_table_routes_with_pager_get_all(self): + """ + test_list_vpc_routing_table_routes_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/vpcs/testString/routing_tables/testString/routes') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"routes":[{"action":"delegate","created_at":"2019-01-01T12:00:00.000Z","creator":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-vpn-gateway","resource_type":"vpn_gateway"},"destination":"192.168.3.0/24","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","lifecycle_state":"stable","name":"my-route-1","next_hop":{"address":"192.168.3.4"},"origin":"service","zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' + mock_response2 = '{"routes":[{"action":"delegate","created_at":"2019-01-01T12:00:00.000Z","creator":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-vpn-gateway","resource_type":"vpn_gateway"},"destination":"192.168.3.0/24","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","lifecycle_state":"stable","name":"my-route-1","next_hop":{"address":"192.168.3.4"},"origin":"service","zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + pager = VpcRoutingTableRoutesPager( + client=_service, + vpc_id='testString', + routing_table_id='testString', + limit=10, + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + class TestCreateVpcRoutingTableRoute(): """ Test Class for create_vpc_routing_table_route @@ -2670,7 +2977,6 @@ def test_create_vpc_routing_table_route_value_error(self): with pytest.raises(ValueError): _service.create_vpc_routing_table_route(**req_copy) - def test_create_vpc_routing_table_route_value_error_with_retries(self): # Enable retries and run test_create_vpc_routing_table_route_value_error. _service.enable_retries() @@ -2749,7 +3055,6 @@ def test_delete_vpc_routing_table_route_value_error(self): with pytest.raises(ValueError): _service.delete_vpc_routing_table_route(**req_copy) - def test_delete_vpc_routing_table_route_value_error_with_retries(self): # Enable retries and run test_delete_vpc_routing_table_route_value_error. _service.enable_retries() @@ -2834,7 +3139,6 @@ def test_get_vpc_routing_table_route_value_error(self): with pytest.raises(ValueError): _service.get_vpc_routing_table_route(**req_copy) - def test_get_vpc_routing_table_route_value_error_with_retries(self): # Enable retries and run test_get_vpc_routing_table_route_value_error. _service.enable_retries() @@ -2934,7 +3238,6 @@ def test_update_vpc_routing_table_route_value_error(self): with pytest.raises(ValueError): _service.update_vpc_routing_table_route(**req_copy) - def test_update_vpc_routing_table_route_value_error_with_retries(self): # Enable retries and run test_update_vpc_routing_table_route_value_error. _service.enable_retries() @@ -2998,6 +3301,7 @@ def test_new_instance_required_param_none(self): service = VpcV1.new_instance( version=None, ) + class TestListSubnets(): """ Test Class for list_subnets @@ -3108,7 +3412,6 @@ def test_list_subnets_value_error(self): with pytest.raises(ValueError): _service.list_subnets(**req_copy) - def test_list_subnets_value_error_with_retries(self): # Enable retries and run test_list_subnets_value_error. _service.enable_retries() @@ -3118,6 +3421,73 @@ def test_list_subnets_value_error_with_retries(self): _service.disable_retries() self.test_list_subnets_value_error() + @responses.activate + def test_list_subnets_with_pager_get_next(self): + """ + test_list_subnets_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/subnets') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"subnets":[{"available_ipv4_address_count":15,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","ip_version":"ipv4","ipv4_cidr_block":"10.0.0.0/24","name":"my-subnet","network_acl":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf","id":"a4e28308-8ee7-46ab-8108-9f881f22bdbf","name":"my-network-acl"},"public_gateway":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241","id":"dc5431ef-1fc6-4861-adc9-a59d077d1241","name":"my-public-gateway","resource_type":"public_gateway"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"subnet","routing_table":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","name":"my-routing-table-1","resource_type":"routing_table"},"status":"available","total_ipv4_address_count":256,"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/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","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}' + mock_response2 = '{"total_count":2,"limit":1,"subnets":[{"available_ipv4_address_count":15,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","ip_version":"ipv4","ipv4_cidr_block":"10.0.0.0/24","name":"my-subnet","network_acl":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf","id":"a4e28308-8ee7-46ab-8108-9f881f22bdbf","name":"my-network-acl"},"public_gateway":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241","id":"dc5431ef-1fc6-4861-adc9-a59d077d1241","name":"my-public-gateway","resource_type":"public_gateway"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"subnet","routing_table":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","name":"my-routing-table-1","resource_type":"routing_table"},"status":"available","total_ipv4_address_count":256,"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/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","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + all_results = [] + pager = SubnetsPager( + client=_service, + limit=10, + resource_group_id='testString', + routing_table_id='testString', + routing_table_name='testString', + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 + + @responses.activate + def test_list_subnets_with_pager_get_all(self): + """ + test_list_subnets_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/subnets') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"subnets":[{"available_ipv4_address_count":15,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","ip_version":"ipv4","ipv4_cidr_block":"10.0.0.0/24","name":"my-subnet","network_acl":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf","id":"a4e28308-8ee7-46ab-8108-9f881f22bdbf","name":"my-network-acl"},"public_gateway":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241","id":"dc5431ef-1fc6-4861-adc9-a59d077d1241","name":"my-public-gateway","resource_type":"public_gateway"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"subnet","routing_table":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","name":"my-routing-table-1","resource_type":"routing_table"},"status":"available","total_ipv4_address_count":256,"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/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","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}' + mock_response2 = '{"total_count":2,"limit":1,"subnets":[{"available_ipv4_address_count":15,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","ip_version":"ipv4","ipv4_cidr_block":"10.0.0.0/24","name":"my-subnet","network_acl":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf","id":"a4e28308-8ee7-46ab-8108-9f881f22bdbf","name":"my-network-acl"},"public_gateway":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241","id":"dc5431ef-1fc6-4861-adc9-a59d077d1241","name":"my-public-gateway","resource_type":"public_gateway"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"subnet","routing_table":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","name":"my-routing-table-1","resource_type":"routing_table"},"status":"available","total_ipv4_address_count":256,"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/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","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + pager = SubnetsPager( + client=_service, + limit=10, + resource_group_id='testString', + routing_table_id='testString', + routing_table_name='testString', + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + class TestCreateSubnet(): """ Test Class for create_subnet @@ -3260,7 +3630,6 @@ def test_create_subnet_value_error(self): with pytest.raises(ValueError): _service.create_subnet(**req_copy) - def test_create_subnet_value_error_with_retries(self): # Enable retries and run test_create_subnet_value_error. _service.enable_retries() @@ -3331,7 +3700,6 @@ def test_delete_subnet_value_error(self): with pytest.raises(ValueError): _service.delete_subnet(**req_copy) - def test_delete_subnet_value_error_with_retries(self): # Enable retries and run test_delete_subnet_value_error. _service.enable_retries() @@ -3408,7 +3776,6 @@ def test_get_subnet_value_error(self): with pytest.raises(ValueError): _service.get_subnet(**req_copy) - def test_get_subnet_value_error_with_retries(self): # Enable retries and run test_get_subnet_value_error. _service.enable_retries() @@ -3530,7 +3897,6 @@ def test_update_subnet_value_error(self): with pytest.raises(ValueError): _service.update_subnet(**req_copy) - def test_update_subnet_value_error_with_retries(self): # Enable retries and run test_update_subnet_value_error. _service.enable_retries() @@ -3552,7 +3918,7 @@ def test_get_subnet_network_acl_all_params(self): """ # Set up mock url = preprocess_url('/subnets/testString/network_acl') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}], "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", "resource_type": "subnet"}], "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", "resource_type": "vpc"}}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/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", "resource_type": "subnet"}], "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", "resource_type": "vpc"}}' responses.add(responses.GET, url, body=mock_response, @@ -3588,7 +3954,7 @@ def test_get_subnet_network_acl_value_error(self): """ # Set up mock url = preprocess_url('/subnets/testString/network_acl') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}], "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", "resource_type": "subnet"}], "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", "resource_type": "vpc"}}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/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", "resource_type": "subnet"}], "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", "resource_type": "vpc"}}' responses.add(responses.GET, url, body=mock_response, @@ -3607,7 +3973,6 @@ def test_get_subnet_network_acl_value_error(self): with pytest.raises(ValueError): _service.get_subnet_network_acl(**req_copy) - def test_get_subnet_network_acl_value_error_with_retries(self): # Enable retries and run test_get_subnet_network_acl_value_error. _service.enable_retries() @@ -3629,7 +3994,7 @@ def test_replace_subnet_network_acl_all_params(self): """ # Set up mock url = preprocess_url('/subnets/testString/network_acl') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}], "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", "resource_type": "subnet"}], "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", "resource_type": "vpc"}}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/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", "resource_type": "subnet"}], "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", "resource_type": "vpc"}}' responses.add(responses.PUT, url, body=mock_response, @@ -3674,7 +4039,7 @@ def test_replace_subnet_network_acl_value_error(self): """ # Set up mock url = preprocess_url('/subnets/testString/network_acl') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}], "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", "resource_type": "subnet"}], "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", "resource_type": "vpc"}}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/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", "resource_type": "subnet"}], "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", "resource_type": "vpc"}}' responses.add(responses.PUT, url, body=mock_response, @@ -3699,7 +4064,6 @@ def test_replace_subnet_network_acl_value_error(self): with pytest.raises(ValueError): _service.replace_subnet_network_acl(**req_copy) - def test_replace_subnet_network_acl_value_error_with_retries(self): # Enable retries and run test_replace_subnet_network_acl_value_error. _service.enable_retries() @@ -3770,7 +4134,6 @@ def test_unset_subnet_public_gateway_value_error(self): with pytest.raises(ValueError): _service.unset_subnet_public_gateway(**req_copy) - def test_unset_subnet_public_gateway_value_error_with_retries(self): # Enable retries and run test_unset_subnet_public_gateway_value_error. _service.enable_retries() @@ -3847,7 +4210,6 @@ def test_get_subnet_public_gateway_value_error(self): with pytest.raises(ValueError): _service.get_subnet_public_gateway(**req_copy) - def test_get_subnet_public_gateway_value_error_with_retries(self): # Enable retries and run test_get_subnet_public_gateway_value_error. _service.enable_retries() @@ -3939,7 +4301,6 @@ def test_set_subnet_public_gateway_value_error(self): with pytest.raises(ValueError): _service.set_subnet_public_gateway(**req_copy) - def test_set_subnet_public_gateway_value_error_with_retries(self): # Enable retries and run test_set_subnet_public_gateway_value_error. _service.enable_retries() @@ -3961,7 +4322,7 @@ def test_get_subnet_routing_table_all_params(self): """ # Set up mock url = preprocess_url('/subnets/testString/routing_table') - mock_response = '{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/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", "resource_type": "subnet"}]}' + mock_response = '{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_internet_ingress": true, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/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", "resource_type": "subnet"}]}' responses.add(responses.GET, url, body=mock_response, @@ -3997,7 +4358,7 @@ def test_get_subnet_routing_table_value_error(self): """ # Set up mock url = preprocess_url('/subnets/testString/routing_table') - mock_response = '{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/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", "resource_type": "subnet"}]}' + mock_response = '{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_internet_ingress": true, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/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", "resource_type": "subnet"}]}' responses.add(responses.GET, url, body=mock_response, @@ -4016,7 +4377,6 @@ def test_get_subnet_routing_table_value_error(self): with pytest.raises(ValueError): _service.get_subnet_routing_table(**req_copy) - def test_get_subnet_routing_table_value_error_with_retries(self): # Enable retries and run test_get_subnet_routing_table_value_error. _service.enable_retries() @@ -4038,7 +4398,7 @@ def test_replace_subnet_routing_table_all_params(self): """ # Set up mock url = preprocess_url('/subnets/testString/routing_table') - mock_response = '{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/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", "resource_type": "subnet"}]}' + mock_response = '{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_internet_ingress": true, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/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", "resource_type": "subnet"}]}' responses.add(responses.PUT, url, body=mock_response, @@ -4083,7 +4443,7 @@ def test_replace_subnet_routing_table_value_error(self): """ # Set up mock url = preprocess_url('/subnets/testString/routing_table') - mock_response = '{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/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", "resource_type": "subnet"}]}' + mock_response = '{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_internet_ingress": true, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/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", "resource_type": "subnet"}]}' responses.add(responses.PUT, url, body=mock_response, @@ -4108,7 +4468,6 @@ def test_replace_subnet_routing_table_value_error(self): with pytest.raises(ValueError): _service.replace_subnet_routing_table(**req_copy) - def test_replace_subnet_routing_table_value_error_with_retries(self): # Enable retries and run test_replace_subnet_routing_table_value_error. _service.enable_retries() @@ -4233,7 +4592,6 @@ def test_list_subnet_reserved_ips_value_error(self): with pytest.raises(ValueError): _service.list_subnet_reserved_ips(**req_copy) - def test_list_subnet_reserved_ips_value_error_with_retries(self): # Enable retries and run test_list_subnet_reserved_ips_value_error. _service.enable_retries() @@ -4243,6 +4601,71 @@ def test_list_subnet_reserved_ips_value_error_with_retries(self): _service.disable_retries() self.test_list_subnet_reserved_ips_value_error() + @responses.activate + def test_list_subnet_reserved_ips_with_pager_get_next(self): + """ + test_list_subnet_reserved_ips_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/subnets/testString/reserved_ips') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"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":2,"limit":1}' + mock_response2 = '{"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":2,"limit":1}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + all_results = [] + pager = SubnetReservedIpsPager( + client=_service, + subnet_id='testString', + limit=10, + sort='name', + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 + + @responses.activate + def test_list_subnet_reserved_ips_with_pager_get_all(self): + """ + test_list_subnet_reserved_ips_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/subnets/testString/reserved_ips') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"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":2,"limit":1}' + mock_response2 = '{"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":2,"limit":1}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + pager = SubnetReservedIpsPager( + client=_service, + subnet_id='testString', + limit=10, + sort='name', + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + class TestCreateSubnetReservedIp(): """ Test Class for create_subnet_reserved_ip @@ -4336,7 +4759,6 @@ def test_create_subnet_reserved_ip_value_error(self): with pytest.raises(ValueError): _service.create_subnet_reserved_ip(**req_copy) - def test_create_subnet_reserved_ip_value_error_with_retries(self): # Enable retries and run test_create_subnet_reserved_ip_value_error. _service.enable_retries() @@ -4411,7 +4833,6 @@ def test_delete_subnet_reserved_ip_value_error(self): with pytest.raises(ValueError): _service.delete_subnet_reserved_ip(**req_copy) - def test_delete_subnet_reserved_ip_value_error_with_retries(self): # Enable retries and run test_delete_subnet_reserved_ip_value_error. _service.enable_retries() @@ -4492,7 +4913,6 @@ def test_get_subnet_reserved_ip_value_error(self): with pytest.raises(ValueError): _service.get_subnet_reserved_ip(**req_copy) - def test_get_subnet_reserved_ip_value_error_with_retries(self): # Enable retries and run test_get_subnet_reserved_ip_value_error. _service.enable_retries() @@ -4590,7 +5010,6 @@ def test_update_subnet_reserved_ip_value_error(self): with pytest.raises(ValueError): _service.update_subnet_reserved_ip(**req_copy) - def test_update_subnet_reserved_ip_value_error_with_retries(self): # Enable retries and run test_update_subnet_reserved_ip_value_error. _service.enable_retries() @@ -4654,6 +5073,7 @@ def test_new_instance_required_param_none(self): service = VpcV1.new_instance( version=None, ) + class TestListImages(): """ Test Class for list_images @@ -4666,7 +5086,7 @@ def test_list_images_all_params(self): """ # Set up mock url = preprocess_url('/images') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/images?limit=20"}, "images": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "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"}, "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"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/images?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/images?limit=20"}, "images": [{"catalog_offering": {"managed": false, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "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"}, "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"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/images?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}}' responses.add(responses.GET, url, body=mock_response, @@ -4718,7 +5138,7 @@ def test_list_images_required_params(self): """ # Set up mock url = preprocess_url('/images') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/images?limit=20"}, "images": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "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"}, "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"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/images?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/images?limit=20"}, "images": [{"catalog_offering": {"managed": false, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "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"}, "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"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/images?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}}' responses.add(responses.GET, url, body=mock_response, @@ -4749,7 +5169,7 @@ def test_list_images_value_error(self): """ # Set up mock url = preprocess_url('/images') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/images?limit=20"}, "images": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "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"}, "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"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/images?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/images?limit=20"}, "images": [{"catalog_offering": {"managed": false, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "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"}, "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"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/images?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}}' responses.add(responses.GET, url, body=mock_response, @@ -4764,7 +5184,6 @@ def test_list_images_value_error(self): with pytest.raises(ValueError): _service.list_images(**req_copy) - def test_list_images_value_error_with_retries(self): # Enable retries and run test_list_images_value_error. _service.enable_retries() @@ -4774,6 +5193,73 @@ def test_list_images_value_error_with_retries(self): _service.disable_retries() self.test_list_images_value_error() + @responses.activate + def test_list_images_with_pager_get_next(self): + """ + test_list_images_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/images') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"images":[{"catalog_offering":{"managed":false,"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","encryption":"user_managed","encryption_key":{"crn":"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"file":{"checksums":{"sha256":"e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"},"size":1},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","minimum_provisioned_size":24,"name":"my-image","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"},"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"},"status":"available","status_reasons":[{"code":"encryption_key_deleted","message":"message","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"visibility":"private"}],"total_count":2,"limit":1}' + mock_response2 = '{"images":[{"catalog_offering":{"managed":false,"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","encryption":"user_managed","encryption_key":{"crn":"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"file":{"checksums":{"sha256":"e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"},"size":1},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","minimum_provisioned_size":24,"name":"my-image","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"},"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"},"status":"available","status_reasons":[{"code":"encryption_key_deleted","message":"message","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"visibility":"private"}],"total_count":2,"limit":1}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + all_results = [] + pager = ImagesPager( + client=_service, + limit=10, + resource_group_id='testString', + name='testString', + visibility='private', + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 + + @responses.activate + def test_list_images_with_pager_get_all(self): + """ + test_list_images_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/images') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"images":[{"catalog_offering":{"managed":false,"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","encryption":"user_managed","encryption_key":{"crn":"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"file":{"checksums":{"sha256":"e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"},"size":1},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","minimum_provisioned_size":24,"name":"my-image","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"},"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"},"status":"available","status_reasons":[{"code":"encryption_key_deleted","message":"message","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"visibility":"private"}],"total_count":2,"limit":1}' + mock_response2 = '{"images":[{"catalog_offering":{"managed":false,"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","encryption":"user_managed","encryption_key":{"crn":"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"file":{"checksums":{"sha256":"e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"},"size":1},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","minimum_provisioned_size":24,"name":"my-image","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"},"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"},"status":"available","status_reasons":[{"code":"encryption_key_deleted","message":"message","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"visibility":"private"}],"total_count":2,"limit":1}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + pager = ImagesPager( + client=_service, + limit=10, + resource_group_id='testString', + name='testString', + visibility='private', + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + class TestCreateImage(): """ Test Class for create_image @@ -4786,7 +5272,7 @@ def test_create_image_all_params(self): """ # Set up mock url = preprocess_url('/images') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "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"}, "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"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}' + mock_response = '{"catalog_offering": {"managed": false, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "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"}, "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"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}' responses.add(responses.POST, url, body=mock_response, @@ -4850,7 +5336,7 @@ def test_create_image_value_error(self): """ # Set up mock url = preprocess_url('/images') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "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"}, "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"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}' + mock_response = '{"catalog_offering": {"managed": false, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "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"}, "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"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}' responses.add(responses.POST, url, body=mock_response, @@ -4894,7 +5380,6 @@ def test_create_image_value_error(self): with pytest.raises(ValueError): _service.create_image(**req_copy) - def test_create_image_value_error_with_retries(self): # Enable retries and run test_create_image_value_error. _service.enable_retries() @@ -4965,7 +5450,6 @@ def test_delete_image_value_error(self): with pytest.raises(ValueError): _service.delete_image(**req_copy) - def test_delete_image_value_error_with_retries(self): # Enable retries and run test_delete_image_value_error. _service.enable_retries() @@ -4987,7 +5471,7 @@ def test_get_image_all_params(self): """ # Set up mock url = preprocess_url('/images/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "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"}, "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"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}' + mock_response = '{"catalog_offering": {"managed": false, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "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"}, "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"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}' responses.add(responses.GET, url, body=mock_response, @@ -5023,7 +5507,7 @@ def test_get_image_value_error(self): """ # Set up mock url = preprocess_url('/images/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "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"}, "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"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}' + mock_response = '{"catalog_offering": {"managed": false, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "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"}, "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"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}' responses.add(responses.GET, url, body=mock_response, @@ -5042,7 +5526,6 @@ def test_get_image_value_error(self): with pytest.raises(ValueError): _service.get_image(**req_copy) - def test_get_image_value_error_with_retries(self): # Enable retries and run test_get_image_value_error. _service.enable_retries() @@ -5064,7 +5547,7 @@ def test_update_image_all_params(self): """ # Set up mock url = preprocess_url('/images/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "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"}, "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"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}' + mock_response = '{"catalog_offering": {"managed": false, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "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"}, "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"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}' responses.add(responses.PATCH, url, body=mock_response, @@ -5109,7 +5592,7 @@ def test_update_image_value_error(self): """ # Set up mock url = preprocess_url('/images/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "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"}, "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"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}' + mock_response = '{"catalog_offering": {"managed": false, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "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"}, "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"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}' responses.add(responses.PATCH, url, body=mock_response, @@ -5134,7 +5617,6 @@ def test_update_image_value_error(self): with pytest.raises(ValueError): _service.update_image(**req_copy) - def test_update_image_value_error_with_retries(self): # Enable retries and run test_update_image_value_error. _service.enable_retries() @@ -5245,7 +5727,6 @@ def test_list_operating_systems_value_error(self): with pytest.raises(ValueError): _service.list_operating_systems(**req_copy) - def test_list_operating_systems_value_error_with_retries(self): # Enable retries and run test_list_operating_systems_value_error. _service.enable_retries() @@ -5255,6 +5736,67 @@ def test_list_operating_systems_value_error_with_retries(self): _service.disable_retries() self.test_list_operating_systems_value_error() + @responses.activate + def test_list_operating_systems_with_pager_get_next(self): + """ + test_list_operating_systems_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/operating_systems') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"operating_systems":[{"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"}],"total_count":2,"limit":1}' + mock_response2 = '{"operating_systems":[{"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"}],"total_count":2,"limit":1}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + all_results = [] + pager = OperatingSystemsPager( + client=_service, + limit=10, + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 + + @responses.activate + def test_list_operating_systems_with_pager_get_all(self): + """ + test_list_operating_systems_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/operating_systems') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"operating_systems":[{"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"}],"total_count":2,"limit":1}' + mock_response2 = '{"operating_systems":[{"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"}],"total_count":2,"limit":1}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + pager = OperatingSystemsPager( + client=_service, + limit=10, + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + class TestGetOperatingSystem(): """ Test Class for get_operating_system @@ -5322,7 +5864,6 @@ def test_get_operating_system_value_error(self): with pytest.raises(ValueError): _service.get_operating_system(**req_copy) - def test_get_operating_system_value_error_with_retries(self): # Enable retries and run test_get_operating_system_value_error. _service.enable_retries() @@ -5386,6 +5927,7 @@ def test_new_instance_required_param_none(self): service = VpcV1.new_instance( version=None, ) + class TestListKeys(): """ Test Class for list_keys @@ -5487,7 +6029,6 @@ def test_list_keys_value_error(self): with pytest.raises(ValueError): _service.list_keys(**req_copy) - def test_list_keys_value_error_with_retries(self): # Enable retries and run test_list_keys_value_error. _service.enable_retries() @@ -5497,6 +6038,67 @@ def test_list_keys_value_error_with_retries(self): _service.disable_retries() self.test_list_keys_value_error() + @responses.activate + def test_list_keys_with_pager_get_next(self): + """ + test_list_keys_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/keys') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"keys":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803","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","length":2048,"name":"my-key","public_key":"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"type":"rsa"}],"limit":1}' + mock_response2 = '{"total_count":2,"keys":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803","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","length":2048,"name":"my-key","public_key":"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"type":"rsa"}],"limit":1}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + all_results = [] + pager = KeysPager( + client=_service, + limit=10, + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 + + @responses.activate + def test_list_keys_with_pager_get_all(self): + """ + test_list_keys_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/keys') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"keys":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803","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","length":2048,"name":"my-key","public_key":"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"type":"rsa"}],"limit":1}' + mock_response2 = '{"total_count":2,"keys":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803","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","length":2048,"name":"my-key","public_key":"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"type":"rsa"}],"limit":1}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + pager = KeysPager( + client=_service, + limit=10, + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + class TestCreateKey(): """ Test Class for create_key @@ -5587,7 +6189,6 @@ def test_create_key_value_error(self): with pytest.raises(ValueError): _service.create_key(**req_copy) - def test_create_key_value_error_with_retries(self): # Enable retries and run test_create_key_value_error. _service.enable_retries() @@ -5658,7 +6259,6 @@ def test_delete_key_value_error(self): with pytest.raises(ValueError): _service.delete_key(**req_copy) - def test_delete_key_value_error_with_retries(self): # Enable retries and run test_delete_key_value_error. _service.enable_retries() @@ -5735,7 +6335,6 @@ def test_get_key_value_error(self): with pytest.raises(ValueError): _service.get_key(**req_copy) - def test_get_key_value_error_with_retries(self): # Enable retries and run test_get_key_value_error. _service.enable_retries() @@ -5827,7 +6426,6 @@ def test_update_key_value_error(self): with pytest.raises(ValueError): _service.update_key(**req_copy) - def test_update_key_value_error_with_retries(self): # Enable retries and run test_update_key_value_error. _service.enable_retries() @@ -5891,6 +6489,7 @@ def test_new_instance_required_param_none(self): service = VpcV1.new_instance( version=None, ) + class TestListInstanceProfiles(): """ Test Class for list_instance_profiles @@ -5949,7 +6548,6 @@ def test_list_instance_profiles_value_error(self): with pytest.raises(ValueError): _service.list_instance_profiles(**req_copy) - def test_list_instance_profiles_value_error_with_retries(self): # Enable retries and run test_list_instance_profiles_value_error. _service.enable_retries() @@ -6026,7 +6624,6 @@ def test_get_instance_profile_value_error(self): with pytest.raises(ValueError): _service.get_instance_profile(**req_copy) - def test_get_instance_profile_value_error_with_retries(self): # Enable retries and run test_get_instance_profile_value_error. _service.enable_retries() @@ -6048,7 +6645,7 @@ def test_list_instance_templates_all_params(self): """ # Set up mock url = preprocess_url('/instance/templates') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "templates": [{"availability_policy": {"host_failure": "restart"}, "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}' + 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"}, "user_tags": ["user_tags"]}}, "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, @@ -6079,7 +6676,7 @@ def test_list_instance_templates_value_error(self): """ # Set up mock url = preprocess_url('/instance/templates') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "templates": [{"availability_policy": {"host_failure": "restart"}, "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}' + 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"}, "user_tags": ["user_tags"]}}, "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, @@ -6094,7 +6691,6 @@ def test_list_instance_templates_value_error(self): with pytest.raises(ValueError): _service.list_instance_templates(**req_copy) - def test_list_instance_templates_value_error_with_retries(self): # Enable retries and run test_list_instance_templates_value_error. _service.enable_retries() @@ -6116,7 +6712,7 @@ def test_create_instance_template_all_params(self): """ # Set up mock url = preprocess_url('/instance/templates') - 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"}}' + 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"}, "user_tags": ["user_tags"]}}, "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, @@ -6207,6 +6803,7 @@ def test_create_instance_template_all_params(self): 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_prototype_instance_by_image_context_model['user_tags'] = ['testString'] # Construct a dict representation of a VolumeAttachmentPrototypeInstanceByImageContext model volume_attachment_prototype_instance_by_image_context_model = {} @@ -6274,7 +6871,7 @@ def test_create_instance_template_value_error(self): """ # Set up mock url = preprocess_url('/instance/templates') - 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"}}' + 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"}, "user_tags": ["user_tags"]}}, "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, @@ -6365,6 +6962,7 @@ def test_create_instance_template_value_error(self): 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_prototype_instance_by_image_context_model['user_tags'] = ['testString'] # Construct a dict representation of a VolumeAttachmentPrototypeInstanceByImageContext model volume_attachment_prototype_instance_by_image_context_model = {} @@ -6412,7 +7010,6 @@ def test_create_instance_template_value_error(self): with pytest.raises(ValueError): _service.create_instance_template(**req_copy) - def test_create_instance_template_value_error_with_retries(self): # Enable retries and run test_create_instance_template_value_error. _service.enable_retries() @@ -6483,7 +7080,6 @@ def test_delete_instance_template_value_error(self): with pytest.raises(ValueError): _service.delete_instance_template(**req_copy) - def test_delete_instance_template_value_error_with_retries(self): # Enable retries and run test_delete_instance_template_value_error. _service.enable_retries() @@ -6505,7 +7101,7 @@ def test_get_instance_template_all_params(self): """ # Set up mock url = preprocess_url('/instance/templates/testString') - mock_response = '{"availability_policy": {"host_failure": "restart"}, "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"}}' + 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"}, "user_tags": ["user_tags"]}}, "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, @@ -6541,7 +7137,7 @@ def test_get_instance_template_value_error(self): """ # Set up mock url = preprocess_url('/instance/templates/testString') - mock_response = '{"availability_policy": {"host_failure": "restart"}, "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"}}' + 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"}, "user_tags": ["user_tags"]}}, "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, @@ -6560,7 +7156,6 @@ def test_get_instance_template_value_error(self): with pytest.raises(ValueError): _service.get_instance_template(**req_copy) - def test_get_instance_template_value_error_with_retries(self): # Enable retries and run test_get_instance_template_value_error. _service.enable_retries() @@ -6582,7 +7177,7 @@ def test_update_instance_template_all_params(self): """ # Set up mock url = preprocess_url('/instance/templates/testString') - mock_response = '{"availability_policy": {"host_failure": "restart"}, "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"}}' + 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"}, "user_tags": ["user_tags"]}}, "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, @@ -6627,7 +7222,7 @@ def test_update_instance_template_value_error(self): """ # Set up mock url = preprocess_url('/instance/templates/testString') - mock_response = '{"availability_policy": {"host_failure": "restart"}, "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"}}' + 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"}, "user_tags": ["user_tags"]}}, "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, @@ -6652,7 +7247,6 @@ def test_update_instance_template_value_error(self): with pytest.raises(ValueError): _service.update_instance_template(**req_copy) - def test_update_instance_template_value_error_with_retries(self): # Enable retries and run test_update_instance_template_value_error. _service.enable_retries() @@ -6674,7 +7268,7 @@ def test_list_instances_all_params(self): """ # Set up mock url = preprocess_url('/instances') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?limit=20"}, "instances": [{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/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", "resource_type": "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", "resource_type": "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"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4}, "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", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "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"}}, "catalog_offering": {"version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/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"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 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", "resource_type": "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", "resource_type": "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"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4}, "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", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -6750,7 +7344,7 @@ def test_list_instances_required_params(self): """ # Set up mock url = preprocess_url('/instances') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?limit=20"}, "instances": [{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/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", "resource_type": "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", "resource_type": "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"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4}, "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", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "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"}}, "catalog_offering": {"version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/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"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 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", "resource_type": "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", "resource_type": "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"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4}, "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", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -6781,7 +7375,7 @@ def test_list_instances_value_error(self): """ # Set up mock url = preprocess_url('/instances') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?limit=20"}, "instances": [{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/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", "resource_type": "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", "resource_type": "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"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4}, "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", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "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"}}, "catalog_offering": {"version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/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"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 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", "resource_type": "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", "resource_type": "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"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4}, "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", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -6796,7 +7390,6 @@ def test_list_instances_value_error(self): with pytest.raises(ValueError): _service.list_instances(**req_copy) - def test_list_instances_value_error_with_retries(self): # Enable retries and run test_list_instances_value_error. _service.enable_retries() @@ -6806,6 +7399,89 @@ def test_list_instances_value_error_with_retries(self): _service.disable_retries() self.test_list_instances_value_error() + @responses.activate + def test_list_instances_with_pager_get_next(self): + """ + test_list_instances_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/instances') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"instances":[{"availability_policy":{"host_failure":"restart"},"bandwidth":1000,"boot_volume_attachment":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"80b3e36e-41f4-40e9-bd56-beae81792a68"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/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"}},"catalog_offering":{"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/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"},"lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","memory":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","resource_type":"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","resource_type":"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"},"resource_type":"instance","startable":false,"status":"deleting","status_reasons":[{"code":"cannot_start_storage","message":"The virtual server instance is unusable because the encryption key for the boot volume\\nhas been deleted","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"total_network_bandwidth":500,"total_volume_bandwidth":500,"vcpu":{"architecture":"amd64","count":4},"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","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' + mock_response2 = '{"instances":[{"availability_policy":{"host_failure":"restart"},"bandwidth":1000,"boot_volume_attachment":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"80b3e36e-41f4-40e9-bd56-beae81792a68"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/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"}},"catalog_offering":{"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/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"},"lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","memory":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","resource_type":"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","resource_type":"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"},"resource_type":"instance","startable":false,"status":"deleting","status_reasons":[{"code":"cannot_start_storage","message":"The virtual server instance is unusable because the encryption key for the boot volume\\nhas been deleted","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"total_network_bandwidth":500,"total_volume_bandwidth":500,"vcpu":{"architecture":"amd64","count":4},"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","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + all_results = [] + pager = InstancesPager( + client=_service, + limit=10, + resource_group_id='testString', + name='testString', + vpc_id='testString', + vpc_crn='testString', + vpc_name='testString', + dedicated_host_id='testString', + dedicated_host_crn='testString', + dedicated_host_name='testString', + placement_group_id='testString', + placement_group_crn='testString', + placement_group_name='testString', + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 + + @responses.activate + def test_list_instances_with_pager_get_all(self): + """ + test_list_instances_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/instances') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"instances":[{"availability_policy":{"host_failure":"restart"},"bandwidth":1000,"boot_volume_attachment":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"80b3e36e-41f4-40e9-bd56-beae81792a68"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/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"}},"catalog_offering":{"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/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"},"lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","memory":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","resource_type":"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","resource_type":"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"},"resource_type":"instance","startable":false,"status":"deleting","status_reasons":[{"code":"cannot_start_storage","message":"The virtual server instance is unusable because the encryption key for the boot volume\\nhas been deleted","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"total_network_bandwidth":500,"total_volume_bandwidth":500,"vcpu":{"architecture":"amd64","count":4},"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","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' + mock_response2 = '{"instances":[{"availability_policy":{"host_failure":"restart"},"bandwidth":1000,"boot_volume_attachment":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"80b3e36e-41f4-40e9-bd56-beae81792a68"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/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"}},"catalog_offering":{"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/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"},"lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","memory":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","resource_type":"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","resource_type":"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"},"resource_type":"instance","startable":false,"status":"deleting","status_reasons":[{"code":"cannot_start_storage","message":"The virtual server instance is unusable because the encryption key for the boot volume\\nhas been deleted","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"total_network_bandwidth":500,"total_volume_bandwidth":500,"vcpu":{"architecture":"amd64","count":4},"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","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + pager = InstancesPager( + client=_service, + limit=10, + resource_group_id='testString', + name='testString', + vpc_id='testString', + vpc_crn='testString', + vpc_name='testString', + dedicated_host_id='testString', + dedicated_host_crn='testString', + dedicated_host_name='testString', + placement_group_id='testString', + placement_group_crn='testString', + placement_group_name='testString', + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + class TestCreateInstance(): """ Test Class for create_instance @@ -6818,7 +7494,7 @@ def test_create_instance_all_params(self): """ # Set up mock url = preprocess_url('/instances') - mock_response = '{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/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", "resource_type": "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", "resource_type": "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"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4}, "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", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "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"}}, "catalog_offering": {"version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/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"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 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", "resource_type": "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", "resource_type": "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"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4}, "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", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.POST, url, body=mock_response, @@ -6893,6 +7569,7 @@ def test_create_instance_all_params(self): volume_attachment_volume_prototype_instance_context_model['iops'] = 10000 volume_attachment_volume_prototype_instance_context_model['name'] = 'my-data-volume' volume_attachment_volume_prototype_instance_context_model['profile'] = volume_profile_identity_model + volume_attachment_volume_prototype_instance_context_model['user_tags'] = ['testString'] volume_attachment_volume_prototype_instance_context_model['capacity'] = 1000 volume_attachment_volume_prototype_instance_context_model['encryption_key'] = encryption_key_identity_model @@ -6913,6 +7590,7 @@ def test_create_instance_all_params(self): volume_prototype_instance_by_image_context_model['iops'] = 10000 volume_prototype_instance_by_image_context_model['name'] = 'my-boot-volume' volume_prototype_instance_by_image_context_model['profile'] = volume_profile_identity_model + volume_prototype_instance_by_image_context_model['user_tags'] = ['testString'] # Construct a dict representation of a VolumeAttachmentPrototypeInstanceByImageContext model volume_attachment_prototype_instance_by_image_context_model = {} @@ -6980,7 +7658,7 @@ def test_create_instance_value_error(self): """ # Set up mock url = preprocess_url('/instances') - mock_response = '{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/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", "resource_type": "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", "resource_type": "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"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4}, "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", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "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"}}, "catalog_offering": {"version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/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"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 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", "resource_type": "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", "resource_type": "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"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4}, "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", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.POST, url, body=mock_response, @@ -7055,6 +7733,7 @@ def test_create_instance_value_error(self): volume_attachment_volume_prototype_instance_context_model['iops'] = 10000 volume_attachment_volume_prototype_instance_context_model['name'] = 'my-data-volume' volume_attachment_volume_prototype_instance_context_model['profile'] = volume_profile_identity_model + volume_attachment_volume_prototype_instance_context_model['user_tags'] = ['testString'] volume_attachment_volume_prototype_instance_context_model['capacity'] = 1000 volume_attachment_volume_prototype_instance_context_model['encryption_key'] = encryption_key_identity_model @@ -7075,6 +7754,7 @@ def test_create_instance_value_error(self): volume_prototype_instance_by_image_context_model['iops'] = 10000 volume_prototype_instance_by_image_context_model['name'] = 'my-boot-volume' volume_prototype_instance_by_image_context_model['profile'] = volume_profile_identity_model + volume_prototype_instance_by_image_context_model['user_tags'] = ['testString'] # Construct a dict representation of a VolumeAttachmentPrototypeInstanceByImageContext model volume_attachment_prototype_instance_by_image_context_model = {} @@ -7122,7 +7802,6 @@ def test_create_instance_value_error(self): with pytest.raises(ValueError): _service.create_instance(**req_copy) - def test_create_instance_value_error_with_retries(self): # Enable retries and run test_create_instance_value_error. _service.enable_retries() @@ -7193,7 +7872,6 @@ def test_delete_instance_value_error(self): with pytest.raises(ValueError): _service.delete_instance(**req_copy) - def test_delete_instance_value_error_with_retries(self): # Enable retries and run test_delete_instance_value_error. _service.enable_retries() @@ -7215,7 +7893,7 @@ def test_get_instance_all_params(self): """ # Set up mock url = preprocess_url('/instances/testString') - mock_response = '{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/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", "resource_type": "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", "resource_type": "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"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4}, "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", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "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"}}, "catalog_offering": {"version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/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"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 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", "resource_type": "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", "resource_type": "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"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4}, "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", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.GET, url, body=mock_response, @@ -7251,7 +7929,7 @@ def test_get_instance_value_error(self): """ # Set up mock url = preprocess_url('/instances/testString') - mock_response = '{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/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", "resource_type": "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", "resource_type": "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"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4}, "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", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "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"}}, "catalog_offering": {"version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/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"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 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", "resource_type": "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", "resource_type": "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"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4}, "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", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.GET, url, body=mock_response, @@ -7270,7 +7948,6 @@ def test_get_instance_value_error(self): with pytest.raises(ValueError): _service.get_instance(**req_copy) - def test_get_instance_value_error_with_retries(self): # Enable retries and run test_get_instance_value_error. _service.enable_retries() @@ -7292,7 +7969,7 @@ def test_update_instance_all_params(self): """ # Set up mock url = preprocess_url('/instances/testString') - mock_response = '{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/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", "resource_type": "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", "resource_type": "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"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4}, "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", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "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"}}, "catalog_offering": {"version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/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"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 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", "resource_type": "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", "resource_type": "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"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4}, "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", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.PATCH, url, body=mock_response, @@ -7358,7 +8035,7 @@ def test_update_instance_value_error(self): """ # Set up mock url = preprocess_url('/instances/testString') - mock_response = '{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/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", "resource_type": "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", "resource_type": "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"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4}, "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", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "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"}}, "catalog_offering": {"version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/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"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 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", "resource_type": "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", "resource_type": "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"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4}, "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", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.PATCH, url, body=mock_response, @@ -7404,7 +8081,6 @@ def test_update_instance_value_error(self): with pytest.raises(ValueError): _service.update_instance(**req_copy) - def test_update_instance_value_error_with_retries(self): # Enable retries and run test_update_instance_value_error. _service.enable_retries() @@ -7481,7 +8157,6 @@ def test_get_instance_initialization_value_error(self): with pytest.raises(ValueError): _service.get_instance_initialization(**req_copy) - def test_get_instance_initialization_value_error_with_retries(self): # Enable retries and run test_get_instance_initialization_value_error. _service.enable_retries() @@ -7569,7 +8244,6 @@ def test_create_instance_action_value_error(self): with pytest.raises(ValueError): _service.create_instance_action(**req_copy) - def test_create_instance_action_value_error_with_retries(self): # Enable retries and run test_create_instance_action_value_error. _service.enable_retries() @@ -7657,7 +8331,6 @@ def test_create_instance_console_access_token_value_error(self): with pytest.raises(ValueError): _service.create_instance_console_access_token(**req_copy) - def test_create_instance_console_access_token_value_error_with_retries(self): # Enable retries and run test_create_instance_console_access_token_value_error. _service.enable_retries() @@ -7734,7 +8407,6 @@ def test_list_instance_disks_value_error(self): with pytest.raises(ValueError): _service.list_instance_disks(**req_copy) - def test_list_instance_disks_value_error_with_retries(self): # Enable retries and run test_list_instance_disks_value_error. _service.enable_retries() @@ -7815,7 +8487,6 @@ def test_get_instance_disk_value_error(self): with pytest.raises(ValueError): _service.get_instance_disk(**req_copy) - def test_get_instance_disk_value_error_with_retries(self): # Enable retries and run test_get_instance_disk_value_error. _service.enable_retries() @@ -7911,7 +8582,6 @@ def test_update_instance_disk_value_error(self): with pytest.raises(ValueError): _service.update_instance_disk(**req_copy) - def test_update_instance_disk_value_error_with_retries(self): # Enable retries and run test_update_instance_disk_value_error. _service.enable_retries() @@ -7988,7 +8658,6 @@ def test_list_instance_network_interfaces_value_error(self): with pytest.raises(ValueError): _service.list_instance_network_interfaces(**req_copy) - def test_list_instance_network_interfaces_value_error_with_retries(self): # Enable retries and run test_list_instance_network_interfaces_value_error. _service.enable_retries() @@ -8116,7 +8785,6 @@ def test_create_instance_network_interface_value_error(self): with pytest.raises(ValueError): _service.create_instance_network_interface(**req_copy) - def test_create_instance_network_interface_value_error_with_retries(self): # Enable retries and run test_create_instance_network_interface_value_error. _service.enable_retries() @@ -8191,7 +8859,6 @@ def test_delete_instance_network_interface_value_error(self): with pytest.raises(ValueError): _service.delete_instance_network_interface(**req_copy) - def test_delete_instance_network_interface_value_error_with_retries(self): # Enable retries and run test_delete_instance_network_interface_value_error. _service.enable_retries() @@ -8272,7 +8939,6 @@ def test_get_instance_network_interface_value_error(self): with pytest.raises(ValueError): _service.get_instance_network_interface(**req_copy) - def test_get_instance_network_interface_value_error_with_retries(self): # Enable retries and run test_get_instance_network_interface_value_error. _service.enable_retries() @@ -8370,7 +9036,6 @@ def test_update_instance_network_interface_value_error(self): with pytest.raises(ValueError): _service.update_instance_network_interface(**req_copy) - def test_update_instance_network_interface_value_error_with_retries(self): # Enable retries and run test_update_instance_network_interface_value_error. _service.enable_retries() @@ -8451,7 +9116,6 @@ def test_list_instance_network_interface_floating_ips_value_error(self): with pytest.raises(ValueError): _service.list_instance_network_interface_floating_ips(**req_copy) - def test_list_instance_network_interface_floating_ips_value_error_with_retries(self): # Enable retries and run test_list_instance_network_interface_floating_ips_value_error. _service.enable_retries() @@ -8530,7 +9194,6 @@ def test_remove_instance_network_interface_floating_ip_value_error(self): with pytest.raises(ValueError): _service.remove_instance_network_interface_floating_ip(**req_copy) - def test_remove_instance_network_interface_floating_ip_value_error_with_retries(self): # Enable retries and run test_remove_instance_network_interface_floating_ip_value_error. _service.enable_retries() @@ -8615,7 +9278,6 @@ def test_get_instance_network_interface_floating_ip_value_error(self): with pytest.raises(ValueError): _service.get_instance_network_interface_floating_ip(**req_copy) - def test_get_instance_network_interface_floating_ip_value_error_with_retries(self): # Enable retries and run test_get_instance_network_interface_floating_ip_value_error. _service.enable_retries() @@ -8700,7 +9362,6 @@ def test_add_instance_network_interface_floating_ip_value_error(self): with pytest.raises(ValueError): _service.add_instance_network_interface_floating_ip(**req_copy) - def test_add_instance_network_interface_floating_ip_value_error_with_retries(self): # Enable retries and run test_add_instance_network_interface_floating_ip_value_error. _service.enable_retries() @@ -8828,7 +9489,6 @@ def test_list_instance_network_interface_ips_value_error(self): 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() @@ -8838,6 +9498,71 @@ def test_list_instance_network_interface_ips_value_error_with_retries(self): _service.disable_retries() self.test_list_instance_network_interface_ips_value_error() + @responses.activate + def test_list_instance_network_interface_ips_with_pager_get_next(self): + """ + test_list_instance_network_interface_ips_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/instances/testString/network_interfaces/testString/ips') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"ips":[{"address":"192.168.3.4","auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/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"}}]}' + mock_response2 = '{"total_count":2,"limit":1,"ips":[{"address":"192.168.3.4","auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/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_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + all_results = [] + pager = InstanceNetworkInterfaceIpsPager( + client=_service, + instance_id='testString', + network_interface_id='testString', + limit=10, + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 + + @responses.activate + def test_list_instance_network_interface_ips_with_pager_get_all(self): + """ + test_list_instance_network_interface_ips_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/instances/testString/network_interfaces/testString/ips') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"ips":[{"address":"192.168.3.4","auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/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"}}]}' + mock_response2 = '{"total_count":2,"limit":1,"ips":[{"address":"192.168.3.4","auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/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_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + pager = InstanceNetworkInterfaceIpsPager( + client=_service, + instance_id='testString', + network_interface_id='testString', + limit=10, + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + class TestGetInstanceNetworkInterfaceIp(): """ Test Class for get_instance_network_interface_ip @@ -8913,7 +9638,6 @@ def test_get_instance_network_interface_ip_value_error(self): 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() @@ -8990,7 +9714,6 @@ def test_list_instance_volume_attachments_value_error(self): with pytest.raises(ValueError): _service.list_instance_volume_attachments(**req_copy) - def test_list_instance_volume_attachments_value_error_with_retries(self): # Enable retries and run test_list_instance_volume_attachments_value_error. _service.enable_retries() @@ -9090,7 +9813,6 @@ def test_create_instance_volume_attachment_value_error(self): with pytest.raises(ValueError): _service.create_instance_volume_attachment(**req_copy) - def test_create_instance_volume_attachment_value_error_with_retries(self): # Enable retries and run test_create_instance_volume_attachment_value_error. _service.enable_retries() @@ -9165,7 +9887,6 @@ def test_delete_instance_volume_attachment_value_error(self): with pytest.raises(ValueError): _service.delete_instance_volume_attachment(**req_copy) - def test_delete_instance_volume_attachment_value_error_with_retries(self): # Enable retries and run test_delete_instance_volume_attachment_value_error. _service.enable_retries() @@ -9246,7 +9967,6 @@ def test_get_instance_volume_attachment_value_error(self): with pytest.raises(ValueError): _service.get_instance_volume_attachment(**req_copy) - def test_get_instance_volume_attachment_value_error_with_retries(self): # Enable retries and run test_get_instance_volume_attachment_value_error. _service.enable_retries() @@ -9344,7 +10064,6 @@ def test_update_instance_volume_attachment_value_error(self): with pytest.raises(ValueError): _service.update_instance_volume_attachment(**req_copy) - def test_update_instance_volume_attachment_value_error_with_retries(self): # Enable retries and run test_update_instance_volume_attachment_value_error. _service.enable_retries() @@ -9408,6 +10127,7 @@ def test_new_instance_required_param_none(self): service = VpcV1.new_instance( version=None, ) + class TestListInstanceGroups(): """ Test Class for list_instance_groups @@ -9509,7 +10229,6 @@ def test_list_instance_groups_value_error(self): with pytest.raises(ValueError): _service.list_instance_groups(**req_copy) - def test_list_instance_groups_value_error_with_retries(self): # Enable retries and run test_list_instance_groups_value_error. _service.enable_retries() @@ -9519,6 +10238,67 @@ def test_list_instance_groups_value_error_with_retries(self): _service.disable_retries() self.test_list_instance_groups_value_error() + @responses.activate + def test_list_instance_groups_with_pager_get_next(self): + """ + test_list_instance_groups_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/instance_groups') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"instance_groups":[{"application_port":22,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a","href":"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","instance_template":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"a6b1a881-2ce8-41a3-80fc-36316a73f803","name":"my-instance-template"},"load_balancer_pool":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004","id":"70294e14-4e61-11e8-bcf4-0242ac110004","name":"my-load-balancer-pool"},"managers":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-instance-group-manager"}],"membership_count":10,"name":"my-instance-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"status":"deleting","subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/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","resource_type":"subnet"}],"updated_at":"2019-01-01T12:00:00.000Z","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","resource_type":"vpc"}}]}' + mock_response2 = '{"total_count":2,"limit":1,"instance_groups":[{"application_port":22,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a","href":"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","instance_template":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"a6b1a881-2ce8-41a3-80fc-36316a73f803","name":"my-instance-template"},"load_balancer_pool":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004","id":"70294e14-4e61-11e8-bcf4-0242ac110004","name":"my-load-balancer-pool"},"managers":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-instance-group-manager"}],"membership_count":10,"name":"my-instance-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"status":"deleting","subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/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","resource_type":"subnet"}],"updated_at":"2019-01-01T12:00:00.000Z","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","resource_type":"vpc"}}]}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + all_results = [] + pager = InstanceGroupsPager( + client=_service, + limit=10, + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 + + @responses.activate + def test_list_instance_groups_with_pager_get_all(self): + """ + test_list_instance_groups_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/instance_groups') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"instance_groups":[{"application_port":22,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a","href":"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","instance_template":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"a6b1a881-2ce8-41a3-80fc-36316a73f803","name":"my-instance-template"},"load_balancer_pool":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004","id":"70294e14-4e61-11e8-bcf4-0242ac110004","name":"my-load-balancer-pool"},"managers":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-instance-group-manager"}],"membership_count":10,"name":"my-instance-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"status":"deleting","subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/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","resource_type":"subnet"}],"updated_at":"2019-01-01T12:00:00.000Z","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","resource_type":"vpc"}}]}' + mock_response2 = '{"total_count":2,"limit":1,"instance_groups":[{"application_port":22,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a","href":"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","instance_template":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"a6b1a881-2ce8-41a3-80fc-36316a73f803","name":"my-instance-template"},"load_balancer_pool":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004","id":"70294e14-4e61-11e8-bcf4-0242ac110004","name":"my-load-balancer-pool"},"managers":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-instance-group-manager"}],"membership_count":10,"name":"my-instance-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"status":"deleting","subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/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","resource_type":"subnet"}],"updated_at":"2019-01-01T12:00:00.000Z","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","resource_type":"vpc"}}]}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + pager = InstanceGroupsPager( + client=_service, + limit=10, + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + class TestCreateInstanceGroup(): """ Test Class for create_instance_group @@ -9658,7 +10438,6 @@ def test_create_instance_group_value_error(self): with pytest.raises(ValueError): _service.create_instance_group(**req_copy) - def test_create_instance_group_value_error_with_retries(self): # Enable retries and run test_create_instance_group_value_error. _service.enable_retries() @@ -9729,7 +10508,6 @@ def test_delete_instance_group_value_error(self): with pytest.raises(ValueError): _service.delete_instance_group(**req_copy) - def test_delete_instance_group_value_error_with_retries(self): # Enable retries and run test_delete_instance_group_value_error. _service.enable_retries() @@ -9806,7 +10584,6 @@ def test_get_instance_group_value_error(self): with pytest.raises(ValueError): _service.get_instance_group(**req_copy) - def test_get_instance_group_value_error_with_retries(self): # Enable retries and run test_get_instance_group_value_error. _service.enable_retries() @@ -9942,7 +10719,6 @@ def test_update_instance_group_value_error(self): with pytest.raises(ValueError): _service.update_instance_group(**req_copy) - def test_update_instance_group_value_error_with_retries(self): # Enable retries and run test_update_instance_group_value_error. _service.enable_retries() @@ -10013,7 +10789,6 @@ def test_delete_instance_group_load_balancer_value_error(self): with pytest.raises(ValueError): _service.delete_instance_group_load_balancer(**req_copy) - def test_delete_instance_group_load_balancer_value_error_with_retries(self): # Enable retries and run test_delete_instance_group_load_balancer_value_error. _service.enable_retries() @@ -10135,7 +10910,6 @@ def test_list_instance_group_managers_value_error(self): with pytest.raises(ValueError): _service.list_instance_group_managers(**req_copy) - def test_list_instance_group_managers_value_error_with_retries(self): # Enable retries and run test_list_instance_group_managers_value_error. _service.enable_retries() @@ -10145,6 +10919,69 @@ def test_list_instance_group_managers_value_error_with_retries(self): _service.disable_retries() self.test_list_instance_group_managers_value_error() + @responses.activate + def test_list_instance_group_managers_with_pager_get_next(self): + """ + test_list_instance_group_managers_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/instance_groups/testString/managers') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"managers":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","management_enabled":true,"name":"my-instance-group-manager","updated_at":"2019-01-01T12:00:00.000Z","aggregation_window":120,"cooldown":210,"manager_type":"autoscale","max_membership_count":10,"min_membership_count":10,"policies":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-instance-group-manager-policy"}]}]}' + mock_response2 = '{"total_count":2,"limit":1,"managers":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","management_enabled":true,"name":"my-instance-group-manager","updated_at":"2019-01-01T12:00:00.000Z","aggregation_window":120,"cooldown":210,"manager_type":"autoscale","max_membership_count":10,"min_membership_count":10,"policies":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-instance-group-manager-policy"}]}]}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + all_results = [] + pager = InstanceGroupManagersPager( + client=_service, + instance_group_id='testString', + limit=10, + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 + + @responses.activate + def test_list_instance_group_managers_with_pager_get_all(self): + """ + test_list_instance_group_managers_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/instance_groups/testString/managers') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"managers":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","management_enabled":true,"name":"my-instance-group-manager","updated_at":"2019-01-01T12:00:00.000Z","aggregation_window":120,"cooldown":210,"manager_type":"autoscale","max_membership_count":10,"min_membership_count":10,"policies":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-instance-group-manager-policy"}]}]}' + mock_response2 = '{"total_count":2,"limit":1,"managers":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","management_enabled":true,"name":"my-instance-group-manager","updated_at":"2019-01-01T12:00:00.000Z","aggregation_window":120,"cooldown":210,"manager_type":"autoscale","max_membership_count":10,"min_membership_count":10,"policies":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-instance-group-manager-policy"}]}]}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + pager = InstanceGroupManagersPager( + client=_service, + instance_group_id='testString', + limit=10, + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + class TestCreateInstanceGroupManager(): """ Test Class for create_instance_group_manager @@ -10239,7 +11076,6 @@ def test_create_instance_group_manager_value_error(self): with pytest.raises(ValueError): _service.create_instance_group_manager(**req_copy) - def test_create_instance_group_manager_value_error_with_retries(self): # Enable retries and run test_create_instance_group_manager_value_error. _service.enable_retries() @@ -10314,7 +11150,6 @@ def test_delete_instance_group_manager_value_error(self): with pytest.raises(ValueError): _service.delete_instance_group_manager(**req_copy) - def test_delete_instance_group_manager_value_error_with_retries(self): # Enable retries and run test_delete_instance_group_manager_value_error. _service.enable_retries() @@ -10395,7 +11230,6 @@ def test_get_instance_group_manager_value_error(self): with pytest.raises(ValueError): _service.get_instance_group_manager(**req_copy) - def test_get_instance_group_manager_value_error_with_retries(self): # Enable retries and run test_get_instance_group_manager_value_error. _service.enable_retries() @@ -10501,7 +11335,6 @@ def test_update_instance_group_manager_value_error(self): with pytest.raises(ValueError): _service.update_instance_group_manager(**req_copy) - def test_update_instance_group_manager_value_error_with_retries(self): # Enable retries and run test_update_instance_group_manager_value_error. _service.enable_retries() @@ -10629,7 +11462,6 @@ def test_list_instance_group_manager_actions_value_error(self): with pytest.raises(ValueError): _service.list_instance_group_manager_actions(**req_copy) - def test_list_instance_group_manager_actions_value_error_with_retries(self): # Enable retries and run test_list_instance_group_manager_actions_value_error. _service.enable_retries() @@ -10639,6 +11471,71 @@ def test_list_instance_group_manager_actions_value_error_with_retries(self): _service.disable_retries() self.test_list_instance_group_manager_actions_value_error() + @responses.activate + def test_list_instance_group_manager_actions_with_pager_get_next(self): + """ + test_list_instance_group_manager_actions_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/instance_groups/testString/managers/testString/actions') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"actions":[{"auto_delete":true,"auto_delete_timeout":24,"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-instance-group-manager-action","resource_type":"instance_group_manager_action","status":"active","updated_at":"2019-01-01T12:00:00.000Z","action_type":"scheduled","cron_spec":"*/5 1,2,3 * * *","last_applied_at":"2019-01-01T12:00:00.000Z","next_run_at":"2019-01-01T12:00:00.000Z","group":{"membership_count":10}}]}' + mock_response2 = '{"total_count":2,"limit":1,"actions":[{"auto_delete":true,"auto_delete_timeout":24,"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-instance-group-manager-action","resource_type":"instance_group_manager_action","status":"active","updated_at":"2019-01-01T12:00:00.000Z","action_type":"scheduled","cron_spec":"*/5 1,2,3 * * *","last_applied_at":"2019-01-01T12:00:00.000Z","next_run_at":"2019-01-01T12:00:00.000Z","group":{"membership_count":10}}]}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + all_results = [] + pager = InstanceGroupManagerActionsPager( + client=_service, + instance_group_id='testString', + instance_group_manager_id='testString', + limit=10, + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 + + @responses.activate + def test_list_instance_group_manager_actions_with_pager_get_all(self): + """ + test_list_instance_group_manager_actions_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/instance_groups/testString/managers/testString/actions') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"actions":[{"auto_delete":true,"auto_delete_timeout":24,"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-instance-group-manager-action","resource_type":"instance_group_manager_action","status":"active","updated_at":"2019-01-01T12:00:00.000Z","action_type":"scheduled","cron_spec":"*/5 1,2,3 * * *","last_applied_at":"2019-01-01T12:00:00.000Z","next_run_at":"2019-01-01T12:00:00.000Z","group":{"membership_count":10}}]}' + mock_response2 = '{"total_count":2,"limit":1,"actions":[{"auto_delete":true,"auto_delete_timeout":24,"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-instance-group-manager-action","resource_type":"instance_group_manager_action","status":"active","updated_at":"2019-01-01T12:00:00.000Z","action_type":"scheduled","cron_spec":"*/5 1,2,3 * * *","last_applied_at":"2019-01-01T12:00:00.000Z","next_run_at":"2019-01-01T12:00:00.000Z","group":{"membership_count":10}}]}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + pager = InstanceGroupManagerActionsPager( + client=_service, + instance_group_id='testString', + instance_group_manager_id='testString', + limit=10, + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + class TestCreateInstanceGroupManagerAction(): """ Test Class for create_instance_group_manager_action @@ -10737,7 +11634,6 @@ def test_create_instance_group_manager_action_value_error(self): with pytest.raises(ValueError): _service.create_instance_group_manager_action(**req_copy) - def test_create_instance_group_manager_action_value_error_with_retries(self): # Enable retries and run test_create_instance_group_manager_action_value_error. _service.enable_retries() @@ -10816,7 +11712,6 @@ def test_delete_instance_group_manager_action_value_error(self): with pytest.raises(ValueError): _service.delete_instance_group_manager_action(**req_copy) - def test_delete_instance_group_manager_action_value_error_with_retries(self): # Enable retries and run test_delete_instance_group_manager_action_value_error. _service.enable_retries() @@ -10901,7 +11796,6 @@ def test_get_instance_group_manager_action_value_error(self): with pytest.raises(ValueError): _service.get_instance_group_manager_action(**req_copy) - def test_get_instance_group_manager_action_value_error_with_retries(self): # Enable retries and run test_get_instance_group_manager_action_value_error. _service.enable_retries() @@ -11027,7 +11921,6 @@ def test_update_instance_group_manager_action_value_error(self): with pytest.raises(ValueError): _service.update_instance_group_manager_action(**req_copy) - def test_update_instance_group_manager_action_value_error_with_retries(self): # Enable retries and run test_update_instance_group_manager_action_value_error. _service.enable_retries() @@ -11155,7 +12048,6 @@ def test_list_instance_group_manager_policies_value_error(self): with pytest.raises(ValueError): _service.list_instance_group_manager_policies(**req_copy) - def test_list_instance_group_manager_policies_value_error_with_retries(self): # Enable retries and run test_list_instance_group_manager_policies_value_error. _service.enable_retries() @@ -11165,6 +12057,71 @@ def test_list_instance_group_manager_policies_value_error_with_retries(self): _service.disable_retries() self.test_list_instance_group_manager_policies_value_error() + @responses.activate + def test_list_instance_group_manager_policies_with_pager_get_next(self): + """ + test_list_instance_group_manager_policies_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/instance_groups/testString/managers/testString/policies') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"policies":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-instance-group-manager-policy","updated_at":"2019-01-01T12:00:00.000Z","metric_type":"cpu","metric_value":12,"policy_type":"target"}]}' + mock_response2 = '{"total_count":2,"limit":1,"policies":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-instance-group-manager-policy","updated_at":"2019-01-01T12:00:00.000Z","metric_type":"cpu","metric_value":12,"policy_type":"target"}]}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + all_results = [] + pager = InstanceGroupManagerPoliciesPager( + client=_service, + instance_group_id='testString', + instance_group_manager_id='testString', + limit=10, + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 + + @responses.activate + def test_list_instance_group_manager_policies_with_pager_get_all(self): + """ + test_list_instance_group_manager_policies_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/instance_groups/testString/managers/testString/policies') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"policies":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-instance-group-manager-policy","updated_at":"2019-01-01T12:00:00.000Z","metric_type":"cpu","metric_value":12,"policy_type":"target"}]}' + mock_response2 = '{"total_count":2,"limit":1,"policies":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-instance-group-manager-policy","updated_at":"2019-01-01T12:00:00.000Z","metric_type":"cpu","metric_value":12,"policy_type":"target"}]}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + pager = InstanceGroupManagerPoliciesPager( + client=_service, + instance_group_id='testString', + instance_group_manager_id='testString', + limit=10, + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + class TestCreateInstanceGroupManagerPolicy(): """ Test Class for create_instance_group_manager_policy @@ -11257,7 +12214,6 @@ def test_create_instance_group_manager_policy_value_error(self): with pytest.raises(ValueError): _service.create_instance_group_manager_policy(**req_copy) - def test_create_instance_group_manager_policy_value_error_with_retries(self): # Enable retries and run test_create_instance_group_manager_policy_value_error. _service.enable_retries() @@ -11336,7 +12292,6 @@ def test_delete_instance_group_manager_policy_value_error(self): with pytest.raises(ValueError): _service.delete_instance_group_manager_policy(**req_copy) - def test_delete_instance_group_manager_policy_value_error_with_retries(self): # Enable retries and run test_delete_instance_group_manager_policy_value_error. _service.enable_retries() @@ -11421,7 +12376,6 @@ def test_get_instance_group_manager_policy_value_error(self): with pytest.raises(ValueError): _service.get_instance_group_manager_policy(**req_copy) - def test_get_instance_group_manager_policy_value_error_with_retries(self): # Enable retries and run test_get_instance_group_manager_policy_value_error. _service.enable_retries() @@ -11525,7 +12479,6 @@ def test_update_instance_group_manager_policy_value_error(self): with pytest.raises(ValueError): _service.update_instance_group_manager_policy(**req_copy) - def test_update_instance_group_manager_policy_value_error_with_retries(self): # Enable retries and run test_update_instance_group_manager_policy_value_error. _service.enable_retries() @@ -11596,7 +12549,6 @@ def test_delete_instance_group_memberships_value_error(self): with pytest.raises(ValueError): _service.delete_instance_group_memberships(**req_copy) - def test_delete_instance_group_memberships_value_error_with_retries(self): # Enable retries and run test_delete_instance_group_memberships_value_error. _service.enable_retries() @@ -11718,7 +12670,6 @@ def test_list_instance_group_memberships_value_error(self): with pytest.raises(ValueError): _service.list_instance_group_memberships(**req_copy) - def test_list_instance_group_memberships_value_error_with_retries(self): # Enable retries and run test_list_instance_group_memberships_value_error. _service.enable_retries() @@ -11728,6 +12679,69 @@ def test_list_instance_group_memberships_value_error_with_retries(self): _service.disable_retries() self.test_list_instance_group_memberships_value_error() + @responses.activate + def test_list_instance_group_memberships_with_pager_get_next(self): + """ + test_list_instance_group_memberships_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/instance_groups/testString/memberships') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"memberships":[{"created_at":"2019-01-01T12:00:00.000Z","delete_instance_on_membership_delete":true,"href":"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/memberships/8b002d86-601f-11ea-898b-000c29475bed","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","instance":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/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"},"instance_template":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"a6b1a881-2ce8-41a3-80fc-36316a73f803","name":"my-instance-template"},"name":"my-instance-group-membership","pool_member":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004","id":"70294e14-4e61-11e8-bcf4-0242ac110004"},"status":"deleting","updated_at":"2019-01-01T12:00:00.000Z"}]}' + mock_response2 = '{"total_count":2,"limit":1,"memberships":[{"created_at":"2019-01-01T12:00:00.000Z","delete_instance_on_membership_delete":true,"href":"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/memberships/8b002d86-601f-11ea-898b-000c29475bed","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","instance":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/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"},"instance_template":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"a6b1a881-2ce8-41a3-80fc-36316a73f803","name":"my-instance-template"},"name":"my-instance-group-membership","pool_member":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004","id":"70294e14-4e61-11e8-bcf4-0242ac110004"},"status":"deleting","updated_at":"2019-01-01T12:00:00.000Z"}]}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + all_results = [] + pager = InstanceGroupMembershipsPager( + client=_service, + instance_group_id='testString', + limit=10, + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 + + @responses.activate + def test_list_instance_group_memberships_with_pager_get_all(self): + """ + test_list_instance_group_memberships_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/instance_groups/testString/memberships') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"memberships":[{"created_at":"2019-01-01T12:00:00.000Z","delete_instance_on_membership_delete":true,"href":"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/memberships/8b002d86-601f-11ea-898b-000c29475bed","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","instance":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/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"},"instance_template":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"a6b1a881-2ce8-41a3-80fc-36316a73f803","name":"my-instance-template"},"name":"my-instance-group-membership","pool_member":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004","id":"70294e14-4e61-11e8-bcf4-0242ac110004"},"status":"deleting","updated_at":"2019-01-01T12:00:00.000Z"}]}' + mock_response2 = '{"total_count":2,"limit":1,"memberships":[{"created_at":"2019-01-01T12:00:00.000Z","delete_instance_on_membership_delete":true,"href":"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/memberships/8b002d86-601f-11ea-898b-000c29475bed","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","instance":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/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"},"instance_template":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"a6b1a881-2ce8-41a3-80fc-36316a73f803","name":"my-instance-template"},"name":"my-instance-group-membership","pool_member":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004","id":"70294e14-4e61-11e8-bcf4-0242ac110004"},"status":"deleting","updated_at":"2019-01-01T12:00:00.000Z"}]}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + pager = InstanceGroupMembershipsPager( + client=_service, + instance_group_id='testString', + limit=10, + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + class TestDeleteInstanceGroupMembership(): """ Test Class for delete_instance_group_membership @@ -11793,7 +12807,6 @@ def test_delete_instance_group_membership_value_error(self): with pytest.raises(ValueError): _service.delete_instance_group_membership(**req_copy) - def test_delete_instance_group_membership_value_error_with_retries(self): # Enable retries and run test_delete_instance_group_membership_value_error. _service.enable_retries() @@ -11874,7 +12887,6 @@ def test_get_instance_group_membership_value_error(self): with pytest.raises(ValueError): _service.get_instance_group_membership(**req_copy) - def test_get_instance_group_membership_value_error_with_retries(self): # Enable retries and run test_get_instance_group_membership_value_error. _service.enable_retries() @@ -11970,7 +12982,6 @@ def test_update_instance_group_membership_value_error(self): with pytest.raises(ValueError): _service.update_instance_group_membership(**req_copy) - def test_update_instance_group_membership_value_error_with_retries(self): # Enable retries and run test_update_instance_group_membership_value_error. _service.enable_retries() @@ -12034,6 +13045,7 @@ def test_new_instance_required_param_none(self): service = VpcV1.new_instance( version=None, ) + class TestListDedicatedHostGroups(): """ Test Class for list_dedicated_host_groups @@ -12144,7 +13156,6 @@ def test_list_dedicated_host_groups_value_error(self): with pytest.raises(ValueError): _service.list_dedicated_host_groups(**req_copy) - def test_list_dedicated_host_groups_value_error_with_retries(self): # Enable retries and run test_list_dedicated_host_groups_value_error. _service.enable_retries() @@ -12154,6 +13165,73 @@ def test_list_dedicated_host_groups_value_error_with_retries(self): _service.disable_retries() self.test_list_dedicated_host_groups_value_error() + @responses.activate + def test_list_dedicated_host_groups_with_pager_get_next(self): + """ + test_list_dedicated_host_groups_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/dedicated_host/groups') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"groups":[{"class":"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"}}]}' + mock_response2 = '{"total_count":2,"limit":1,"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"}}]}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + all_results = [] + pager = DedicatedHostGroupsPager( + client=_service, + limit=10, + resource_group_id='testString', + zone_name='testString', + name='testString', + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 + + @responses.activate + def test_list_dedicated_host_groups_with_pager_get_all(self): + """ + test_list_dedicated_host_groups_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/dedicated_host/groups') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"groups":[{"class":"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"}}]}' + mock_response2 = '{"total_count":2,"limit":1,"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"}}]}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + pager = DedicatedHostGroupsPager( + client=_service, + limit=10, + resource_group_id='testString', + zone_name='testString', + name='testString', + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + class TestCreateDedicatedHostGroup(): """ Test Class for create_dedicated_host_group @@ -12271,7 +13349,6 @@ def test_create_dedicated_host_group_value_error(self): with pytest.raises(ValueError): _service.create_dedicated_host_group(**req_copy) - def test_create_dedicated_host_group_value_error_with_retries(self): # Enable retries and run test_create_dedicated_host_group_value_error. _service.enable_retries() @@ -12342,7 +13419,6 @@ def test_delete_dedicated_host_group_value_error(self): with pytest.raises(ValueError): _service.delete_dedicated_host_group(**req_copy) - def test_delete_dedicated_host_group_value_error_with_retries(self): # Enable retries and run test_delete_dedicated_host_group_value_error. _service.enable_retries() @@ -12419,7 +13495,6 @@ def test_get_dedicated_host_group_value_error(self): with pytest.raises(ValueError): _service.get_dedicated_host_group(**req_copy) - def test_get_dedicated_host_group_value_error_with_retries(self): # Enable retries and run test_get_dedicated_host_group_value_error. _service.enable_retries() @@ -12450,7 +13525,7 @@ def test_update_dedicated_host_group_all_params(self): # Construct a dict representation of a DedicatedHostGroupPatch model dedicated_host_group_patch_model = {} - dedicated_host_group_patch_model['name'] = 'my-host-group-modified' + dedicated_host_group_patch_model['name'] = 'my-host-group-updated' # Set up parameter values id = 'testString' @@ -12495,7 +13570,7 @@ def test_update_dedicated_host_group_value_error(self): # Construct a dict representation of a DedicatedHostGroupPatch model dedicated_host_group_patch_model = {} - dedicated_host_group_patch_model['name'] = 'my-host-group-modified' + dedicated_host_group_patch_model['name'] = 'my-host-group-updated' # Set up parameter values id = 'testString' @@ -12511,7 +13586,6 @@ def test_update_dedicated_host_group_value_error(self): with pytest.raises(ValueError): _service.update_dedicated_host_group(**req_copy) - def test_update_dedicated_host_group_value_error_with_retries(self): # Enable retries and run test_update_dedicated_host_group_value_error. _service.enable_retries() @@ -12622,7 +13696,6 @@ def test_list_dedicated_host_profiles_value_error(self): with pytest.raises(ValueError): _service.list_dedicated_host_profiles(**req_copy) - def test_list_dedicated_host_profiles_value_error_with_retries(self): # Enable retries and run test_list_dedicated_host_profiles_value_error. _service.enable_retries() @@ -12632,6 +13705,67 @@ def test_list_dedicated_host_profiles_value_error_with_retries(self): _service.disable_retries() self.test_list_dedicated_host_profiles_value_error() + @responses.activate + def test_list_dedicated_host_profiles_with_pager_get_next(self): + """ + test_list_dedicated_host_profiles_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/dedicated_host/profiles') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"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}}]}' + mock_response2 = '{"total_count":2,"limit":1,"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}}]}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + all_results = [] + pager = DedicatedHostProfilesPager( + client=_service, + limit=10, + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 + + @responses.activate + def test_list_dedicated_host_profiles_with_pager_get_all(self): + """ + test_list_dedicated_host_profiles_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/dedicated_host/profiles') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"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}}]}' + mock_response2 = '{"total_count":2,"limit":1,"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}}]}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + pager = DedicatedHostProfilesPager( + client=_service, + limit=10, + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + class TestGetDedicatedHostProfile(): """ Test Class for get_dedicated_host_profile @@ -12699,7 +13833,6 @@ def test_get_dedicated_host_profile_value_error(self): with pytest.raises(ValueError): _service.get_dedicated_host_profile(**req_copy) - def test_get_dedicated_host_profile_value_error_with_retries(self): # Enable retries and run test_get_dedicated_host_profile_value_error. _service.enable_retries() @@ -12822,7 +13955,6 @@ def test_list_dedicated_hosts_value_error(self): with pytest.raises(ValueError): _service.list_dedicated_hosts(**req_copy) - def test_list_dedicated_hosts_value_error_with_retries(self): # Enable retries and run test_list_dedicated_hosts_value_error. _service.enable_retries() @@ -12832,6 +13964,75 @@ def test_list_dedicated_hosts_value_error_with_retries(self): _service.disable_retries() self.test_list_dedicated_hosts_value_error() + @responses.activate + def test_list_dedicated_hosts_with_pager_get_next(self): + """ + test_list_dedicated_hosts_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/dedicated_hosts') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"dedicated_hosts":[{"available_memory":128,"available_vcpu":{"architecture":"amd64","count":4},"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"}}],"total_count":2,"limit":1}' + mock_response2 = '{"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"}}],"total_count":2,"limit":1}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + all_results = [] + pager = DedicatedHostsPager( + client=_service, + dedicated_host_group_id='testString', + limit=10, + resource_group_id='testString', + zone_name='testString', + name='testString', + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 + + @responses.activate + def test_list_dedicated_hosts_with_pager_get_all(self): + """ + test_list_dedicated_hosts_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/dedicated_hosts') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"dedicated_hosts":[{"available_memory":128,"available_vcpu":{"architecture":"amd64","count":4},"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"}}],"total_count":2,"limit":1}' + mock_response2 = '{"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"}}],"total_count":2,"limit":1}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + pager = DedicatedHostsPager( + client=_service, + dedicated_host_group_id='testString', + limit=10, + resource_group_id='testString', + zone_name='testString', + name='testString', + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + class TestCreateDedicatedHost(): """ Test Class for create_dedicated_host @@ -12942,7 +14143,6 @@ def test_create_dedicated_host_value_error(self): with pytest.raises(ValueError): _service.create_dedicated_host(**req_copy) - def test_create_dedicated_host_value_error_with_retries(self): # Enable retries and run test_create_dedicated_host_value_error. _service.enable_retries() @@ -13019,7 +14219,6 @@ def test_list_dedicated_host_disks_value_error(self): with pytest.raises(ValueError): _service.list_dedicated_host_disks(**req_copy) - def test_list_dedicated_host_disks_value_error_with_retries(self): # Enable retries and run test_list_dedicated_host_disks_value_error. _service.enable_retries() @@ -13100,7 +14299,6 @@ def test_get_dedicated_host_disk_value_error(self): with pytest.raises(ValueError): _service.get_dedicated_host_disk(**req_copy) - def test_get_dedicated_host_disk_value_error_with_retries(self): # Enable retries and run test_get_dedicated_host_disk_value_error. _service.enable_retries() @@ -13196,7 +14394,6 @@ def test_update_dedicated_host_disk_value_error(self): with pytest.raises(ValueError): _service.update_dedicated_host_disk(**req_copy) - def test_update_dedicated_host_disk_value_error_with_retries(self): # Enable retries and run test_update_dedicated_host_disk_value_error. _service.enable_retries() @@ -13267,7 +14464,6 @@ def test_delete_dedicated_host_value_error(self): with pytest.raises(ValueError): _service.delete_dedicated_host(**req_copy) - def test_delete_dedicated_host_value_error_with_retries(self): # Enable retries and run test_delete_dedicated_host_value_error. _service.enable_retries() @@ -13344,7 +14540,6 @@ def test_get_dedicated_host_value_error(self): with pytest.raises(ValueError): _service.get_dedicated_host(**req_copy) - def test_get_dedicated_host_value_error_with_retries(self): # Enable retries and run test_get_dedicated_host_value_error. _service.enable_retries() @@ -13438,7 +14633,6 @@ def test_update_dedicated_host_value_error(self): with pytest.raises(ValueError): _service.update_dedicated_host(**req_copy) - def test_update_dedicated_host_value_error_with_retries(self): # Enable retries and run test_update_dedicated_host_value_error. _service.enable_retries() @@ -13502,6 +14696,7 @@ def test_new_instance_required_param_none(self): service = VpcV1.new_instance( version=None, ) + class TestListBackupPolicies(): """ Test Class for list_backup_policies @@ -13612,7 +14807,6 @@ def test_list_backup_policies_value_error(self): with pytest.raises(ValueError): _service.list_backup_policies(**req_copy) - def test_list_backup_policies_value_error_with_retries(self): # Enable retries and run test_list_backup_policies_value_error. _service.enable_retries() @@ -13622,6 +14816,73 @@ def test_list_backup_policies_value_error_with_retries(self): _service.disable_retries() self.test_list_backup_policies_value_error() + @responses.activate + def test_list_backup_policies_with_pager_get_next(self): + """ + test_list_backup_policies_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/backup_policies') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"backup_policies":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6","href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6","id":"r134-076191ba-49c2-4763-94fd-c70de73ee2e6","last_job_completed_at":"2019-01-01T12:00:00.000Z","lifecycle_state":"stable","match_resource_types":["volume"],"match_user_tags":["match_user_tags"],"name":"my-backup-policy","plans":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","resource_type":"backup_policy_plan"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"backup_policy"}],"total_count":2,"limit":1}' + mock_response2 = '{"backup_policies":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6","href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6","id":"r134-076191ba-49c2-4763-94fd-c70de73ee2e6","last_job_completed_at":"2019-01-01T12:00:00.000Z","lifecycle_state":"stable","match_resource_types":["volume"],"match_user_tags":["match_user_tags"],"name":"my-backup-policy","plans":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","resource_type":"backup_policy_plan"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"backup_policy"}],"total_count":2,"limit":1}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + all_results = [] + pager = BackupPoliciesPager( + client=_service, + limit=10, + resource_group_id='testString', + name='testString', + tag='testString', + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 + + @responses.activate + def test_list_backup_policies_with_pager_get_all(self): + """ + test_list_backup_policies_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/backup_policies') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"backup_policies":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6","href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6","id":"r134-076191ba-49c2-4763-94fd-c70de73ee2e6","last_job_completed_at":"2019-01-01T12:00:00.000Z","lifecycle_state":"stable","match_resource_types":["volume"],"match_user_tags":["match_user_tags"],"name":"my-backup-policy","plans":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","resource_type":"backup_policy_plan"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"backup_policy"}],"total_count":2,"limit":1}' + mock_response2 = '{"backup_policies":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6","href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6","id":"r134-076191ba-49c2-4763-94fd-c70de73ee2e6","last_job_completed_at":"2019-01-01T12:00:00.000Z","lifecycle_state":"stable","match_resource_types":["volume"],"match_user_tags":["match_user_tags"],"name":"my-backup-policy","plans":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","resource_type":"backup_policy_plan"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"backup_policy"}],"total_count":2,"limit":1}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + pager = BackupPoliciesPager( + client=_service, + limit=10, + resource_group_id='testString', + name='testString', + tag='testString', + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + class TestCreateBackupPolicy(): """ Test Class for create_backup_policy @@ -13749,7 +15010,6 @@ def test_create_backup_policy_value_error(self): with pytest.raises(ValueError): _service.create_backup_policy(**req_copy) - def test_create_backup_policy_value_error_with_retries(self): # Enable retries and run test_create_backup_policy_value_error. _service.enable_retries() @@ -13868,7 +15128,6 @@ def test_list_backup_policy_plans_value_error(self): with pytest.raises(ValueError): _service.list_backup_policy_plans(**req_copy) - def test_list_backup_policy_plans_value_error_with_retries(self): # Enable retries and run test_list_backup_policy_plans_value_error. _service.enable_retries() @@ -13982,7 +15241,6 @@ def test_create_backup_policy_plan_value_error(self): with pytest.raises(ValueError): _service.create_backup_policy_plan(**req_copy) - def test_create_backup_policy_plan_value_error_with_retries(self): # Enable retries and run test_create_backup_policy_plan_value_error. _service.enable_retries() @@ -14103,7 +15361,6 @@ def test_delete_backup_policy_plan_value_error(self): with pytest.raises(ValueError): _service.delete_backup_policy_plan(**req_copy) - def test_delete_backup_policy_plan_value_error_with_retries(self): # Enable retries and run test_delete_backup_policy_plan_value_error. _service.enable_retries() @@ -14184,7 +15441,6 @@ def test_get_backup_policy_plan_value_error(self): with pytest.raises(ValueError): _service.get_backup_policy_plan(**req_copy) - def test_get_backup_policy_plan_value_error_with_retries(self): # Enable retries and run test_get_backup_policy_plan_value_error. _service.enable_retries() @@ -14359,7 +15615,6 @@ def test_update_backup_policy_plan_value_error(self): with pytest.raises(ValueError): _service.update_backup_policy_plan(**req_copy) - def test_update_backup_policy_plan_value_error_with_retries(self): # Enable retries and run test_update_backup_policy_plan_value_error. _service.enable_retries() @@ -14474,7 +15729,6 @@ def test_delete_backup_policy_value_error(self): with pytest.raises(ValueError): _service.delete_backup_policy(**req_copy) - def test_delete_backup_policy_value_error_with_retries(self): # Enable retries and run test_delete_backup_policy_value_error. _service.enable_retries() @@ -14551,7 +15805,6 @@ def test_get_backup_policy_value_error(self): with pytest.raises(ValueError): _service.get_backup_policy(**req_copy) - def test_get_backup_policy_value_error_with_retries(self): # Enable retries and run test_get_backup_policy_value_error. _service.enable_retries() @@ -14693,7 +15946,6 @@ def test_update_backup_policy_value_error(self): with pytest.raises(ValueError): _service.update_backup_policy(**req_copy) - def test_update_backup_policy_value_error_with_retries(self): # Enable retries and run test_update_backup_policy_value_error. _service.enable_retries() @@ -14757,6 +16009,7 @@ def test_new_instance_required_param_none(self): service = VpcV1.new_instance( version=None, ) + class TestListPlacementGroups(): """ Test Class for list_placement_groups @@ -14858,7 +16111,6 @@ def test_list_placement_groups_value_error(self): with pytest.raises(ValueError): _service.list_placement_groups(**req_copy) - def test_list_placement_groups_value_error_with_retries(self): # Enable retries and run test_list_placement_groups_value_error. _service.enable_retries() @@ -14868,6 +16120,67 @@ def test_list_placement_groups_value_error_with_retries(self): _service.disable_retries() self.test_list_placement_groups_value_error() + @responses.activate + def test_list_placement_groups_with_pager_get_next(self): + """ + test_list_placement_groups_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/placement_groups') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"placement_groups":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871","href":"https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r018-418fe842-a3e9-47b9-a938-1aa5bd632871","id":"r018-418fe842-a3e9-47b9-a938-1aa5bd632871","lifecycle_state":"stable","name":"my-placement-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"placement_group","strategy":"host_spread"}]}' + mock_response2 = '{"total_count":2,"limit":1,"placement_groups":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871","href":"https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r018-418fe842-a3e9-47b9-a938-1aa5bd632871","id":"r018-418fe842-a3e9-47b9-a938-1aa5bd632871","lifecycle_state":"stable","name":"my-placement-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"placement_group","strategy":"host_spread"}]}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + all_results = [] + pager = PlacementGroupsPager( + client=_service, + limit=10, + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 + + @responses.activate + def test_list_placement_groups_with_pager_get_all(self): + """ + test_list_placement_groups_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/placement_groups') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"placement_groups":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871","href":"https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r018-418fe842-a3e9-47b9-a938-1aa5bd632871","id":"r018-418fe842-a3e9-47b9-a938-1aa5bd632871","lifecycle_state":"stable","name":"my-placement-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"placement_group","strategy":"host_spread"}]}' + mock_response2 = '{"total_count":2,"limit":1,"placement_groups":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871","href":"https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r018-418fe842-a3e9-47b9-a938-1aa5bd632871","id":"r018-418fe842-a3e9-47b9-a938-1aa5bd632871","lifecycle_state":"stable","name":"my-placement-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"placement_group","strategy":"host_spread"}]}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + pager = PlacementGroupsPager( + client=_service, + limit=10, + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + class TestCreatePlacementGroup(): """ Test Class for create_placement_group @@ -14954,7 +16267,6 @@ def test_create_placement_group_value_error(self): with pytest.raises(ValueError): _service.create_placement_group(**req_copy) - def test_create_placement_group_value_error_with_retries(self): # Enable retries and run test_create_placement_group_value_error. _service.enable_retries() @@ -15025,7 +16337,6 @@ def test_delete_placement_group_value_error(self): with pytest.raises(ValueError): _service.delete_placement_group(**req_copy) - def test_delete_placement_group_value_error_with_retries(self): # Enable retries and run test_delete_placement_group_value_error. _service.enable_retries() @@ -15102,7 +16413,6 @@ def test_get_placement_group_value_error(self): with pytest.raises(ValueError): _service.get_placement_group(**req_copy) - def test_get_placement_group_value_error_with_retries(self): # Enable retries and run test_get_placement_group_value_error. _service.enable_retries() @@ -15194,7 +16504,6 @@ def test_update_placement_group_value_error(self): with pytest.raises(ValueError): _service.update_placement_group(**req_copy) - def test_update_placement_group_value_error_with_retries(self): # Enable retries and run test_update_placement_group_value_error. _service.enable_retries() @@ -15258,6 +16567,7 @@ def test_new_instance_required_param_none(self): service = VpcV1.new_instance( version=None, ) + class TestListBareMetalServerProfiles(): """ Test Class for list_bare_metal_server_profiles @@ -15270,7 +16580,7 @@ def test_list_bare_metal_server_profiles_all_params(self): """ # Set up mock url = preprocess_url('/bare_metal_server/profiles') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "profiles": [{"bandwidth": {"type": "fixed", "value": 20000}, "cpu_architecture": {"default": "amd64", "type": "fixed", "value": "amd64"}, "cpu_core_count": {"type": "fixed", "value": 80}, "cpu_socket_count": {"type": "fixed", "value": 4}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "nvme", "type": "enum", "values": ["nvme"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "memory": {"type": "fixed", "value": 16}, "name": "bx2-metal-192x768", "os_architecture": {"default": "amd64", "type": "enum", "values": ["amd64"]}, "resource_type": "bare_metal_server_profile", "supported_trusted_platform_module_modes": {"type": "enum", "values": ["tpm_2"]}}], "total_count": 132}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "profiles": [{"bandwidth": {"type": "fixed", "value": 20000}, "cpu_architecture": {"default": "amd64", "type": "fixed", "value": "amd64"}, "cpu_core_count": {"type": "fixed", "value": 80}, "cpu_socket_count": {"type": "fixed", "value": 4}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "fcp", "type": "enum", "values": ["fcp"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "memory": {"type": "fixed", "value": 16}, "name": "bx2-metal-192x768", "os_architecture": {"default": "amd64", "type": "enum", "values": ["amd64"]}, "resource_type": "bare_metal_server_profile", "supported_trusted_platform_module_modes": {"type": "enum", "values": ["tpm_2"]}}], "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -15313,7 +16623,7 @@ def test_list_bare_metal_server_profiles_required_params(self): """ # Set up mock url = preprocess_url('/bare_metal_server/profiles') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "profiles": [{"bandwidth": {"type": "fixed", "value": 20000}, "cpu_architecture": {"default": "amd64", "type": "fixed", "value": "amd64"}, "cpu_core_count": {"type": "fixed", "value": 80}, "cpu_socket_count": {"type": "fixed", "value": 4}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "nvme", "type": "enum", "values": ["nvme"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "memory": {"type": "fixed", "value": 16}, "name": "bx2-metal-192x768", "os_architecture": {"default": "amd64", "type": "enum", "values": ["amd64"]}, "resource_type": "bare_metal_server_profile", "supported_trusted_platform_module_modes": {"type": "enum", "values": ["tpm_2"]}}], "total_count": 132}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "profiles": [{"bandwidth": {"type": "fixed", "value": 20000}, "cpu_architecture": {"default": "amd64", "type": "fixed", "value": "amd64"}, "cpu_core_count": {"type": "fixed", "value": 80}, "cpu_socket_count": {"type": "fixed", "value": 4}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "fcp", "type": "enum", "values": ["fcp"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "memory": {"type": "fixed", "value": 16}, "name": "bx2-metal-192x768", "os_architecture": {"default": "amd64", "type": "enum", "values": ["amd64"]}, "resource_type": "bare_metal_server_profile", "supported_trusted_platform_module_modes": {"type": "enum", "values": ["tpm_2"]}}], "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -15344,7 +16654,7 @@ def test_list_bare_metal_server_profiles_value_error(self): """ # Set up mock url = preprocess_url('/bare_metal_server/profiles') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "profiles": [{"bandwidth": {"type": "fixed", "value": 20000}, "cpu_architecture": {"default": "amd64", "type": "fixed", "value": "amd64"}, "cpu_core_count": {"type": "fixed", "value": 80}, "cpu_socket_count": {"type": "fixed", "value": 4}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "nvme", "type": "enum", "values": ["nvme"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "memory": {"type": "fixed", "value": 16}, "name": "bx2-metal-192x768", "os_architecture": {"default": "amd64", "type": "enum", "values": ["amd64"]}, "resource_type": "bare_metal_server_profile", "supported_trusted_platform_module_modes": {"type": "enum", "values": ["tpm_2"]}}], "total_count": 132}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "profiles": [{"bandwidth": {"type": "fixed", "value": 20000}, "cpu_architecture": {"default": "amd64", "type": "fixed", "value": "amd64"}, "cpu_core_count": {"type": "fixed", "value": 80}, "cpu_socket_count": {"type": "fixed", "value": 4}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "fcp", "type": "enum", "values": ["fcp"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "memory": {"type": "fixed", "value": 16}, "name": "bx2-metal-192x768", "os_architecture": {"default": "amd64", "type": "enum", "values": ["amd64"]}, "resource_type": "bare_metal_server_profile", "supported_trusted_platform_module_modes": {"type": "enum", "values": ["tpm_2"]}}], "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -15359,7 +16669,6 @@ def test_list_bare_metal_server_profiles_value_error(self): with pytest.raises(ValueError): _service.list_bare_metal_server_profiles(**req_copy) - def test_list_bare_metal_server_profiles_value_error_with_retries(self): # Enable retries and run test_list_bare_metal_server_profiles_value_error. _service.enable_retries() @@ -15369,6 +16678,67 @@ def test_list_bare_metal_server_profiles_value_error_with_retries(self): _service.disable_retries() self.test_list_bare_metal_server_profiles_value_error() + @responses.activate + def test_list_bare_metal_server_profiles_with_pager_get_next(self): + """ + test_list_bare_metal_server_profiles_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/bare_metal_server/profiles') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"profiles":[{"bandwidth":{"type":"fixed","value":20000},"cpu_architecture":{"default":"amd64","type":"fixed","value":"amd64"},"cpu_core_count":{"type":"fixed","value":80},"cpu_socket_count":{"type":"fixed","value":4},"disks":[{"quantity":{"type":"fixed","value":4},"size":{"type":"fixed","value":100},"supported_interface_types":{"default":"fcp","type":"enum","values":["fcp"]}}],"family":"balanced","href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768","memory":{"type":"fixed","value":16},"name":"bx2-metal-192x768","os_architecture":{"default":"amd64","type":"enum","values":["amd64"]},"resource_type":"bare_metal_server_profile","supported_trusted_platform_module_modes":{"type":"enum","values":["tpm_2"]}}]}' + mock_response2 = '{"total_count":2,"limit":1,"profiles":[{"bandwidth":{"type":"fixed","value":20000},"cpu_architecture":{"default":"amd64","type":"fixed","value":"amd64"},"cpu_core_count":{"type":"fixed","value":80},"cpu_socket_count":{"type":"fixed","value":4},"disks":[{"quantity":{"type":"fixed","value":4},"size":{"type":"fixed","value":100},"supported_interface_types":{"default":"fcp","type":"enum","values":["fcp"]}}],"family":"balanced","href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768","memory":{"type":"fixed","value":16},"name":"bx2-metal-192x768","os_architecture":{"default":"amd64","type":"enum","values":["amd64"]},"resource_type":"bare_metal_server_profile","supported_trusted_platform_module_modes":{"type":"enum","values":["tpm_2"]}}]}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + all_results = [] + pager = BareMetalServerProfilesPager( + client=_service, + limit=10, + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 + + @responses.activate + def test_list_bare_metal_server_profiles_with_pager_get_all(self): + """ + test_list_bare_metal_server_profiles_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/bare_metal_server/profiles') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"profiles":[{"bandwidth":{"type":"fixed","value":20000},"cpu_architecture":{"default":"amd64","type":"fixed","value":"amd64"},"cpu_core_count":{"type":"fixed","value":80},"cpu_socket_count":{"type":"fixed","value":4},"disks":[{"quantity":{"type":"fixed","value":4},"size":{"type":"fixed","value":100},"supported_interface_types":{"default":"fcp","type":"enum","values":["fcp"]}}],"family":"balanced","href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768","memory":{"type":"fixed","value":16},"name":"bx2-metal-192x768","os_architecture":{"default":"amd64","type":"enum","values":["amd64"]},"resource_type":"bare_metal_server_profile","supported_trusted_platform_module_modes":{"type":"enum","values":["tpm_2"]}}]}' + mock_response2 = '{"total_count":2,"limit":1,"profiles":[{"bandwidth":{"type":"fixed","value":20000},"cpu_architecture":{"default":"amd64","type":"fixed","value":"amd64"},"cpu_core_count":{"type":"fixed","value":80},"cpu_socket_count":{"type":"fixed","value":4},"disks":[{"quantity":{"type":"fixed","value":4},"size":{"type":"fixed","value":100},"supported_interface_types":{"default":"fcp","type":"enum","values":["fcp"]}}],"family":"balanced","href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768","memory":{"type":"fixed","value":16},"name":"bx2-metal-192x768","os_architecture":{"default":"amd64","type":"enum","values":["amd64"]},"resource_type":"bare_metal_server_profile","supported_trusted_platform_module_modes":{"type":"enum","values":["tpm_2"]}}]}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + pager = BareMetalServerProfilesPager( + client=_service, + limit=10, + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + class TestGetBareMetalServerProfile(): """ Test Class for get_bare_metal_server_profile @@ -15381,7 +16751,7 @@ def test_get_bare_metal_server_profile_all_params(self): """ # Set up mock url = preprocess_url('/bare_metal_server/profiles/testString') - mock_response = '{"bandwidth": {"type": "fixed", "value": 20000}, "cpu_architecture": {"default": "amd64", "type": "fixed", "value": "amd64"}, "cpu_core_count": {"type": "fixed", "value": 80}, "cpu_socket_count": {"type": "fixed", "value": 4}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "nvme", "type": "enum", "values": ["nvme"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "memory": {"type": "fixed", "value": 16}, "name": "bx2-metal-192x768", "os_architecture": {"default": "amd64", "type": "enum", "values": ["amd64"]}, "resource_type": "bare_metal_server_profile", "supported_trusted_platform_module_modes": {"type": "enum", "values": ["tpm_2"]}}' + mock_response = '{"bandwidth": {"type": "fixed", "value": 20000}, "cpu_architecture": {"default": "amd64", "type": "fixed", "value": "amd64"}, "cpu_core_count": {"type": "fixed", "value": 80}, "cpu_socket_count": {"type": "fixed", "value": 4}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "fcp", "type": "enum", "values": ["fcp"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "memory": {"type": "fixed", "value": 16}, "name": "bx2-metal-192x768", "os_architecture": {"default": "amd64", "type": "enum", "values": ["amd64"]}, "resource_type": "bare_metal_server_profile", "supported_trusted_platform_module_modes": {"type": "enum", "values": ["tpm_2"]}}' responses.add(responses.GET, url, body=mock_response, @@ -15417,7 +16787,7 @@ def test_get_bare_metal_server_profile_value_error(self): """ # Set up mock url = preprocess_url('/bare_metal_server/profiles/testString') - mock_response = '{"bandwidth": {"type": "fixed", "value": 20000}, "cpu_architecture": {"default": "amd64", "type": "fixed", "value": "amd64"}, "cpu_core_count": {"type": "fixed", "value": 80}, "cpu_socket_count": {"type": "fixed", "value": 4}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "nvme", "type": "enum", "values": ["nvme"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "memory": {"type": "fixed", "value": 16}, "name": "bx2-metal-192x768", "os_architecture": {"default": "amd64", "type": "enum", "values": ["amd64"]}, "resource_type": "bare_metal_server_profile", "supported_trusted_platform_module_modes": {"type": "enum", "values": ["tpm_2"]}}' + mock_response = '{"bandwidth": {"type": "fixed", "value": 20000}, "cpu_architecture": {"default": "amd64", "type": "fixed", "value": "amd64"}, "cpu_core_count": {"type": "fixed", "value": 80}, "cpu_socket_count": {"type": "fixed", "value": 4}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "fcp", "type": "enum", "values": ["fcp"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "memory": {"type": "fixed", "value": 16}, "name": "bx2-metal-192x768", "os_architecture": {"default": "amd64", "type": "enum", "values": ["amd64"]}, "resource_type": "bare_metal_server_profile", "supported_trusted_platform_module_modes": {"type": "enum", "values": ["tpm_2"]}}' responses.add(responses.GET, url, body=mock_response, @@ -15436,7 +16806,6 @@ def test_get_bare_metal_server_profile_value_error(self): with pytest.raises(ValueError): _service.get_bare_metal_server_profile(**req_copy) - def test_get_bare_metal_server_profile_value_error_with_retries(self): # Enable retries and run test_get_bare_metal_server_profile_value_error. _service.enable_retries() @@ -15458,7 +16827,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_ip": {"address": "192.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", "resource_type": "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", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "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", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"bare_metal_servers": [{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/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": "fcp", "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", "resource_type": "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", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "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", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -15525,7 +16894,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_ip": {"address": "192.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", "resource_type": "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", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "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", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"bare_metal_servers": [{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/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": "fcp", "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", "resource_type": "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", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "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", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -15556,7 +16925,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_ip": {"address": "192.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", "resource_type": "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", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "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", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"bare_metal_servers": [{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/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": "fcp", "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", "resource_type": "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", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "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", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -15571,7 +16940,6 @@ def test_list_bare_metal_servers_value_error(self): with pytest.raises(ValueError): _service.list_bare_metal_servers(**req_copy) - def test_list_bare_metal_servers_value_error_with_retries(self): # Enable retries and run test_list_bare_metal_servers_value_error. _service.enable_retries() @@ -15581,6 +16949,83 @@ def test_list_bare_metal_servers_value_error_with_retries(self): _service.disable_retries() self.test_list_bare_metal_servers_value_error() + @responses.activate + def test_list_bare_metal_servers_with_pager_get_next(self): + """ + test_list_bare_metal_servers_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/bare_metal_servers') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"bare_metal_servers":[{"bandwidth":20000,"boot_target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-bare-metal-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":"fcp","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","resource_type":"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","resource_type":"subnet"}},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768","name":"bx2-metal-192x768","resource_type":"bare_metal_server_profile"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"bare_metal_server","status":"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","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}' + mock_response2 = '{"total_count":2,"limit":1,"bare_metal_servers":[{"bandwidth":20000,"boot_target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-bare-metal-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":"fcp","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","resource_type":"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","resource_type":"subnet"}},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768","name":"bx2-metal-192x768","resource_type":"bare_metal_server_profile"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"bare_metal_server","status":"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","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + all_results = [] + pager = BareMetalServersPager( + client=_service, + limit=10, + resource_group_id='testString', + name='testString', + vpc_id='testString', + vpc_crn='testString', + vpc_name='testString', + network_interfaces_subnet_id='testString', + network_interfaces_subnet_crn='testString', + network_interfaces_subnet_name='testString', + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 + + @responses.activate + def test_list_bare_metal_servers_with_pager_get_all(self): + """ + test_list_bare_metal_servers_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/bare_metal_servers') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"bare_metal_servers":[{"bandwidth":20000,"boot_target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-bare-metal-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":"fcp","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","resource_type":"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","resource_type":"subnet"}},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768","name":"bx2-metal-192x768","resource_type":"bare_metal_server_profile"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"bare_metal_server","status":"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","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}' + mock_response2 = '{"total_count":2,"limit":1,"bare_metal_servers":[{"bandwidth":20000,"boot_target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-bare-metal-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":"fcp","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","resource_type":"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","resource_type":"subnet"}},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768","name":"bx2-metal-192x768","resource_type":"bare_metal_server_profile"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"bare_metal_server","status":"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","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + pager = BareMetalServersPager( + client=_service, + limit=10, + resource_group_id='testString', + name='testString', + vpc_id='testString', + vpc_crn='testString', + vpc_name='testString', + network_interfaces_subnet_id='testString', + network_interfaces_subnet_crn='testString', + network_interfaces_subnet_name='testString', + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + class TestCreateBareMetalServer(): """ Test Class for create_bare_metal_server @@ -15593,7 +17038,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_ip": {"address": "192.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", "resource_type": "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", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "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", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/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": "fcp", "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", "resource_type": "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", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "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", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.POST, url, body=mock_response, @@ -15647,7 +17092,7 @@ def test_create_bare_metal_server_all_params(self): zone_identity_model = {} zone_identity_model['name'] = 'us-south-1' - # Construct a dict representation of a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype model + # Construct a dict representation of a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype model bare_metal_server_network_interface_prototype_model = {} bare_metal_server_network_interface_prototype_model['allow_ip_spoofing'] = True bare_metal_server_network_interface_prototype_model['enable_infrastructure_nat'] = True @@ -15655,9 +17100,7 @@ def test_create_bare_metal_server_all_params(self): 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 - bare_metal_server_network_interface_prototype_model['interface_type'] = 'vlan' - bare_metal_server_network_interface_prototype_model['vlan'] = 4 + bare_metal_server_network_interface_prototype_model['interface_type'] = 'hipersocket' # Construct a dict representation of a ResourceGroupIdentityById model resource_group_identity_model = {} @@ -15720,7 +17163,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_ip": {"address": "192.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", "resource_type": "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", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "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", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/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": "fcp", "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", "resource_type": "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", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "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", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.POST, url, body=mock_response, @@ -15774,7 +17217,7 @@ def test_create_bare_metal_server_value_error(self): zone_identity_model = {} zone_identity_model['name'] = 'us-south-1' - # Construct a dict representation of a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype model + # Construct a dict representation of a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype model bare_metal_server_network_interface_prototype_model = {} bare_metal_server_network_interface_prototype_model['allow_ip_spoofing'] = True bare_metal_server_network_interface_prototype_model['enable_infrastructure_nat'] = True @@ -15782,9 +17225,7 @@ def test_create_bare_metal_server_value_error(self): 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 - bare_metal_server_network_interface_prototype_model['interface_type'] = 'vlan' - bare_metal_server_network_interface_prototype_model['vlan'] = 4 + bare_metal_server_network_interface_prototype_model['interface_type'] = 'hipersocket' # Construct a dict representation of a ResourceGroupIdentityById model resource_group_identity_model = {} @@ -15816,7 +17257,6 @@ def test_create_bare_metal_server_value_error(self): with pytest.raises(ValueError): _service.create_bare_metal_server(**req_copy) - def test_create_bare_metal_server_value_error_with_retries(self): # Enable retries and run test_create_bare_metal_server_value_error. _service.enable_retries() @@ -15904,7 +17344,6 @@ def test_create_bare_metal_server_console_access_token_value_error(self): with pytest.raises(ValueError): _service.create_bare_metal_server_console_access_token(**req_copy) - def test_create_bare_metal_server_console_access_token_value_error_with_retries(self): # Enable retries and run test_create_bare_metal_server_console_access_token_value_error. _service.enable_retries() @@ -15926,7 +17365,7 @@ def test_list_bare_metal_server_disks_all_params(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/disks') - mock_response = '{"disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-bare-metal-disk", "resource_type": "bare_metal_server_disk", "size": 100}]}' + mock_response = '{"disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-disk", "resource_type": "bare_metal_server_disk", "size": 100}]}' responses.add(responses.GET, url, body=mock_response, @@ -15962,7 +17401,7 @@ def test_list_bare_metal_server_disks_value_error(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/disks') - mock_response = '{"disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-bare-metal-disk", "resource_type": "bare_metal_server_disk", "size": 100}]}' + mock_response = '{"disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-disk", "resource_type": "bare_metal_server_disk", "size": 100}]}' responses.add(responses.GET, url, body=mock_response, @@ -15981,7 +17420,6 @@ def test_list_bare_metal_server_disks_value_error(self): with pytest.raises(ValueError): _service.list_bare_metal_server_disks(**req_copy) - def test_list_bare_metal_server_disks_value_error_with_retries(self): # Enable retries and run test_list_bare_metal_server_disks_value_error. _service.enable_retries() @@ -16003,7 +17441,7 @@ def test_get_bare_metal_server_disk_all_params(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/disks/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-bare-metal-disk", "resource_type": "bare_metal_server_disk", "size": 100}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-disk", "resource_type": "bare_metal_server_disk", "size": 100}' responses.add(responses.GET, url, body=mock_response, @@ -16041,7 +17479,7 @@ def test_get_bare_metal_server_disk_value_error(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/disks/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-bare-metal-disk", "resource_type": "bare_metal_server_disk", "size": 100}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-disk", "resource_type": "bare_metal_server_disk", "size": 100}' responses.add(responses.GET, url, body=mock_response, @@ -16062,7 +17500,6 @@ def test_get_bare_metal_server_disk_value_error(self): with pytest.raises(ValueError): _service.get_bare_metal_server_disk(**req_copy) - def test_get_bare_metal_server_disk_value_error_with_retries(self): # Enable retries and run test_get_bare_metal_server_disk_value_error. _service.enable_retries() @@ -16084,7 +17521,7 @@ def test_update_bare_metal_server_disk_all_params(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/disks/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-bare-metal-disk", "resource_type": "bare_metal_server_disk", "size": 100}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-disk", "resource_type": "bare_metal_server_disk", "size": 100}' responses.add(responses.PATCH, url, body=mock_response, @@ -16131,7 +17568,7 @@ def test_update_bare_metal_server_disk_value_error(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/disks/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-bare-metal-disk", "resource_type": "bare_metal_server_disk", "size": 100}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-disk", "resource_type": "bare_metal_server_disk", "size": 100}' responses.add(responses.PATCH, url, body=mock_response, @@ -16158,7 +17595,6 @@ def test_update_bare_metal_server_disk_value_error(self): with pytest.raises(ValueError): _service.update_bare_metal_server_disk(**req_copy) - def test_update_bare_metal_server_disk_value_error_with_retries(self): # Enable retries and run test_update_bare_metal_server_disk_value_error. _service.enable_retries() @@ -16180,7 +17616,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", "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", "resource_type": "subnet"}, "type": "primary", "allowed_vlans": [4], "interface_type": "pci"}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_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", "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", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -16225,7 +17661,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", "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", "resource_type": "subnet"}, "type": "primary", "allowed_vlans": [4], "interface_type": "pci"}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_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", "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", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -16261,7 +17697,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", "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", "resource_type": "subnet"}, "type": "primary", "allowed_vlans": [4], "interface_type": "pci"}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_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", "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", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -16280,7 +17716,6 @@ def test_list_bare_metal_server_network_interfaces_value_error(self): with pytest.raises(ValueError): _service.list_bare_metal_server_network_interfaces(**req_copy) - def test_list_bare_metal_server_network_interfaces_value_error_with_retries(self): # Enable retries and run test_list_bare_metal_server_network_interfaces_value_error. _service.enable_retries() @@ -16290,6 +17725,69 @@ def test_list_bare_metal_server_network_interfaces_value_error_with_retries(self _service.disable_retries() self.test_list_bare_metal_server_network_interfaces_value_error() + @responses.activate + def test_list_bare_metal_server_network_interfaces_with_pager_get_next(self): + """ + test_list_bare_metal_server_network_interfaces_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/bare_metal_servers/testString/network_interfaces') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"network_interfaces":[{"allow_ip_spoofing":true,"created_at":"2019-01-01T12:00:00.000Z","enable_infrastructure_nat":true,"floating_ips":[{"address":"203.0.113.1","crn":"crn:v1:bluemix:public:is:us-south-1:a/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","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","resource_type":"subnet"},"type":"primary","interface_type":"hipersocket"}]}' + mock_response2 = '{"total_count":2,"limit":1,"network_interfaces":[{"allow_ip_spoofing":true,"created_at":"2019-01-01T12:00:00.000Z","enable_infrastructure_nat":true,"floating_ips":[{"address":"203.0.113.1","crn":"crn:v1:bluemix:public:is:us-south-1:a/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","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","resource_type":"subnet"},"type":"primary","interface_type":"hipersocket"}]}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + all_results = [] + pager = BareMetalServerNetworkInterfacesPager( + client=_service, + bare_metal_server_id='testString', + limit=10, + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 + + @responses.activate + def test_list_bare_metal_server_network_interfaces_with_pager_get_all(self): + """ + test_list_bare_metal_server_network_interfaces_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/bare_metal_servers/testString/network_interfaces') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"network_interfaces":[{"allow_ip_spoofing":true,"created_at":"2019-01-01T12:00:00.000Z","enable_infrastructure_nat":true,"floating_ips":[{"address":"203.0.113.1","crn":"crn:v1:bluemix:public:is:us-south-1:a/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","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","resource_type":"subnet"},"type":"primary","interface_type":"hipersocket"}]}' + mock_response2 = '{"total_count":2,"limit":1,"network_interfaces":[{"allow_ip_spoofing":true,"created_at":"2019-01-01T12:00:00.000Z","enable_infrastructure_nat":true,"floating_ips":[{"address":"203.0.113.1","crn":"crn:v1:bluemix:public:is:us-south-1:a/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","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","resource_type":"subnet"},"type":"primary","interface_type":"hipersocket"}]}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + pager = BareMetalServerNetworkInterfacesPager( + client=_service, + bare_metal_server_id='testString', + limit=10, + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + class TestCreateBareMetalServerNetworkInterface(): """ Test Class for create_bare_metal_server_network_interface @@ -16302,7 +17800,7 @@ def test_create_bare_metal_server_network_interface_all_params(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/network_interfaces') - mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/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", "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", "resource_type": "subnet"}, "type": "primary", "allowed_vlans": [4], "interface_type": "pci"}' + 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", "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", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}' responses.add(responses.POST, url, body=mock_response, @@ -16323,7 +17821,7 @@ def test_create_bare_metal_server_network_interface_all_params(self): subnet_identity_model = {} subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' - # Construct a dict representation of a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype model + # Construct a dict representation of a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype model bare_metal_server_network_interface_prototype_model = {} bare_metal_server_network_interface_prototype_model['allow_ip_spoofing'] = True bare_metal_server_network_interface_prototype_model['enable_infrastructure_nat'] = True @@ -16331,9 +17829,7 @@ def test_create_bare_metal_server_network_interface_all_params(self): 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 - bare_metal_server_network_interface_prototype_model['interface_type'] = 'vlan' - bare_metal_server_network_interface_prototype_model['vlan'] = 4 + bare_metal_server_network_interface_prototype_model['interface_type'] = 'hipersocket' # Set up parameter values bare_metal_server_id = 'testString' @@ -16369,7 +17865,7 @@ def test_create_bare_metal_server_network_interface_value_error(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/network_interfaces') - mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/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", "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", "resource_type": "subnet"}, "type": "primary", "allowed_vlans": [4], "interface_type": "pci"}' + 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", "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", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}' responses.add(responses.POST, url, body=mock_response, @@ -16390,7 +17886,7 @@ def test_create_bare_metal_server_network_interface_value_error(self): subnet_identity_model = {} subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' - # Construct a dict representation of a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype model + # Construct a dict representation of a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype model bare_metal_server_network_interface_prototype_model = {} bare_metal_server_network_interface_prototype_model['allow_ip_spoofing'] = True bare_metal_server_network_interface_prototype_model['enable_infrastructure_nat'] = True @@ -16398,9 +17894,7 @@ def test_create_bare_metal_server_network_interface_value_error(self): 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 - bare_metal_server_network_interface_prototype_model['interface_type'] = 'vlan' - bare_metal_server_network_interface_prototype_model['vlan'] = 4 + bare_metal_server_network_interface_prototype_model['interface_type'] = 'hipersocket' # Set up parameter values bare_metal_server_id = 'testString' @@ -16416,7 +17910,6 @@ def test_create_bare_metal_server_network_interface_value_error(self): with pytest.raises(ValueError): _service.create_bare_metal_server_network_interface(**req_copy) - def test_create_bare_metal_server_network_interface_value_error_with_retries(self): # Enable retries and run test_create_bare_metal_server_network_interface_value_error. _service.enable_retries() @@ -16491,7 +17984,6 @@ def test_delete_bare_metal_server_network_interface_value_error(self): with pytest.raises(ValueError): _service.delete_bare_metal_server_network_interface(**req_copy) - def test_delete_bare_metal_server_network_interface_value_error_with_retries(self): # Enable retries and run test_delete_bare_metal_server_network_interface_value_error. _service.enable_retries() @@ -16513,7 +18005,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", "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", "resource_type": "subnet"}, "type": "primary", "allowed_vlans": [4], "interface_type": "pci"}' + 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", "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", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}' responses.add(responses.GET, url, body=mock_response, @@ -16551,7 +18043,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", "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", "resource_type": "subnet"}, "type": "primary", "allowed_vlans": [4], "interface_type": "pci"}' + 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", "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", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}' responses.add(responses.GET, url, body=mock_response, @@ -16572,7 +18064,6 @@ def test_get_bare_metal_server_network_interface_value_error(self): with pytest.raises(ValueError): _service.get_bare_metal_server_network_interface(**req_copy) - def test_get_bare_metal_server_network_interface_value_error_with_retries(self): # Enable retries and run test_get_bare_metal_server_network_interface_value_error. _service.enable_retries() @@ -16594,7 +18085,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", "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", "resource_type": "subnet"}, "type": "primary", "allowed_vlans": [4], "interface_type": "pci"}' + 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", "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", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}' responses.add(responses.PATCH, url, body=mock_response, @@ -16644,7 +18135,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", "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", "resource_type": "subnet"}, "type": "primary", "allowed_vlans": [4], "interface_type": "pci"}' + 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", "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", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}' responses.add(responses.PATCH, url, body=mock_response, @@ -16674,7 +18165,6 @@ def test_update_bare_metal_server_network_interface_value_error(self): with pytest.raises(ValueError): _service.update_bare_metal_server_network_interface(**req_copy) - def test_update_bare_metal_server_network_interface_value_error_with_retries(self): # Enable retries and run test_update_bare_metal_server_network_interface_value_error. _service.enable_retries() @@ -16755,7 +18245,6 @@ def test_list_bare_metal_server_network_interface_floating_ips_value_error(self) with pytest.raises(ValueError): _service.list_bare_metal_server_network_interface_floating_ips(**req_copy) - def test_list_bare_metal_server_network_interface_floating_ips_value_error_with_retries(self): # Enable retries and run test_list_bare_metal_server_network_interface_floating_ips_value_error. _service.enable_retries() @@ -16834,7 +18323,6 @@ def test_remove_bare_metal_server_network_interface_floating_ip_value_error(self with pytest.raises(ValueError): _service.remove_bare_metal_server_network_interface_floating_ip(**req_copy) - def test_remove_bare_metal_server_network_interface_floating_ip_value_error_with_retries(self): # Enable retries and run test_remove_bare_metal_server_network_interface_floating_ip_value_error. _service.enable_retries() @@ -16919,7 +18407,6 @@ def test_get_bare_metal_server_network_interface_floating_ip_value_error(self): with pytest.raises(ValueError): _service.get_bare_metal_server_network_interface_floating_ip(**req_copy) - def test_get_bare_metal_server_network_interface_floating_ip_value_error_with_retries(self): # Enable retries and run test_get_bare_metal_server_network_interface_floating_ip_value_error. _service.enable_retries() @@ -17004,7 +18491,6 @@ def test_add_bare_metal_server_network_interface_floating_ip_value_error(self): with pytest.raises(ValueError): _service.add_bare_metal_server_network_interface_floating_ip(**req_copy) - def test_add_bare_metal_server_network_interface_floating_ip_value_error_with_retries(self): # Enable retries and run test_add_bare_metal_server_network_interface_floating_ip_value_error. _service.enable_retries() @@ -17014,6 +18500,170 @@ 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 @@ -17075,7 +18725,6 @@ def test_delete_bare_metal_server_value_error(self): with pytest.raises(ValueError): _service.delete_bare_metal_server(**req_copy) - def test_delete_bare_metal_server_value_error_with_retries(self): # Enable retries and run test_delete_bare_metal_server_value_error. _service.enable_retries() @@ -17097,7 +18746,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_ip": {"address": "192.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", "resource_type": "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", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "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", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/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": "fcp", "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", "resource_type": "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", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "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", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.GET, url, body=mock_response, @@ -17133,7 +18782,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_ip": {"address": "192.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", "resource_type": "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", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "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", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/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": "fcp", "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", "resource_type": "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", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "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", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.GET, url, body=mock_response, @@ -17152,7 +18801,6 @@ def test_get_bare_metal_server_value_error(self): with pytest.raises(ValueError): _service.get_bare_metal_server(**req_copy) - def test_get_bare_metal_server_value_error_with_retries(self): # Enable retries and run test_get_bare_metal_server_value_error. _service.enable_retries() @@ -17174,7 +18822,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_ip": {"address": "192.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", "resource_type": "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", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "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", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/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": "fcp", "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", "resource_type": "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", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "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", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.PATCH, url, body=mock_response, @@ -17219,7 +18867,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_ip": {"address": "192.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", "resource_type": "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", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "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", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/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": "fcp", "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", "resource_type": "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", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "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", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.PATCH, url, body=mock_response, @@ -17244,7 +18892,6 @@ def test_update_bare_metal_server_value_error(self): with pytest.raises(ValueError): _service.update_bare_metal_server(**req_copy) - def test_update_bare_metal_server_value_error_with_retries(self): # Enable retries and run test_update_bare_metal_server_value_error. _service.enable_retries() @@ -17321,7 +18968,6 @@ def test_get_bare_metal_server_initialization_value_error(self): with pytest.raises(ValueError): _service.get_bare_metal_server_initialization(**req_copy) - def test_get_bare_metal_server_initialization_value_error_with_retries(self): # Enable retries and run test_get_bare_metal_server_initialization_value_error. _service.enable_retries() @@ -17392,7 +19038,6 @@ def test_restart_bare_metal_server_value_error(self): with pytest.raises(ValueError): _service.restart_bare_metal_server(**req_copy) - def test_restart_bare_metal_server_value_error_with_retries(self): # Enable retries and run test_restart_bare_metal_server_value_error. _service.enable_retries() @@ -17463,7 +19108,6 @@ def test_start_bare_metal_server_value_error(self): with pytest.raises(ValueError): _service.start_bare_metal_server(**req_copy) - def test_start_bare_metal_server_value_error_with_retries(self): # Enable retries and run test_start_bare_metal_server_value_error. _service.enable_retries() @@ -17541,7 +19185,6 @@ def test_stop_bare_metal_server_value_error(self): with pytest.raises(ValueError): _service.stop_bare_metal_server(**req_copy) - def test_stop_bare_metal_server_value_error_with_retries(self): # Enable retries and run test_stop_bare_metal_server_value_error. _service.enable_retries() @@ -17605,6 +19248,7 @@ def test_new_instance_required_param_none(self): service = VpcV1.new_instance( version=None, ) + class TestListVolumeProfiles(): """ Test Class for list_volume_profiles @@ -17706,7 +19350,6 @@ def test_list_volume_profiles_value_error(self): with pytest.raises(ValueError): _service.list_volume_profiles(**req_copy) - def test_list_volume_profiles_value_error_with_retries(self): # Enable retries and run test_list_volume_profiles_value_error. _service.enable_retries() @@ -17716,6 +19359,67 @@ def test_list_volume_profiles_value_error_with_retries(self): _service.disable_retries() self.test_list_volume_profiles_value_error() + @responses.activate + def test_list_volume_profiles_with_pager_get_next(self): + """ + test_list_volume_profiles_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/volume/profiles') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"profiles":[{"family":"tiered","href":"https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose","name":"general-purpose"}]}' + mock_response2 = '{"total_count":2,"limit":1,"profiles":[{"family":"tiered","href":"https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose","name":"general-purpose"}]}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + all_results = [] + pager = VolumeProfilesPager( + client=_service, + limit=10, + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 + + @responses.activate + def test_list_volume_profiles_with_pager_get_all(self): + """ + test_list_volume_profiles_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/volume/profiles') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"profiles":[{"family":"tiered","href":"https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose","name":"general-purpose"}]}' + mock_response2 = '{"total_count":2,"limit":1,"profiles":[{"family":"tiered","href":"https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose","name":"general-purpose"}]}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + pager = VolumeProfilesPager( + client=_service, + limit=10, + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + class TestGetVolumeProfile(): """ Test Class for get_volume_profile @@ -17783,7 +19487,6 @@ def test_get_volume_profile_value_error(self): with pytest.raises(ValueError): _service.get_volume_profile(**req_copy) - def test_get_volume_profile_value_error_with_retries(self): # Enable retries and run test_get_volume_profile_value_error. _service.enable_retries() @@ -17900,7 +19603,6 @@ def test_list_volumes_value_error(self): with pytest.raises(ValueError): _service.list_volumes(**req_copy) - def test_list_volumes_value_error_with_retries(self): # Enable retries and run test_list_volumes_value_error. _service.enable_retries() @@ -17910,6 +19612,71 @@ def test_list_volumes_value_error_with_retries(self): _service.disable_retries() self.test_list_volumes_value_error() + @responses.activate + def test_list_volumes_with_pager_get_next(self): + """ + test_list_volumes_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/volumes') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"volumes":[{"active":true,"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"}}]}' + mock_response2 = '{"total_count":2,"limit":1,"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_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + all_results = [] + pager = VolumesPager( + client=_service, + limit=10, + name='testString', + zone_name='testString', + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 + + @responses.activate + def test_list_volumes_with_pager_get_all(self): + """ + test_list_volumes_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/volumes') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"volumes":[{"active":true,"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"}}]}' + mock_response2 = '{"total_count":2,"limit":1,"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_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + pager = VolumesPager( + client=_service, + limit=10, + name='testString', + zone_name='testString', + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + class TestCreateVolume(): """ Test Class for create_volume @@ -18034,7 +19801,6 @@ def test_create_volume_value_error(self): with pytest.raises(ValueError): _service.create_volume(**req_copy) - def test_create_volume_value_error_with_retries(self): # Enable retries and run test_create_volume_value_error. _service.enable_retries() @@ -18140,7 +19906,6 @@ def test_delete_volume_value_error(self): with pytest.raises(ValueError): _service.delete_volume(**req_copy) - def test_delete_volume_value_error_with_retries(self): # Enable retries and run test_delete_volume_value_error. _service.enable_retries() @@ -18217,7 +19982,6 @@ def test_get_volume_value_error(self): with pytest.raises(ValueError): _service.get_volume(**req_copy) - def test_get_volume_value_error_with_retries(self): # Enable retries and run test_get_volume_value_error. _service.enable_retries() @@ -18380,7 +20144,6 @@ def test_update_volume_value_error(self): with pytest.raises(ValueError): _service.update_volume(**req_copy) - def test_update_volume_value_error_with_retries(self): # Enable retries and run test_update_volume_value_error. _service.enable_retries() @@ -18444,6 +20207,7 @@ def test_new_instance_required_param_none(self): service = VpcV1.new_instance( version=None, ) + class TestDeleteSnapshots(): """ Test Class for delete_snapshots @@ -18509,7 +20273,6 @@ def test_delete_snapshots_value_error(self): with pytest.raises(ValueError): _service.delete_snapshots(**req_copy) - def test_delete_snapshots_value_error_with_retries(self): # Enable retries and run test_delete_snapshots_value_error. _service.enable_retries() @@ -18647,7 +20410,6 @@ def test_list_snapshots_value_error(self): with pytest.raises(ValueError): _service.list_snapshots(**req_copy) - def test_list_snapshots_value_error_with_retries(self): # Enable retries and run test_list_snapshots_value_error. _service.enable_retries() @@ -18657,6 +20419,85 @@ def test_list_snapshots_value_error_with_retries(self): _service.disable_retries() self.test_list_snapshots_value_error() + @responses.activate + def test_list_snapshots_with_pager_get_next(self): + """ + test_list_snapshots_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/snapshots') + mock_response1 = '{"snapshots":[{"backup_policy_plan":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","resource_type":"backup_policy_plan"},"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"]}],"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1}' + mock_response2 = '{"snapshots":[{"backup_policy_plan":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","resource_type":"backup_policy_plan"},"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":2,"limit":1}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + all_results = [] + pager = SnapshotsPager( + client=_service, + limit=10, + tag='testString', + resource_group_id='testString', + name='testString', + source_volume_id='testString', + source_volume_crn='testString', + source_image_id='testString', + source_image_crn='testString', + sort='name', + backup_policy_plan_id='testString', + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 + + @responses.activate + def test_list_snapshots_with_pager_get_all(self): + """ + test_list_snapshots_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/snapshots') + mock_response1 = '{"snapshots":[{"backup_policy_plan":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","resource_type":"backup_policy_plan"},"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"]}],"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1}' + mock_response2 = '{"snapshots":[{"backup_policy_plan":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","resource_type":"backup_policy_plan"},"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":2,"limit":1}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + pager = SnapshotsPager( + client=_service, + limit=10, + tag='testString', + resource_group_id='testString', + name='testString', + source_volume_id='testString', + source_volume_crn='testString', + source_image_id='testString', + source_image_crn='testString', + sort='name', + backup_policy_plan_id='testString', + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + class TestCreateSnapshot(): """ Test Class for create_snapshot @@ -18757,7 +20598,6 @@ def test_create_snapshot_value_error(self): with pytest.raises(ValueError): _service.create_snapshot(**req_copy) - def test_create_snapshot_value_error_with_retries(self): # Enable retries and run test_create_snapshot_value_error. _service.enable_retries() @@ -18863,7 +20703,6 @@ def test_delete_snapshot_value_error(self): with pytest.raises(ValueError): _service.delete_snapshot(**req_copy) - def test_delete_snapshot_value_error_with_retries(self): # Enable retries and run test_delete_snapshot_value_error. _service.enable_retries() @@ -18940,7 +20779,6 @@ def test_get_snapshot_value_error(self): with pytest.raises(ValueError): _service.get_snapshot(**req_copy) - def test_get_snapshot_value_error_with_retries(self): # Enable retries and run test_get_snapshot_value_error. _service.enable_retries() @@ -19082,7 +20920,6 @@ def test_update_snapshot_value_error(self): with pytest.raises(ValueError): _service.update_snapshot(**req_copy) - def test_update_snapshot_value_error_with_retries(self): # Enable retries and run test_update_snapshot_value_error. _service.enable_retries() @@ -19146,6 +20983,7 @@ def test_new_instance_required_param_none(self): service = VpcV1.new_instance( version=None, ) + class TestListRegions(): """ Test Class for list_regions @@ -19204,7 +21042,6 @@ def test_list_regions_value_error(self): with pytest.raises(ValueError): _service.list_regions(**req_copy) - def test_list_regions_value_error_with_retries(self): # Enable retries and run test_list_regions_value_error. _service.enable_retries() @@ -19281,7 +21118,6 @@ def test_get_region_value_error(self): with pytest.raises(ValueError): _service.get_region(**req_copy) - def test_get_region_value_error_with_retries(self): # Enable retries and run test_get_region_value_error. _service.enable_retries() @@ -19358,7 +21194,6 @@ def test_list_region_zones_value_error(self): with pytest.raises(ValueError): _service.list_region_zones(**req_copy) - def test_list_region_zones_value_error_with_retries(self): # Enable retries and run test_list_region_zones_value_error. _service.enable_retries() @@ -19439,7 +21274,6 @@ def test_get_region_zone_value_error(self): with pytest.raises(ValueError): _service.get_region_zone(**req_copy) - def test_get_region_zone_value_error_with_retries(self): # Enable retries and run test_get_region_zone_value_error. _service.enable_retries() @@ -19503,6 +21337,7 @@ def test_new_instance_required_param_none(self): service = VpcV1.new_instance( version=None, ) + class TestListPublicGateways(): """ Test Class for list_public_gateways @@ -19607,7 +21442,6 @@ def test_list_public_gateways_value_error(self): with pytest.raises(ValueError): _service.list_public_gateways(**req_copy) - def test_list_public_gateways_value_error_with_retries(self): # Enable retries and run test_list_public_gateways_value_error. _service.enable_retries() @@ -19617,6 +21451,69 @@ def test_list_public_gateways_value_error_with_retries(self): _service.disable_retries() self.test_list_public_gateways_value_error() + @responses.activate + def test_list_public_gateways_with_pager_get_next(self): + """ + test_list_public_gateways_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/public_gateways') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"public_gateways":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241","floating_ip":{"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/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241","id":"dc5431ef-1fc6-4861-adc9-a59d077d1241","name":"my-public-gateway","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"public_gateway","status":"available","vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/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","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}' + mock_response2 = '{"total_count":2,"limit":1,"public_gateways":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241","floating_ip":{"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/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241","id":"dc5431ef-1fc6-4861-adc9-a59d077d1241","name":"my-public-gateway","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"public_gateway","status":"available","vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/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","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + all_results = [] + pager = PublicGatewaysPager( + client=_service, + limit=10, + resource_group_id='testString', + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 + + @responses.activate + def test_list_public_gateways_with_pager_get_all(self): + """ + test_list_public_gateways_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/public_gateways') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"public_gateways":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241","floating_ip":{"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/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241","id":"dc5431ef-1fc6-4861-adc9-a59d077d1241","name":"my-public-gateway","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"public_gateway","status":"available","vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/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","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}' + mock_response2 = '{"total_count":2,"limit":1,"public_gateways":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241","floating_ip":{"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/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241","id":"dc5431ef-1fc6-4861-adc9-a59d077d1241","name":"my-public-gateway","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"public_gateway","status":"available","vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/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","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + pager = PublicGatewaysPager( + client=_service, + limit=10, + resource_group_id='testString', + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + class TestCreatePublicGateway(): """ Test Class for create_public_gateway @@ -19736,7 +21633,6 @@ def test_create_public_gateway_value_error(self): with pytest.raises(ValueError): _service.create_public_gateway(**req_copy) - def test_create_public_gateway_value_error_with_retries(self): # Enable retries and run test_create_public_gateway_value_error. _service.enable_retries() @@ -19807,7 +21703,6 @@ def test_delete_public_gateway_value_error(self): with pytest.raises(ValueError): _service.delete_public_gateway(**req_copy) - def test_delete_public_gateway_value_error_with_retries(self): # Enable retries and run test_delete_public_gateway_value_error. _service.enable_retries() @@ -19884,7 +21779,6 @@ def test_get_public_gateway_value_error(self): with pytest.raises(ValueError): _service.get_public_gateway(**req_copy) - def test_get_public_gateway_value_error_with_retries(self): # Enable retries and run test_get_public_gateway_value_error. _service.enable_retries() @@ -19976,7 +21870,6 @@ def test_update_public_gateway_value_error(self): with pytest.raises(ValueError): _service.update_public_gateway(**req_copy) - def test_update_public_gateway_value_error_with_retries(self): # Enable retries and run test_update_public_gateway_value_error. _service.enable_retries() @@ -20040,6 +21933,7 @@ def test_new_instance_required_param_none(self): service = VpcV1.new_instance( version=None, ) + class TestListFloatingIps(): """ Test Class for list_floating_ips @@ -20147,7 +22041,6 @@ def test_list_floating_ips_value_error(self): with pytest.raises(ValueError): _service.list_floating_ips(**req_copy) - def test_list_floating_ips_value_error_with_retries(self): # Enable retries and run test_list_floating_ips_value_error. _service.enable_retries() @@ -20157,6 +22050,71 @@ def test_list_floating_ips_value_error_with_retries(self): _service.disable_retries() self.test_list_floating_ips_value_error() + @responses.activate + def test_list_floating_ips_with_pager_get_next(self): + """ + test_list_floating_ips_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/floating_ips') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"floating_ips":[{"address":"203.0.113.1","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/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"}}]}' + mock_response2 = '{"total_count":2,"limit":1,"floating_ips":[{"address":"203.0.113.1","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/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_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + all_results = [] + pager = FloatingIpsPager( + client=_service, + limit=10, + resource_group_id='testString', + sort='name', + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 + + @responses.activate + def test_list_floating_ips_with_pager_get_all(self): + """ + test_list_floating_ips_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/floating_ips') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"floating_ips":[{"address":"203.0.113.1","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/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"}}]}' + mock_response2 = '{"total_count":2,"limit":1,"floating_ips":[{"address":"203.0.113.1","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/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_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + pager = FloatingIpsPager( + client=_service, + limit=10, + resource_group_id='testString', + sort='name', + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + class TestCreateFloatingIp(): """ Test Class for create_floating_ip @@ -20255,7 +22213,6 @@ def test_create_floating_ip_value_error(self): with pytest.raises(ValueError): _service.create_floating_ip(**req_copy) - def test_create_floating_ip_value_error_with_retries(self): # Enable retries and run test_create_floating_ip_value_error. _service.enable_retries() @@ -20326,7 +22283,6 @@ def test_delete_floating_ip_value_error(self): with pytest.raises(ValueError): _service.delete_floating_ip(**req_copy) - def test_delete_floating_ip_value_error_with_retries(self): # Enable retries and run test_delete_floating_ip_value_error. _service.enable_retries() @@ -20403,7 +22359,6 @@ def test_get_floating_ip_value_error(self): with pytest.raises(ValueError): _service.get_floating_ip(**req_copy) - def test_get_floating_ip_value_error_with_retries(self): # Enable retries and run test_get_floating_ip_value_error. _service.enable_retries() @@ -20505,7 +22460,6 @@ def test_update_floating_ip_value_error(self): with pytest.raises(ValueError): _service.update_floating_ip(**req_copy) - def test_update_floating_ip_value_error_with_retries(self): # Enable retries and run test_update_floating_ip_value_error. _service.enable_retries() @@ -20569,6 +22523,7 @@ def test_new_instance_required_param_none(self): service = VpcV1.new_instance( version=None, ) + class TestListNetworkAcls(): """ Test Class for list_network_acls @@ -20581,7 +22536,7 @@ def test_list_network_acls_all_params(self): """ # Set up mock url = preprocess_url('/network_acls') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls?limit=20"}, "limit": 20, "network_acls": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}], "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", "resource_type": "subnet"}], "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", "resource_type": "vpc"}}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls?limit=20"}, "limit": 20, "network_acls": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/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", "resource_type": "subnet"}], "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", "resource_type": "vpc"}}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -20627,7 +22582,7 @@ def test_list_network_acls_required_params(self): """ # Set up mock url = preprocess_url('/network_acls') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls?limit=20"}, "limit": 20, "network_acls": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}], "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", "resource_type": "subnet"}], "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", "resource_type": "vpc"}}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls?limit=20"}, "limit": 20, "network_acls": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/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", "resource_type": "subnet"}], "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", "resource_type": "vpc"}}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -20658,7 +22613,7 @@ def test_list_network_acls_value_error(self): """ # Set up mock url = preprocess_url('/network_acls') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls?limit=20"}, "limit": 20, "network_acls": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}], "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", "resource_type": "subnet"}], "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", "resource_type": "vpc"}}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls?limit=20"}, "limit": 20, "network_acls": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/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", "resource_type": "subnet"}], "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", "resource_type": "vpc"}}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -20673,7 +22628,6 @@ def test_list_network_acls_value_error(self): with pytest.raises(ValueError): _service.list_network_acls(**req_copy) - def test_list_network_acls_value_error_with_retries(self): # Enable retries and run test_list_network_acls_value_error. _service.enable_retries() @@ -20683,6 +22637,69 @@ def test_list_network_acls_value_error_with_retries(self): _service.disable_retries() self.test_list_network_acls_value_error() + @responses.activate + def test_list_network_acls_with_pager_get_next(self): + """ + test_list_network_acls_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/network_acls') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"network_acls":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf","id":"a4e28308-8ee7-46ab-8108-9f881f22bdbf","name":"my-network-acl","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"rules":[{"action":"allow","before":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","name":"my-rule-1"},"created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","ip_version":"ipv4","name":"my-rule-1","source":"192.168.3.0/24","destination_port_max":22,"destination_port_min":22,"protocol":"udp","source_port_max":65535,"source_port_min":49152}],"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/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","resource_type":"subnet"}],"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","resource_type":"vpc"}}],"total_count":2,"limit":1}' + mock_response2 = '{"network_acls":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf","id":"a4e28308-8ee7-46ab-8108-9f881f22bdbf","name":"my-network-acl","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"rules":[{"action":"allow","before":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","name":"my-rule-1"},"created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","ip_version":"ipv4","name":"my-rule-1","source":"192.168.3.0/24","destination_port_max":22,"destination_port_min":22,"protocol":"udp","source_port_max":65535,"source_port_min":49152}],"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/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","resource_type":"subnet"}],"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","resource_type":"vpc"}}],"total_count":2,"limit":1}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + all_results = [] + pager = NetworkAclsPager( + client=_service, + limit=10, + resource_group_id='testString', + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 + + @responses.activate + def test_list_network_acls_with_pager_get_all(self): + """ + test_list_network_acls_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/network_acls') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"network_acls":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf","id":"a4e28308-8ee7-46ab-8108-9f881f22bdbf","name":"my-network-acl","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"rules":[{"action":"allow","before":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","name":"my-rule-1"},"created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","ip_version":"ipv4","name":"my-rule-1","source":"192.168.3.0/24","destination_port_max":22,"destination_port_min":22,"protocol":"udp","source_port_max":65535,"source_port_min":49152}],"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/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","resource_type":"subnet"}],"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","resource_type":"vpc"}}],"total_count":2,"limit":1}' + mock_response2 = '{"network_acls":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf","id":"a4e28308-8ee7-46ab-8108-9f881f22bdbf","name":"my-network-acl","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"rules":[{"action":"allow","before":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","name":"my-rule-1"},"created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","ip_version":"ipv4","name":"my-rule-1","source":"192.168.3.0/24","destination_port_max":22,"destination_port_min":22,"protocol":"udp","source_port_max":65535,"source_port_min":49152}],"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/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","resource_type":"subnet"}],"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","resource_type":"vpc"}}],"total_count":2,"limit":1}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + pager = NetworkAclsPager( + client=_service, + limit=10, + resource_group_id='testString', + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + class TestCreateNetworkAcl(): """ Test Class for create_network_acl @@ -20695,7 +22712,7 @@ def test_create_network_acl_all_params(self): """ # Set up mock url = preprocess_url('/network_acls') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}], "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", "resource_type": "subnet"}], "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", "resource_type": "vpc"}}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/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", "resource_type": "subnet"}], "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", "resource_type": "vpc"}}' responses.add(responses.POST, url, body=mock_response, @@ -20710,7 +22727,7 @@ def test_create_network_acl_all_params(self): vpc_identity_model = {} vpc_identity_model['id'] = 'f0aae929-7047-46d1-92e1-9102b07a7f6f' - # Construct a dict representation of a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP model + # Construct a dict representation of a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype model network_acl_rule_prototype_network_acl_context_model = {} network_acl_rule_prototype_network_acl_context_model['action'] = 'allow' network_acl_rule_prototype_network_acl_context_model['destination'] = '192.168.3.2/32' @@ -20762,7 +22779,7 @@ def test_create_network_acl_required_params(self): """ # Set up mock url = preprocess_url('/network_acls') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}], "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", "resource_type": "subnet"}], "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", "resource_type": "vpc"}}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/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", "resource_type": "subnet"}], "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", "resource_type": "vpc"}}' responses.add(responses.POST, url, body=mock_response, @@ -20793,7 +22810,7 @@ def test_create_network_acl_value_error(self): """ # Set up mock url = preprocess_url('/network_acls') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}], "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", "resource_type": "subnet"}], "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", "resource_type": "vpc"}}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/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", "resource_type": "subnet"}], "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", "resource_type": "vpc"}}' responses.add(responses.POST, url, body=mock_response, @@ -20808,7 +22825,6 @@ def test_create_network_acl_value_error(self): with pytest.raises(ValueError): _service.create_network_acl(**req_copy) - def test_create_network_acl_value_error_with_retries(self): # Enable retries and run test_create_network_acl_value_error. _service.enable_retries() @@ -20879,7 +22895,6 @@ def test_delete_network_acl_value_error(self): with pytest.raises(ValueError): _service.delete_network_acl(**req_copy) - def test_delete_network_acl_value_error_with_retries(self): # Enable retries and run test_delete_network_acl_value_error. _service.enable_retries() @@ -20901,7 +22916,7 @@ def test_get_network_acl_all_params(self): """ # Set up mock url = preprocess_url('/network_acls/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}], "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", "resource_type": "subnet"}], "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", "resource_type": "vpc"}}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/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", "resource_type": "subnet"}], "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", "resource_type": "vpc"}}' responses.add(responses.GET, url, body=mock_response, @@ -20937,7 +22952,7 @@ def test_get_network_acl_value_error(self): """ # Set up mock url = preprocess_url('/network_acls/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}], "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", "resource_type": "subnet"}], "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", "resource_type": "vpc"}}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/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", "resource_type": "subnet"}], "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", "resource_type": "vpc"}}' responses.add(responses.GET, url, body=mock_response, @@ -20956,7 +22971,6 @@ def test_get_network_acl_value_error(self): with pytest.raises(ValueError): _service.get_network_acl(**req_copy) - def test_get_network_acl_value_error_with_retries(self): # Enable retries and run test_get_network_acl_value_error. _service.enable_retries() @@ -20978,7 +22992,7 @@ def test_update_network_acl_all_params(self): """ # Set up mock url = preprocess_url('/network_acls/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}], "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", "resource_type": "subnet"}], "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", "resource_type": "vpc"}}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/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", "resource_type": "subnet"}], "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", "resource_type": "vpc"}}' responses.add(responses.PATCH, url, body=mock_response, @@ -21023,7 +23037,7 @@ def test_update_network_acl_value_error(self): """ # Set up mock url = preprocess_url('/network_acls/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}], "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", "resource_type": "subnet"}], "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", "resource_type": "vpc"}}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/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", "resource_type": "subnet"}], "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", "resource_type": "vpc"}}' responses.add(responses.PATCH, url, body=mock_response, @@ -21048,7 +23062,6 @@ def test_update_network_acl_value_error(self): with pytest.raises(ValueError): _service.update_network_acl(**req_copy) - def test_update_network_acl_value_error_with_retries(self): # Enable retries and run test_update_network_acl_value_error. _service.enable_retries() @@ -21070,7 +23083,7 @@ def test_list_network_acl_rules_all_params(self): """ # Set up mock url = preprocess_url('/network_acls/testString/rules') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}], "total_count": 132}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -21118,7 +23131,7 @@ def test_list_network_acl_rules_required_params(self): """ # Set up mock url = preprocess_url('/network_acls/testString/rules') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}], "total_count": 132}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -21154,7 +23167,7 @@ def test_list_network_acl_rules_value_error(self): """ # Set up mock url = preprocess_url('/network_acls/testString/rules') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}], "total_count": 132}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -21173,7 +23186,6 @@ def test_list_network_acl_rules_value_error(self): with pytest.raises(ValueError): _service.list_network_acl_rules(**req_copy) - def test_list_network_acl_rules_value_error_with_retries(self): # Enable retries and run test_list_network_acl_rules_value_error. _service.enable_retries() @@ -21183,6 +23195,71 @@ def test_list_network_acl_rules_value_error_with_retries(self): _service.disable_retries() self.test_list_network_acl_rules_value_error() + @responses.activate + def test_list_network_acl_rules_with_pager_get_next(self): + """ + test_list_network_acl_rules_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/network_acls/testString/rules') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"rules":[{"action":"allow","before":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","name":"my-rule-1"},"created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","ip_version":"ipv4","name":"my-rule-1","source":"192.168.3.0/24","destination_port_max":22,"destination_port_min":22,"protocol":"udp","source_port_max":65535,"source_port_min":49152}]}' + mock_response2 = '{"total_count":2,"limit":1,"rules":[{"action":"allow","before":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","name":"my-rule-1"},"created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","ip_version":"ipv4","name":"my-rule-1","source":"192.168.3.0/24","destination_port_max":22,"destination_port_min":22,"protocol":"udp","source_port_max":65535,"source_port_min":49152}]}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + all_results = [] + pager = NetworkAclRulesPager( + client=_service, + network_acl_id='testString', + limit=10, + direction='inbound', + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 + + @responses.activate + def test_list_network_acl_rules_with_pager_get_all(self): + """ + test_list_network_acl_rules_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/network_acls/testString/rules') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"rules":[{"action":"allow","before":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","name":"my-rule-1"},"created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","ip_version":"ipv4","name":"my-rule-1","source":"192.168.3.0/24","destination_port_max":22,"destination_port_min":22,"protocol":"udp","source_port_max":65535,"source_port_min":49152}]}' + mock_response2 = '{"total_count":2,"limit":1,"rules":[{"action":"allow","before":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","name":"my-rule-1"},"created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","ip_version":"ipv4","name":"my-rule-1","source":"192.168.3.0/24","destination_port_max":22,"destination_port_min":22,"protocol":"udp","source_port_max":65535,"source_port_min":49152}]}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + pager = NetworkAclRulesPager( + client=_service, + network_acl_id='testString', + limit=10, + direction='inbound', + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + class TestCreateNetworkAclRule(): """ Test Class for create_network_acl_rule @@ -21195,7 +23272,7 @@ def test_create_network_acl_rule_all_params(self): """ # Set up mock url = preprocess_url('/network_acls/testString/rules') - mock_response = '{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}' + mock_response = '{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}' responses.add(responses.POST, url, body=mock_response, @@ -21206,7 +23283,7 @@ def test_create_network_acl_rule_all_params(self): network_acl_rule_before_prototype_model = {} network_acl_rule_before_prototype_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' - # Construct a dict representation of a NetworkACLRulePrototypeNetworkACLRuleProtocolICMP model + # Construct a dict representation of a NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype model network_acl_rule_prototype_model = {} network_acl_rule_prototype_model['action'] = 'allow' network_acl_rule_prototype_model['before'] = network_acl_rule_before_prototype_model @@ -21214,9 +23291,11 @@ def test_create_network_acl_rule_all_params(self): network_acl_rule_prototype_model['direction'] = 'inbound' network_acl_rule_prototype_model['name'] = 'my-rule-2' network_acl_rule_prototype_model['source'] = '192.168.3.2/32' - network_acl_rule_prototype_model['code'] = 0 - network_acl_rule_prototype_model['protocol'] = 'icmp' - network_acl_rule_prototype_model['type'] = 8 + network_acl_rule_prototype_model['destination_port_max'] = 22 + network_acl_rule_prototype_model['destination_port_min'] = 22 + network_acl_rule_prototype_model['protocol'] = 'udp' + network_acl_rule_prototype_model['source_port_max'] = 65535 + network_acl_rule_prototype_model['source_port_min'] = 49152 # Set up parameter values network_acl_id = 'testString' @@ -21252,7 +23331,7 @@ def test_create_network_acl_rule_value_error(self): """ # Set up mock url = preprocess_url('/network_acls/testString/rules') - mock_response = '{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}' + mock_response = '{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}' responses.add(responses.POST, url, body=mock_response, @@ -21263,7 +23342,7 @@ def test_create_network_acl_rule_value_error(self): network_acl_rule_before_prototype_model = {} network_acl_rule_before_prototype_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' - # Construct a dict representation of a NetworkACLRulePrototypeNetworkACLRuleProtocolICMP model + # Construct a dict representation of a NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype model network_acl_rule_prototype_model = {} network_acl_rule_prototype_model['action'] = 'allow' network_acl_rule_prototype_model['before'] = network_acl_rule_before_prototype_model @@ -21271,9 +23350,11 @@ def test_create_network_acl_rule_value_error(self): network_acl_rule_prototype_model['direction'] = 'inbound' network_acl_rule_prototype_model['name'] = 'my-rule-2' network_acl_rule_prototype_model['source'] = '192.168.3.2/32' - network_acl_rule_prototype_model['code'] = 0 - network_acl_rule_prototype_model['protocol'] = 'icmp' - network_acl_rule_prototype_model['type'] = 8 + network_acl_rule_prototype_model['destination_port_max'] = 22 + network_acl_rule_prototype_model['destination_port_min'] = 22 + network_acl_rule_prototype_model['protocol'] = 'udp' + network_acl_rule_prototype_model['source_port_max'] = 65535 + network_acl_rule_prototype_model['source_port_min'] = 49152 # Set up parameter values network_acl_id = 'testString' @@ -21289,7 +23370,6 @@ def test_create_network_acl_rule_value_error(self): with pytest.raises(ValueError): _service.create_network_acl_rule(**req_copy) - def test_create_network_acl_rule_value_error_with_retries(self): # Enable retries and run test_create_network_acl_rule_value_error. _service.enable_retries() @@ -21364,7 +23444,6 @@ def test_delete_network_acl_rule_value_error(self): with pytest.raises(ValueError): _service.delete_network_acl_rule(**req_copy) - def test_delete_network_acl_rule_value_error_with_retries(self): # Enable retries and run test_delete_network_acl_rule_value_error. _service.enable_retries() @@ -21386,7 +23465,7 @@ def test_get_network_acl_rule_all_params(self): """ # Set up mock url = preprocess_url('/network_acls/testString/rules/testString') - mock_response = '{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}' + mock_response = '{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}' responses.add(responses.GET, url, body=mock_response, @@ -21424,7 +23503,7 @@ def test_get_network_acl_rule_value_error(self): """ # Set up mock url = preprocess_url('/network_acls/testString/rules/testString') - mock_response = '{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}' + mock_response = '{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}' responses.add(responses.GET, url, body=mock_response, @@ -21445,7 +23524,6 @@ def test_get_network_acl_rule_value_error(self): with pytest.raises(ValueError): _service.get_network_acl_rule(**req_copy) - def test_get_network_acl_rule_value_error_with_retries(self): # Enable retries and run test_get_network_acl_rule_value_error. _service.enable_retries() @@ -21467,7 +23545,7 @@ def test_update_network_acl_rule_all_params(self): """ # Set up mock url = preprocess_url('/network_acls/testString/rules/testString') - mock_response = '{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}' + mock_response = '{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}' responses.add(responses.PATCH, url, body=mock_response, @@ -21487,7 +23565,8 @@ def test_update_network_acl_rule_all_params(self): network_acl_rule_patch_model['destination_port_max'] = 22 network_acl_rule_patch_model['destination_port_min'] = 22 network_acl_rule_patch_model['direction'] = 'inbound' - network_acl_rule_patch_model['name'] = 'my-rule-2' + network_acl_rule_patch_model['name'] = 'my-rule-1' + network_acl_rule_patch_model['protocol'] = 'tcp' network_acl_rule_patch_model['source'] = '192.168.3.2/32' network_acl_rule_patch_model['source_port_max'] = 65535 network_acl_rule_patch_model['source_port_min'] = 49152 @@ -21529,7 +23608,7 @@ def test_update_network_acl_rule_value_error(self): """ # Set up mock url = preprocess_url('/network_acls/testString/rules/testString') - mock_response = '{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}' + mock_response = '{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}' responses.add(responses.PATCH, url, body=mock_response, @@ -21549,7 +23628,8 @@ def test_update_network_acl_rule_value_error(self): network_acl_rule_patch_model['destination_port_max'] = 22 network_acl_rule_patch_model['destination_port_min'] = 22 network_acl_rule_patch_model['direction'] = 'inbound' - network_acl_rule_patch_model['name'] = 'my-rule-2' + network_acl_rule_patch_model['name'] = 'my-rule-1' + network_acl_rule_patch_model['protocol'] = 'tcp' network_acl_rule_patch_model['source'] = '192.168.3.2/32' network_acl_rule_patch_model['source_port_max'] = 65535 network_acl_rule_patch_model['source_port_min'] = 49152 @@ -21571,7 +23651,6 @@ def test_update_network_acl_rule_value_error(self): with pytest.raises(ValueError): _service.update_network_acl_rule(**req_copy) - def test_update_network_acl_rule_value_error_with_retries(self): # Enable retries and run test_update_network_acl_rule_value_error. _service.enable_retries() @@ -21635,6 +23714,7 @@ def test_new_instance_required_param_none(self): service = VpcV1.new_instance( version=None, ) + class TestListSecurityGroups(): """ Test Class for list_security_groups @@ -21748,7 +23828,6 @@ def test_list_security_groups_value_error(self): with pytest.raises(ValueError): _service.list_security_groups(**req_copy) - def test_list_security_groups_value_error_with_retries(self): # Enable retries and run test_list_security_groups_value_error. _service.enable_retries() @@ -21758,6 +23837,75 @@ def test_list_security_groups_value_error_with_retries(self): _service.disable_retries() self.test_list_security_groups_value_error() + @responses.activate + def test_list_security_groups_with_pager_get_next(self): + """ + test_list_security_groups_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/security_groups') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"security_groups":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/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","resource_type":"vpc"}}],"total_count":2,"limit":1}' + mock_response2 = '{"security_groups":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/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","resource_type":"vpc"}}],"total_count":2,"limit":1}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + all_results = [] + pager = SecurityGroupsPager( + client=_service, + limit=10, + resource_group_id='testString', + vpc_id='testString', + vpc_crn='testString', + vpc_name='testString', + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 + + @responses.activate + def test_list_security_groups_with_pager_get_all(self): + """ + test_list_security_groups_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/security_groups') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"security_groups":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/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","resource_type":"vpc"}}],"total_count":2,"limit":1}' + mock_response2 = '{"security_groups":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/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","resource_type":"vpc"}}],"total_count":2,"limit":1}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + pager = SecurityGroupsPager( + client=_service, + limit=10, + resource_group_id='testString', + vpc_id='testString', + vpc_crn='testString', + vpc_name='testString', + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + class TestCreateSecurityGroup(): """ Test Class for create_security_group @@ -21789,14 +23937,12 @@ def test_create_security_group_all_params(self): security_group_rule_remote_prototype_model = {} security_group_rule_remote_prototype_model['address'] = '192.168.3.4' - # Construct a dict representation of a SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP model + # Construct a dict representation of a SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll model security_group_rule_prototype_model = {} - security_group_rule_prototype_model['code'] = 0 security_group_rule_prototype_model['direction'] = 'inbound' security_group_rule_prototype_model['ip_version'] = 'ipv4' - security_group_rule_prototype_model['protocol'] = 'icmp' + security_group_rule_prototype_model['protocol'] = 'all' security_group_rule_prototype_model['remote'] = security_group_rule_remote_prototype_model - security_group_rule_prototype_model['type'] = 8 # Set up parameter values vpc = vpc_identity_model @@ -21858,14 +24004,12 @@ def test_create_security_group_value_error(self): security_group_rule_remote_prototype_model = {} security_group_rule_remote_prototype_model['address'] = '192.168.3.4' - # Construct a dict representation of a SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP model + # Construct a dict representation of a SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll model security_group_rule_prototype_model = {} - security_group_rule_prototype_model['code'] = 0 security_group_rule_prototype_model['direction'] = 'inbound' security_group_rule_prototype_model['ip_version'] = 'ipv4' - security_group_rule_prototype_model['protocol'] = 'icmp' + security_group_rule_prototype_model['protocol'] = 'all' security_group_rule_prototype_model['remote'] = security_group_rule_remote_prototype_model - security_group_rule_prototype_model['type'] = 8 # Set up parameter values vpc = vpc_identity_model @@ -21882,7 +24026,6 @@ def test_create_security_group_value_error(self): with pytest.raises(ValueError): _service.create_security_group(**req_copy) - def test_create_security_group_value_error_with_retries(self): # Enable retries and run test_create_security_group_value_error. _service.enable_retries() @@ -21953,7 +24096,6 @@ def test_delete_security_group_value_error(self): with pytest.raises(ValueError): _service.delete_security_group(**req_copy) - def test_delete_security_group_value_error_with_retries(self): # Enable retries and run test_delete_security_group_value_error. _service.enable_retries() @@ -22030,7 +24172,6 @@ def test_get_security_group_value_error(self): with pytest.raises(ValueError): _service.get_security_group(**req_copy) - def test_get_security_group_value_error_with_retries(self): # Enable retries and run test_get_security_group_value_error. _service.enable_retries() @@ -22122,7 +24263,6 @@ def test_update_security_group_value_error(self): with pytest.raises(ValueError): _service.update_security_group(**req_copy) - def test_update_security_group_value_error_with_retries(self): # Enable retries and run test_update_security_group_value_error. _service.enable_retries() @@ -22199,7 +24339,6 @@ def test_list_security_group_rules_value_error(self): with pytest.raises(ValueError): _service.list_security_group_rules(**req_copy) - def test_list_security_group_rules_value_error_with_retries(self): # Enable retries and run test_list_security_group_rules_value_error. _service.enable_retries() @@ -22232,14 +24371,12 @@ def test_create_security_group_rule_all_params(self): security_group_rule_remote_prototype_model = {} security_group_rule_remote_prototype_model['address'] = '192.168.3.4' - # Construct a dict representation of a SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP model + # Construct a dict representation of a SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll model security_group_rule_prototype_model = {} - security_group_rule_prototype_model['code'] = 0 security_group_rule_prototype_model['direction'] = 'inbound' security_group_rule_prototype_model['ip_version'] = 'ipv4' - security_group_rule_prototype_model['protocol'] = 'icmp' + security_group_rule_prototype_model['protocol'] = 'all' security_group_rule_prototype_model['remote'] = security_group_rule_remote_prototype_model - security_group_rule_prototype_model['type'] = 8 # Set up parameter values security_group_id = 'testString' @@ -22286,14 +24423,12 @@ def test_create_security_group_rule_value_error(self): security_group_rule_remote_prototype_model = {} security_group_rule_remote_prototype_model['address'] = '192.168.3.4' - # Construct a dict representation of a SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP model + # Construct a dict representation of a SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll model security_group_rule_prototype_model = {} - security_group_rule_prototype_model['code'] = 0 security_group_rule_prototype_model['direction'] = 'inbound' security_group_rule_prototype_model['ip_version'] = 'ipv4' - security_group_rule_prototype_model['protocol'] = 'icmp' + security_group_rule_prototype_model['protocol'] = 'all' security_group_rule_prototype_model['remote'] = security_group_rule_remote_prototype_model - security_group_rule_prototype_model['type'] = 8 # Set up parameter values security_group_id = 'testString' @@ -22309,7 +24444,6 @@ def test_create_security_group_rule_value_error(self): with pytest.raises(ValueError): _service.create_security_group_rule(**req_copy) - def test_create_security_group_rule_value_error_with_retries(self): # Enable retries and run test_create_security_group_rule_value_error. _service.enable_retries() @@ -22384,7 +24518,6 @@ def test_delete_security_group_rule_value_error(self): with pytest.raises(ValueError): _service.delete_security_group_rule(**req_copy) - def test_delete_security_group_rule_value_error_with_retries(self): # Enable retries and run test_delete_security_group_rule_value_error. _service.enable_retries() @@ -22465,7 +24598,6 @@ def test_get_security_group_rule_value_error(self): with pytest.raises(ValueError): _service.get_security_group_rule(**req_copy) - def test_get_security_group_rule_value_error_with_retries(self): # Enable retries and run test_get_security_group_rule_value_error. _service.enable_retries() @@ -22581,7 +24713,6 @@ def test_update_security_group_rule_value_error(self): with pytest.raises(ValueError): _service.update_security_group_rule(**req_copy) - def test_update_security_group_rule_value_error_with_retries(self): # Enable retries and run test_update_security_group_rule_value_error. _service.enable_retries() @@ -22703,7 +24834,6 @@ def test_list_security_group_targets_value_error(self): with pytest.raises(ValueError): _service.list_security_group_targets(**req_copy) - def test_list_security_group_targets_value_error_with_retries(self): # Enable retries and run test_list_security_group_targets_value_error. _service.enable_retries() @@ -22713,6 +24843,69 @@ def test_list_security_group_targets_value_error_with_retries(self): _service.disable_retries() self.test_list_security_group_targets_value_error() + @responses.activate + def test_list_security_group_targets_with_pager_get_next(self): + """ + test_list_security_group_targets_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/security_groups/testString/targets') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-network-interface","resource_type":"network_interface"}]}' + mock_response2 = '{"total_count":2,"limit":1,"targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-network-interface","resource_type":"network_interface"}]}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + all_results = [] + pager = SecurityGroupTargetsPager( + client=_service, + security_group_id='testString', + limit=10, + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 + + @responses.activate + def test_list_security_group_targets_with_pager_get_all(self): + """ + test_list_security_group_targets_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/security_groups/testString/targets') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-network-interface","resource_type":"network_interface"}]}' + mock_response2 = '{"total_count":2,"limit":1,"targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-network-interface","resource_type":"network_interface"}]}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + pager = SecurityGroupTargetsPager( + client=_service, + security_group_id='testString', + limit=10, + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + class TestDeleteSecurityGroupTargetBinding(): """ Test Class for delete_security_group_target_binding @@ -22778,7 +24971,6 @@ def test_delete_security_group_target_binding_value_error(self): with pytest.raises(ValueError): _service.delete_security_group_target_binding(**req_copy) - def test_delete_security_group_target_binding_value_error_with_retries(self): # Enable retries and run test_delete_security_group_target_binding_value_error. _service.enable_retries() @@ -22859,7 +25051,6 @@ def test_get_security_group_target_value_error(self): with pytest.raises(ValueError): _service.get_security_group_target(**req_copy) - def test_get_security_group_target_value_error_with_retries(self): # Enable retries and run test_get_security_group_target_value_error. _service.enable_retries() @@ -22940,7 +25131,6 @@ def test_create_security_group_target_binding_value_error(self): with pytest.raises(ValueError): _service.create_security_group_target_binding(**req_copy) - def test_create_security_group_target_binding_value_error_with_retries(self): # Enable retries and run test_create_security_group_target_binding_value_error. _service.enable_retries() @@ -23004,6 +25194,7 @@ def test_new_instance_required_param_none(self): service = VpcV1.new_instance( version=None, ) + class TestListIkePolicies(): """ Test Class for list_ike_policies @@ -23105,7 +25296,6 @@ def test_list_ike_policies_value_error(self): with pytest.raises(ValueError): _service.list_ike_policies(**req_copy) - def test_list_ike_policies_value_error_with_retries(self): # Enable retries and run test_list_ike_policies_value_error. _service.enable_retries() @@ -23115,6 +25305,67 @@ def test_list_ike_policies_value_error_with_retries(self): _service.disable_retries() self.test_list_ike_policies_value_error() + @responses.activate + def test_list_ike_policies_with_pager_get_next(self): + """ + test_list_ike_policies_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/ike_policies') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"ike_policies":[{"authentication_algorithm":"md5","connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","name":"my-vpn-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","dh_group":14,"encryption_algorithm":"aes128","href":"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","ike_version":1,"key_lifetime":28800,"name":"my-ike-policy","negotiation_mode":"main","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"ike_policy"}],"limit":1}' + mock_response2 = '{"total_count":2,"ike_policies":[{"authentication_algorithm":"md5","connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","name":"my-vpn-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","dh_group":14,"encryption_algorithm":"aes128","href":"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","ike_version":1,"key_lifetime":28800,"name":"my-ike-policy","negotiation_mode":"main","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"ike_policy"}],"limit":1}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + all_results = [] + pager = IkePoliciesPager( + client=_service, + limit=10, + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 + + @responses.activate + def test_list_ike_policies_with_pager_get_all(self): + """ + test_list_ike_policies_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/ike_policies') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"ike_policies":[{"authentication_algorithm":"md5","connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","name":"my-vpn-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","dh_group":14,"encryption_algorithm":"aes128","href":"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","ike_version":1,"key_lifetime":28800,"name":"my-ike-policy","negotiation_mode":"main","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"ike_policy"}],"limit":1}' + mock_response2 = '{"total_count":2,"ike_policies":[{"authentication_algorithm":"md5","connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","name":"my-vpn-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","dh_group":14,"encryption_algorithm":"aes128","href":"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","ike_version":1,"key_lifetime":28800,"name":"my-ike-policy","negotiation_mode":"main","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"ike_policy"}],"limit":1}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + pager = IkePoliciesPager( + client=_service, + limit=10, + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + class TestCreateIkePolicy(): """ Test Class for create_ike_policy @@ -23220,7 +25471,6 @@ def test_create_ike_policy_value_error(self): with pytest.raises(ValueError): _service.create_ike_policy(**req_copy) - def test_create_ike_policy_value_error_with_retries(self): # Enable retries and run test_create_ike_policy_value_error. _service.enable_retries() @@ -23291,7 +25541,6 @@ def test_delete_ike_policy_value_error(self): with pytest.raises(ValueError): _service.delete_ike_policy(**req_copy) - def test_delete_ike_policy_value_error_with_retries(self): # Enable retries and run test_delete_ike_policy_value_error. _service.enable_retries() @@ -23368,7 +25617,6 @@ def test_get_ike_policy_value_error(self): with pytest.raises(ValueError): _service.get_ike_policy(**req_copy) - def test_get_ike_policy_value_error_with_retries(self): # Enable retries and run test_get_ike_policy_value_error. _service.enable_retries() @@ -23470,7 +25718,6 @@ def test_update_ike_policy_value_error(self): with pytest.raises(ValueError): _service.update_ike_policy(**req_copy) - def test_update_ike_policy_value_error_with_retries(self): # Enable retries and run test_update_ike_policy_value_error. _service.enable_retries() @@ -23547,7 +25794,6 @@ def test_list_ike_policy_connections_value_error(self): with pytest.raises(ValueError): _service.list_ike_policy_connections(**req_copy) - def test_list_ike_policy_connections_value_error_with_retries(self): # Enable retries and run test_list_ike_policy_connections_value_error. _service.enable_retries() @@ -23569,7 +25815,7 @@ def test_list_ipsec_policies_all_params(self): """ # Set up mock url = preprocess_url('/ipsec_policies') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?limit=20"}, "ipsec_policies": [{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?limit=20"}, "ipsec_policies": [{"authentication_algorithm": "disabled", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -23612,7 +25858,7 @@ def test_list_ipsec_policies_required_params(self): """ # Set up mock url = preprocess_url('/ipsec_policies') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?limit=20"}, "ipsec_policies": [{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?limit=20"}, "ipsec_policies": [{"authentication_algorithm": "disabled", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -23643,7 +25889,7 @@ def test_list_ipsec_policies_value_error(self): """ # Set up mock url = preprocess_url('/ipsec_policies') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?limit=20"}, "ipsec_policies": [{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?limit=20"}, "ipsec_policies": [{"authentication_algorithm": "disabled", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -23658,7 +25904,6 @@ def test_list_ipsec_policies_value_error(self): with pytest.raises(ValueError): _service.list_ipsec_policies(**req_copy) - def test_list_ipsec_policies_value_error_with_retries(self): # Enable retries and run test_list_ipsec_policies_value_error. _service.enable_retries() @@ -23668,6 +25913,67 @@ def test_list_ipsec_policies_value_error_with_retries(self): _service.disable_retries() self.test_list_ipsec_policies_value_error() + @responses.activate + def test_list_ipsec_policies_with_pager_get_next(self): + """ + test_list_ipsec_policies_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/ipsec_policies') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"ipsec_policies":[{"authentication_algorithm":"disabled","connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","name":"my-vpn-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","encapsulation_mode":"tunnel","encryption_algorithm":"aes128","href":"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","key_lifetime":3600,"name":"my-ipsec-policy","pfs":"disabled","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"ipsec_policy","transform_protocol":"esp"}],"total_count":2,"limit":1}' + mock_response2 = '{"ipsec_policies":[{"authentication_algorithm":"disabled","connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","name":"my-vpn-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","encapsulation_mode":"tunnel","encryption_algorithm":"aes128","href":"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","key_lifetime":3600,"name":"my-ipsec-policy","pfs":"disabled","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"ipsec_policy","transform_protocol":"esp"}],"total_count":2,"limit":1}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + all_results = [] + pager = IpsecPoliciesPager( + client=_service, + limit=10, + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 + + @responses.activate + def test_list_ipsec_policies_with_pager_get_all(self): + """ + test_list_ipsec_policies_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/ipsec_policies') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"ipsec_policies":[{"authentication_algorithm":"disabled","connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","name":"my-vpn-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","encapsulation_mode":"tunnel","encryption_algorithm":"aes128","href":"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","key_lifetime":3600,"name":"my-ipsec-policy","pfs":"disabled","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"ipsec_policy","transform_protocol":"esp"}],"total_count":2,"limit":1}' + mock_response2 = '{"ipsec_policies":[{"authentication_algorithm":"disabled","connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","name":"my-vpn-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","encapsulation_mode":"tunnel","encryption_algorithm":"aes128","href":"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","key_lifetime":3600,"name":"my-ipsec-policy","pfs":"disabled","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"ipsec_policy","transform_protocol":"esp"}],"total_count":2,"limit":1}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + pager = IpsecPoliciesPager( + client=_service, + limit=10, + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + class TestCreateIpsecPolicy(): """ Test Class for create_ipsec_policy @@ -23680,7 +25986,7 @@ def test_create_ipsec_policy_all_params(self): """ # Set up mock url = preprocess_url('/ipsec_policies') - mock_response = '{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}' + mock_response = '{"authentication_algorithm": "disabled", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}' responses.add(responses.POST, url, body=mock_response, @@ -23692,7 +25998,7 @@ def test_create_ipsec_policy_all_params(self): resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' # Set up parameter values - authentication_algorithm = 'md5' + authentication_algorithm = 'disabled' encryption_algorithm = 'aes128' pfs = 'disabled' key_lifetime = 3600 @@ -23715,7 +26021,7 @@ def test_create_ipsec_policy_all_params(self): assert response.status_code == 201 # Validate body params req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) - assert req_body['authentication_algorithm'] == 'md5' + assert req_body['authentication_algorithm'] == 'disabled' assert req_body['encryption_algorithm'] == 'aes128' assert req_body['pfs'] == 'disabled' assert req_body['key_lifetime'] == 3600 @@ -23738,7 +26044,7 @@ def test_create_ipsec_policy_value_error(self): """ # Set up mock url = preprocess_url('/ipsec_policies') - mock_response = '{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}' + mock_response = '{"authentication_algorithm": "disabled", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}' responses.add(responses.POST, url, body=mock_response, @@ -23750,7 +26056,7 @@ def test_create_ipsec_policy_value_error(self): resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' # Set up parameter values - authentication_algorithm = 'md5' + authentication_algorithm = 'disabled' encryption_algorithm = 'aes128' pfs = 'disabled' key_lifetime = 3600 @@ -23768,7 +26074,6 @@ def test_create_ipsec_policy_value_error(self): with pytest.raises(ValueError): _service.create_ipsec_policy(**req_copy) - def test_create_ipsec_policy_value_error_with_retries(self): # Enable retries and run test_create_ipsec_policy_value_error. _service.enable_retries() @@ -23839,7 +26144,6 @@ def test_delete_ipsec_policy_value_error(self): with pytest.raises(ValueError): _service.delete_ipsec_policy(**req_copy) - def test_delete_ipsec_policy_value_error_with_retries(self): # Enable retries and run test_delete_ipsec_policy_value_error. _service.enable_retries() @@ -23861,7 +26165,7 @@ def test_get_ipsec_policy_all_params(self): """ # Set up mock url = preprocess_url('/ipsec_policies/testString') - mock_response = '{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}' + mock_response = '{"authentication_algorithm": "disabled", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}' responses.add(responses.GET, url, body=mock_response, @@ -23897,7 +26201,7 @@ def test_get_ipsec_policy_value_error(self): """ # Set up mock url = preprocess_url('/ipsec_policies/testString') - mock_response = '{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}' + mock_response = '{"authentication_algorithm": "disabled", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}' responses.add(responses.GET, url, body=mock_response, @@ -23916,7 +26220,6 @@ def test_get_ipsec_policy_value_error(self): with pytest.raises(ValueError): _service.get_ipsec_policy(**req_copy) - def test_get_ipsec_policy_value_error_with_retries(self): # Enable retries and run test_get_ipsec_policy_value_error. _service.enable_retries() @@ -23938,7 +26241,7 @@ def test_update_ipsec_policy_all_params(self): """ # Set up mock url = preprocess_url('/ipsec_policies/testString') - mock_response = '{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}' + mock_response = '{"authentication_algorithm": "disabled", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}' responses.add(responses.PATCH, url, body=mock_response, @@ -23947,7 +26250,7 @@ def test_update_ipsec_policy_all_params(self): # Construct a dict representation of a IPsecPolicyPatch model i_psec_policy_patch_model = {} - i_psec_policy_patch_model['authentication_algorithm'] = 'md5' + i_psec_policy_patch_model['authentication_algorithm'] = 'disabled' i_psec_policy_patch_model['encryption_algorithm'] = 'aes128' i_psec_policy_patch_model['key_lifetime'] = 3600 i_psec_policy_patch_model['name'] = 'my-ipsec-policy' @@ -23987,7 +26290,7 @@ def test_update_ipsec_policy_value_error(self): """ # Set up mock url = preprocess_url('/ipsec_policies/testString') - mock_response = '{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}' + mock_response = '{"authentication_algorithm": "disabled", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}' responses.add(responses.PATCH, url, body=mock_response, @@ -23996,7 +26299,7 @@ def test_update_ipsec_policy_value_error(self): # Construct a dict representation of a IPsecPolicyPatch model i_psec_policy_patch_model = {} - i_psec_policy_patch_model['authentication_algorithm'] = 'md5' + i_psec_policy_patch_model['authentication_algorithm'] = 'disabled' i_psec_policy_patch_model['encryption_algorithm'] = 'aes128' i_psec_policy_patch_model['key_lifetime'] = 3600 i_psec_policy_patch_model['name'] = 'my-ipsec-policy' @@ -24016,7 +26319,6 @@ def test_update_ipsec_policy_value_error(self): with pytest.raises(ValueError): _service.update_ipsec_policy(**req_copy) - def test_update_ipsec_policy_value_error_with_retries(self): # Enable retries and run test_update_ipsec_policy_value_error. _service.enable_retries() @@ -24093,7 +26395,6 @@ def test_list_ipsec_policy_connections_value_error(self): with pytest.raises(ValueError): _service.list_ipsec_policy_connections(**req_copy) - def test_list_ipsec_policy_connections_value_error_with_retries(self): # Enable retries and run test_list_ipsec_policy_connections_value_error. _service.enable_retries() @@ -24115,7 +26416,7 @@ def test_list_vpn_gateways_all_params(self): """ # Set up mock url = preprocess_url('/vpn_gateways') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132, "vpn_gateways": [{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "members": [{"private_ip": {"address": "192.168.3.4"}, "public_ip": {"address": "192.168.3.4"}, "role": "active", "status": "available"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "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", "resource_type": "subnet"}, "mode": "route"}]}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132, "vpn_gateways": [{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "members": [{"private_ip": {"address": "192.168.3.4"}, "public_ip": {"address": "192.168.3.4"}, "role": "active", "status": "available"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "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", "resource_type": "subnet"}, "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", "resource_type": "vpc"}, "mode": "route"}]}' responses.add(responses.GET, url, body=mock_response, @@ -24126,6 +26427,7 @@ def test_list_vpn_gateways_all_params(self): start = 'testString' limit = 1 resource_group_id = 'testString' + sort = 'name' mode = 'route' # Invoke method @@ -24133,6 +26435,7 @@ def test_list_vpn_gateways_all_params(self): start=start, limit=limit, resource_group_id=resource_group_id, + sort=sort, mode=mode, headers={} ) @@ -24146,6 +26449,7 @@ def test_list_vpn_gateways_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 assert 'mode={}'.format(mode) in query_string def test_list_vpn_gateways_all_params_with_retries(self): @@ -24164,7 +26468,7 @@ def test_list_vpn_gateways_required_params(self): """ # Set up mock url = preprocess_url('/vpn_gateways') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132, "vpn_gateways": [{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "members": [{"private_ip": {"address": "192.168.3.4"}, "public_ip": {"address": "192.168.3.4"}, "role": "active", "status": "available"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "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", "resource_type": "subnet"}, "mode": "route"}]}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132, "vpn_gateways": [{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "members": [{"private_ip": {"address": "192.168.3.4"}, "public_ip": {"address": "192.168.3.4"}, "role": "active", "status": "available"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "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", "resource_type": "subnet"}, "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", "resource_type": "vpc"}, "mode": "route"}]}' responses.add(responses.GET, url, body=mock_response, @@ -24195,7 +26499,7 @@ def test_list_vpn_gateways_value_error(self): """ # Set up mock url = preprocess_url('/vpn_gateways') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132, "vpn_gateways": [{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "members": [{"private_ip": {"address": "192.168.3.4"}, "public_ip": {"address": "192.168.3.4"}, "role": "active", "status": "available"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "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", "resource_type": "subnet"}, "mode": "route"}]}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132, "vpn_gateways": [{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "members": [{"private_ip": {"address": "192.168.3.4"}, "public_ip": {"address": "192.168.3.4"}, "role": "active", "status": "available"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "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", "resource_type": "subnet"}, "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", "resource_type": "vpc"}, "mode": "route"}]}' responses.add(responses.GET, url, body=mock_response, @@ -24210,7 +26514,6 @@ def test_list_vpn_gateways_value_error(self): with pytest.raises(ValueError): _service.list_vpn_gateways(**req_copy) - def test_list_vpn_gateways_value_error_with_retries(self): # Enable retries and run test_list_vpn_gateways_value_error. _service.enable_retries() @@ -24220,6 +26523,73 @@ def test_list_vpn_gateways_value_error_with_retries(self): _service.disable_retries() self.test_list_vpn_gateways_value_error() + @responses.activate + def test_list_vpn_gateways_with_pager_get_next(self): + """ + test_list_vpn_gateways_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/vpn_gateways') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"vpn_gateways":[{"connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","name":"my-vpn-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","members":[{"private_ip":{"address":"192.168.3.4"},"public_ip":{"address":"192.168.3.4"},"role":"active","status":"available"}],"name":"my-vpn-gateway","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"vpn_gateway","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","resource_type":"subnet"},"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","resource_type":"vpc"},"mode":"route"}]}' + mock_response2 = '{"total_count":2,"limit":1,"vpn_gateways":[{"connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","name":"my-vpn-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","members":[{"private_ip":{"address":"192.168.3.4"},"public_ip":{"address":"192.168.3.4"},"role":"active","status":"available"}],"name":"my-vpn-gateway","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"vpn_gateway","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","resource_type":"subnet"},"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","resource_type":"vpc"},"mode":"route"}]}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + all_results = [] + pager = VpnGatewaysPager( + client=_service, + limit=10, + resource_group_id='testString', + sort='name', + mode='route', + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 + + @responses.activate + def test_list_vpn_gateways_with_pager_get_all(self): + """ + test_list_vpn_gateways_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/vpn_gateways') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"vpn_gateways":[{"connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","name":"my-vpn-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","members":[{"private_ip":{"address":"192.168.3.4"},"public_ip":{"address":"192.168.3.4"},"role":"active","status":"available"}],"name":"my-vpn-gateway","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"vpn_gateway","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","resource_type":"subnet"},"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","resource_type":"vpc"},"mode":"route"}]}' + mock_response2 = '{"total_count":2,"limit":1,"vpn_gateways":[{"connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","name":"my-vpn-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","members":[{"private_ip":{"address":"192.168.3.4"},"public_ip":{"address":"192.168.3.4"},"role":"active","status":"available"}],"name":"my-vpn-gateway","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"vpn_gateway","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","resource_type":"subnet"},"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","resource_type":"vpc"},"mode":"route"}]}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + pager = VpnGatewaysPager( + client=_service, + limit=10, + resource_group_id='testString', + sort='name', + mode='route', + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + class TestCreateVpnGateway(): """ Test Class for create_vpn_gateway @@ -24232,7 +26602,7 @@ def test_create_vpn_gateway_all_params(self): """ # Set up mock url = preprocess_url('/vpn_gateways') - mock_response = '{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "members": [{"private_ip": {"address": "192.168.3.4"}, "public_ip": {"address": "192.168.3.4"}, "role": "active", "status": "available"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "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", "resource_type": "subnet"}, "mode": "route"}' + mock_response = '{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "members": [{"private_ip": {"address": "192.168.3.4"}, "public_ip": {"address": "192.168.3.4"}, "role": "active", "status": "available"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "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", "resource_type": "subnet"}, "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", "resource_type": "vpc"}, "mode": "route"}' responses.add(responses.POST, url, body=mock_response, @@ -24286,7 +26656,7 @@ def test_create_vpn_gateway_value_error(self): """ # Set up mock url = preprocess_url('/vpn_gateways') - mock_response = '{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "members": [{"private_ip": {"address": "192.168.3.4"}, "public_ip": {"address": "192.168.3.4"}, "role": "active", "status": "available"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "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", "resource_type": "subnet"}, "mode": "route"}' + mock_response = '{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "members": [{"private_ip": {"address": "192.168.3.4"}, "public_ip": {"address": "192.168.3.4"}, "role": "active", "status": "available"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "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", "resource_type": "subnet"}, "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", "resource_type": "vpc"}, "mode": "route"}' responses.add(responses.POST, url, body=mock_response, @@ -24320,7 +26690,6 @@ def test_create_vpn_gateway_value_error(self): with pytest.raises(ValueError): _service.create_vpn_gateway(**req_copy) - def test_create_vpn_gateway_value_error_with_retries(self): # Enable retries and run test_create_vpn_gateway_value_error. _service.enable_retries() @@ -24391,7 +26760,6 @@ def test_delete_vpn_gateway_value_error(self): with pytest.raises(ValueError): _service.delete_vpn_gateway(**req_copy) - def test_delete_vpn_gateway_value_error_with_retries(self): # Enable retries and run test_delete_vpn_gateway_value_error. _service.enable_retries() @@ -24413,7 +26781,7 @@ def test_get_vpn_gateway_all_params(self): """ # Set up mock url = preprocess_url('/vpn_gateways/testString') - mock_response = '{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "members": [{"private_ip": {"address": "192.168.3.4"}, "public_ip": {"address": "192.168.3.4"}, "role": "active", "status": "available"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "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", "resource_type": "subnet"}, "mode": "route"}' + mock_response = '{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "members": [{"private_ip": {"address": "192.168.3.4"}, "public_ip": {"address": "192.168.3.4"}, "role": "active", "status": "available"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "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", "resource_type": "subnet"}, "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", "resource_type": "vpc"}, "mode": "route"}' responses.add(responses.GET, url, body=mock_response, @@ -24449,7 +26817,7 @@ def test_get_vpn_gateway_value_error(self): """ # Set up mock url = preprocess_url('/vpn_gateways/testString') - mock_response = '{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "members": [{"private_ip": {"address": "192.168.3.4"}, "public_ip": {"address": "192.168.3.4"}, "role": "active", "status": "available"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "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", "resource_type": "subnet"}, "mode": "route"}' + mock_response = '{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "members": [{"private_ip": {"address": "192.168.3.4"}, "public_ip": {"address": "192.168.3.4"}, "role": "active", "status": "available"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "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", "resource_type": "subnet"}, "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", "resource_type": "vpc"}, "mode": "route"}' responses.add(responses.GET, url, body=mock_response, @@ -24468,7 +26836,6 @@ def test_get_vpn_gateway_value_error(self): with pytest.raises(ValueError): _service.get_vpn_gateway(**req_copy) - def test_get_vpn_gateway_value_error_with_retries(self): # Enable retries and run test_get_vpn_gateway_value_error. _service.enable_retries() @@ -24490,7 +26857,7 @@ def test_update_vpn_gateway_all_params(self): """ # Set up mock url = preprocess_url('/vpn_gateways/testString') - mock_response = '{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "members": [{"private_ip": {"address": "192.168.3.4"}, "public_ip": {"address": "192.168.3.4"}, "role": "active", "status": "available"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "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", "resource_type": "subnet"}, "mode": "route"}' + mock_response = '{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "members": [{"private_ip": {"address": "192.168.3.4"}, "public_ip": {"address": "192.168.3.4"}, "role": "active", "status": "available"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "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", "resource_type": "subnet"}, "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", "resource_type": "vpc"}, "mode": "route"}' responses.add(responses.PATCH, url, body=mock_response, @@ -24535,7 +26902,7 @@ def test_update_vpn_gateway_value_error(self): """ # Set up mock url = preprocess_url('/vpn_gateways/testString') - mock_response = '{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "members": [{"private_ip": {"address": "192.168.3.4"}, "public_ip": {"address": "192.168.3.4"}, "role": "active", "status": "available"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "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", "resource_type": "subnet"}, "mode": "route"}' + mock_response = '{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "members": [{"private_ip": {"address": "192.168.3.4"}, "public_ip": {"address": "192.168.3.4"}, "role": "active", "status": "available"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "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", "resource_type": "subnet"}, "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", "resource_type": "vpc"}, "mode": "route"}' responses.add(responses.PATCH, url, body=mock_response, @@ -24560,7 +26927,6 @@ def test_update_vpn_gateway_value_error(self): with pytest.raises(ValueError): _service.update_vpn_gateway(**req_copy) - def test_update_vpn_gateway_value_error_with_retries(self): # Enable retries and run test_update_vpn_gateway_value_error. _service.enable_retries() @@ -24679,7 +27045,6 @@ def test_list_vpn_gateway_connections_value_error(self): with pytest.raises(ValueError): _service.list_vpn_gateway_connections(**req_copy) - def test_list_vpn_gateway_connections_value_error_with_retries(self): # Enable retries and run test_list_vpn_gateway_connections_value_error. _service.enable_retries() @@ -24813,7 +27178,6 @@ def test_create_vpn_gateway_connection_value_error(self): with pytest.raises(ValueError): _service.create_vpn_gateway_connection(**req_copy) - def test_create_vpn_gateway_connection_value_error_with_retries(self): # Enable retries and run test_create_vpn_gateway_connection_value_error. _service.enable_retries() @@ -24888,7 +27252,6 @@ def test_delete_vpn_gateway_connection_value_error(self): with pytest.raises(ValueError): _service.delete_vpn_gateway_connection(**req_copy) - def test_delete_vpn_gateway_connection_value_error_with_retries(self): # Enable retries and run test_delete_vpn_gateway_connection_value_error. _service.enable_retries() @@ -24969,7 +27332,6 @@ def test_get_vpn_gateway_connection_value_error(self): with pytest.raises(ValueError): _service.get_vpn_gateway_connection(**req_copy) - def test_get_vpn_gateway_connection_value_error_with_retries(self): # Enable retries and run test_get_vpn_gateway_connection_value_error. _service.enable_retries() @@ -25107,7 +27469,6 @@ def test_update_vpn_gateway_connection_value_error(self): with pytest.raises(ValueError): _service.update_vpn_gateway_connection(**req_copy) - def test_update_vpn_gateway_connection_value_error_with_retries(self): # Enable retries and run test_update_vpn_gateway_connection_value_error. _service.enable_retries() @@ -25188,7 +27549,6 @@ def test_list_vpn_gateway_connection_local_cidrs_value_error(self): with pytest.raises(ValueError): _service.list_vpn_gateway_connection_local_cidrs(**req_copy) - def test_list_vpn_gateway_connection_local_cidrs_value_error_with_retries(self): # Enable retries and run test_list_vpn_gateway_connection_local_cidrs_value_error. _service.enable_retries() @@ -25271,7 +27631,6 @@ def test_remove_vpn_gateway_connection_local_cidr_value_error(self): with pytest.raises(ValueError): _service.remove_vpn_gateway_connection_local_cidr(**req_copy) - def test_remove_vpn_gateway_connection_local_cidr_value_error_with_retries(self): # Enable retries and run test_remove_vpn_gateway_connection_local_cidr_value_error. _service.enable_retries() @@ -25354,7 +27713,6 @@ def test_check_vpn_gateway_connection_local_cidr_value_error(self): with pytest.raises(ValueError): _service.check_vpn_gateway_connection_local_cidr(**req_copy) - def test_check_vpn_gateway_connection_local_cidr_value_error_with_retries(self): # Enable retries and run test_check_vpn_gateway_connection_local_cidr_value_error. _service.enable_retries() @@ -25437,7 +27795,6 @@ def test_add_vpn_gateway_connection_local_cidr_value_error(self): with pytest.raises(ValueError): _service.add_vpn_gateway_connection_local_cidr(**req_copy) - def test_add_vpn_gateway_connection_local_cidr_value_error_with_retries(self): # Enable retries and run test_add_vpn_gateway_connection_local_cidr_value_error. _service.enable_retries() @@ -25518,7 +27875,6 @@ def test_list_vpn_gateway_connection_peer_cidrs_value_error(self): with pytest.raises(ValueError): _service.list_vpn_gateway_connection_peer_cidrs(**req_copy) - def test_list_vpn_gateway_connection_peer_cidrs_value_error_with_retries(self): # Enable retries and run test_list_vpn_gateway_connection_peer_cidrs_value_error. _service.enable_retries() @@ -25601,7 +27957,6 @@ def test_remove_vpn_gateway_connection_peer_cidr_value_error(self): with pytest.raises(ValueError): _service.remove_vpn_gateway_connection_peer_cidr(**req_copy) - def test_remove_vpn_gateway_connection_peer_cidr_value_error_with_retries(self): # Enable retries and run test_remove_vpn_gateway_connection_peer_cidr_value_error. _service.enable_retries() @@ -25684,7 +28039,6 @@ def test_check_vpn_gateway_connection_peer_cidr_value_error(self): with pytest.raises(ValueError): _service.check_vpn_gateway_connection_peer_cidr(**req_copy) - def test_check_vpn_gateway_connection_peer_cidr_value_error_with_retries(self): # Enable retries and run test_check_vpn_gateway_connection_peer_cidr_value_error. _service.enable_retries() @@ -25767,7 +28121,6 @@ def test_add_vpn_gateway_connection_peer_cidr_value_error(self): with pytest.raises(ValueError): _service.add_vpn_gateway_connection_peer_cidr(**req_copy) - def test_add_vpn_gateway_connection_peer_cidr_value_error_with_retries(self): # Enable retries and run test_add_vpn_gateway_connection_peer_cidr_value_error. _service.enable_retries() @@ -25831,6 +28184,7 @@ def test_new_instance_required_param_none(self): service = VpcV1.new_instance( version=None, ) + class TestListVpnServers(): """ Test Class for list_vpn_servers @@ -25941,7 +28295,6 @@ def test_list_vpn_servers_value_error(self): with pytest.raises(ValueError): _service.list_vpn_servers(**req_copy) - def test_list_vpn_servers_value_error_with_retries(self): # Enable retries and run test_list_vpn_servers_value_error. _service.enable_retries() @@ -25951,6 +28304,73 @@ def test_list_vpn_servers_value_error_with_retries(self): _service.disable_retries() self.test_list_vpn_servers_value_error() + @responses.activate + def test_list_vpn_servers_with_pager_get_next(self): + """ + test_list_vpn_servers_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/vpn_servers') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"vpn_servers":[{"certificate":{"crn":"crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"},"client_authentication":[{"method":"certificate","identity_provider":{"provider_type":"iam"}}],"client_auto_delete":true,"client_auto_delete_timeout":1,"client_dns_server_ips":[{"address":"192.168.3.4"}],"client_idle_timeout":600,"client_ip_pool":"172.16.0.0/16","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5","enable_split_tunneling":true,"health_state":"ok","hostname":"a8506291.us-south.vpn-server.appdomain.cloud","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5","id":"r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5","lifecycle_state":"stable","name":"my-vpn-server","port":443,"private_ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/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"}],"protocol":"udp","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"vpn_server","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/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"}],"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","resource_type":"subnet"}],"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","resource_type":"vpc"}}],"total_count":2,"limit":1}' + mock_response2 = '{"vpn_servers":[{"certificate":{"crn":"crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"},"client_authentication":[{"method":"certificate","identity_provider":{"provider_type":"iam"}}],"client_auto_delete":true,"client_auto_delete_timeout":1,"client_dns_server_ips":[{"address":"192.168.3.4"}],"client_idle_timeout":600,"client_ip_pool":"172.16.0.0/16","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5","enable_split_tunneling":true,"health_state":"ok","hostname":"a8506291.us-south.vpn-server.appdomain.cloud","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5","id":"r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5","lifecycle_state":"stable","name":"my-vpn-server","port":443,"private_ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/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"}],"protocol":"udp","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"vpn_server","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/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"}],"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","resource_type":"subnet"}],"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","resource_type":"vpc"}}],"total_count":2,"limit":1}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + all_results = [] + pager = VpnServersPager( + client=_service, + name='testString', + limit=10, + resource_group_id='testString', + sort='name', + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 + + @responses.activate + def test_list_vpn_servers_with_pager_get_all(self): + """ + test_list_vpn_servers_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/vpn_servers') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"vpn_servers":[{"certificate":{"crn":"crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"},"client_authentication":[{"method":"certificate","identity_provider":{"provider_type":"iam"}}],"client_auto_delete":true,"client_auto_delete_timeout":1,"client_dns_server_ips":[{"address":"192.168.3.4"}],"client_idle_timeout":600,"client_ip_pool":"172.16.0.0/16","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5","enable_split_tunneling":true,"health_state":"ok","hostname":"a8506291.us-south.vpn-server.appdomain.cloud","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5","id":"r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5","lifecycle_state":"stable","name":"my-vpn-server","port":443,"private_ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/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"}],"protocol":"udp","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"vpn_server","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/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"}],"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","resource_type":"subnet"}],"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","resource_type":"vpc"}}],"total_count":2,"limit":1}' + mock_response2 = '{"vpn_servers":[{"certificate":{"crn":"crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"},"client_authentication":[{"method":"certificate","identity_provider":{"provider_type":"iam"}}],"client_auto_delete":true,"client_auto_delete_timeout":1,"client_dns_server_ips":[{"address":"192.168.3.4"}],"client_idle_timeout":600,"client_ip_pool":"172.16.0.0/16","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5","enable_split_tunneling":true,"health_state":"ok","hostname":"a8506291.us-south.vpn-server.appdomain.cloud","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5","id":"r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5","lifecycle_state":"stable","name":"my-vpn-server","port":443,"private_ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/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"}],"protocol":"udp","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"vpn_server","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/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"}],"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","resource_type":"subnet"}],"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","resource_type":"vpc"}}],"total_count":2,"limit":1}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + pager = VpnServersPager( + client=_service, + name='testString', + limit=10, + resource_group_id='testString', + sort='name', + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + class TestCreateVpnServer(): """ Test Class for create_vpn_server @@ -26126,7 +28546,6 @@ def test_create_vpn_server_value_error(self): with pytest.raises(ValueError): _service.create_vpn_server(**req_copy) - def test_create_vpn_server_value_error_with_retries(self): # Enable retries and run test_create_vpn_server_value_error. _service.enable_retries() @@ -26232,7 +28651,6 @@ def test_delete_vpn_server_value_error(self): with pytest.raises(ValueError): _service.delete_vpn_server(**req_copy) - def test_delete_vpn_server_value_error_with_retries(self): # Enable retries and run test_delete_vpn_server_value_error. _service.enable_retries() @@ -26309,7 +28727,6 @@ def test_get_vpn_server_value_error(self): with pytest.raises(ValueError): _service.get_vpn_server(**req_copy) - def test_get_vpn_server_value_error_with_retries(self): # Enable retries and run test_get_vpn_server_value_error. _service.enable_retries() @@ -26538,7 +28955,6 @@ def test_update_vpn_server_value_error(self): with pytest.raises(ValueError): _service.update_vpn_server(**req_copy) - def test_update_vpn_server_value_error_with_retries(self): # Enable retries and run test_update_vpn_server_value_error. _service.enable_retries() @@ -26615,7 +29031,6 @@ def test_get_vpn_server_client_configuration_value_error(self): with pytest.raises(ValueError): _service.get_vpn_server_client_configuration(**req_copy) - def test_get_vpn_server_client_configuration_value_error_with_retries(self): # Enable retries and run test_get_vpn_server_client_configuration_value_error. _service.enable_retries() @@ -26740,7 +29155,6 @@ def test_list_vpn_server_clients_value_error(self): with pytest.raises(ValueError): _service.list_vpn_server_clients(**req_copy) - def test_list_vpn_server_clients_value_error_with_retries(self): # Enable retries and run test_list_vpn_server_clients_value_error. _service.enable_retries() @@ -26750,6 +29164,71 @@ def test_list_vpn_server_clients_value_error_with_retries(self): _service.disable_retries() self.test_list_vpn_server_clients_value_error() + @responses.activate + def test_list_vpn_server_clients_with_pager_get_next(self): + """ + test_list_vpn_server_clients_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/vpn_servers/testString/clients') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"clients":[{"client_ip":{"address":"192.168.3.4"},"common_name":"common_name","created_at":"2019-01-01T12:00:00.000Z","disconnected_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/8e454ead-0db7-48ac-9a8b-2698d8c470a7/clients/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","remote_ip":{"address":"192.168.3.4"},"remote_port":22,"resource_type":"vpn_server_client","status":"connected","username":"username"}],"total_count":2,"limit":1}' + mock_response2 = '{"clients":[{"client_ip":{"address":"192.168.3.4"},"common_name":"common_name","created_at":"2019-01-01T12:00:00.000Z","disconnected_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/8e454ead-0db7-48ac-9a8b-2698d8c470a7/clients/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","remote_ip":{"address":"192.168.3.4"},"remote_port":22,"resource_type":"vpn_server_client","status":"connected","username":"username"}],"total_count":2,"limit":1}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + all_results = [] + pager = VpnServerClientsPager( + client=_service, + vpn_server_id='testString', + limit=10, + sort='created_at', + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 + + @responses.activate + def test_list_vpn_server_clients_with_pager_get_all(self): + """ + test_list_vpn_server_clients_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/vpn_servers/testString/clients') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"clients":[{"client_ip":{"address":"192.168.3.4"},"common_name":"common_name","created_at":"2019-01-01T12:00:00.000Z","disconnected_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/8e454ead-0db7-48ac-9a8b-2698d8c470a7/clients/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","remote_ip":{"address":"192.168.3.4"},"remote_port":22,"resource_type":"vpn_server_client","status":"connected","username":"username"}],"total_count":2,"limit":1}' + mock_response2 = '{"clients":[{"client_ip":{"address":"192.168.3.4"},"common_name":"common_name","created_at":"2019-01-01T12:00:00.000Z","disconnected_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/8e454ead-0db7-48ac-9a8b-2698d8c470a7/clients/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","remote_ip":{"address":"192.168.3.4"},"remote_port":22,"resource_type":"vpn_server_client","status":"connected","username":"username"}],"total_count":2,"limit":1}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + pager = VpnServerClientsPager( + client=_service, + vpn_server_id='testString', + limit=10, + sort='created_at', + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + class TestDeleteVpnServerClient(): """ Test Class for delete_vpn_server_client @@ -26815,7 +29294,6 @@ def test_delete_vpn_server_client_value_error(self): with pytest.raises(ValueError): _service.delete_vpn_server_client(**req_copy) - def test_delete_vpn_server_client_value_error_with_retries(self): # Enable retries and run test_delete_vpn_server_client_value_error. _service.enable_retries() @@ -26896,7 +29374,6 @@ def test_get_vpn_server_client_value_error(self): with pytest.raises(ValueError): _service.get_vpn_server_client(**req_copy) - def test_get_vpn_server_client_value_error_with_retries(self): # Enable retries and run test_get_vpn_server_client_value_error. _service.enable_retries() @@ -26971,7 +29448,6 @@ def test_disconnect_vpn_client_value_error(self): with pytest.raises(ValueError): _service.disconnect_vpn_client(**req_copy) - def test_disconnect_vpn_client_value_error_with_retries(self): # Enable retries and run test_disconnect_vpn_client_value_error. _service.enable_retries() @@ -27096,7 +29572,6 @@ def test_list_vpn_server_routes_value_error(self): with pytest.raises(ValueError): _service.list_vpn_server_routes(**req_copy) - def test_list_vpn_server_routes_value_error_with_retries(self): # Enable retries and run test_list_vpn_server_routes_value_error. _service.enable_retries() @@ -27106,6 +29581,71 @@ def test_list_vpn_server_routes_value_error_with_retries(self): _service.disable_retries() self.test_list_vpn_server_routes_value_error() + @responses.activate + def test_list_vpn_server_routes_with_pager_get_next(self): + """ + test_list_vpn_server_routes_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/vpn_servers/testString/routes') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"routes":[{"action":"deliver","created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","lifecycle_state":"stable","name":"my-vpn-route-1","resource_type":"vpn_server_route"}],"total_count":2,"limit":1}' + mock_response2 = '{"routes":[{"action":"deliver","created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","lifecycle_state":"stable","name":"my-vpn-route-1","resource_type":"vpn_server_route"}],"total_count":2,"limit":1}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + all_results = [] + pager = VpnServerRoutesPager( + client=_service, + vpn_server_id='testString', + limit=10, + sort='name', + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 + + @responses.activate + def test_list_vpn_server_routes_with_pager_get_all(self): + """ + test_list_vpn_server_routes_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/vpn_servers/testString/routes') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"routes":[{"action":"deliver","created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","lifecycle_state":"stable","name":"my-vpn-route-1","resource_type":"vpn_server_route"}],"total_count":2,"limit":1}' + mock_response2 = '{"routes":[{"action":"deliver","created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","lifecycle_state":"stable","name":"my-vpn-route-1","resource_type":"vpn_server_route"}],"total_count":2,"limit":1}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + pager = VpnServerRoutesPager( + client=_service, + vpn_server_id='testString', + limit=10, + sort='name', + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + class TestCreateVpnServerRoute(): """ Test Class for create_vpn_server_route @@ -27188,7 +29728,6 @@ def test_create_vpn_server_route_value_error(self): with pytest.raises(ValueError): _service.create_vpn_server_route(**req_copy) - def test_create_vpn_server_route_value_error_with_retries(self): # Enable retries and run test_create_vpn_server_route_value_error. _service.enable_retries() @@ -27263,7 +29802,6 @@ def test_delete_vpn_server_route_value_error(self): with pytest.raises(ValueError): _service.delete_vpn_server_route(**req_copy) - def test_delete_vpn_server_route_value_error_with_retries(self): # Enable retries and run test_delete_vpn_server_route_value_error. _service.enable_retries() @@ -27344,7 +29882,6 @@ def test_get_vpn_server_route_value_error(self): with pytest.raises(ValueError): _service.get_vpn_server_route(**req_copy) - def test_get_vpn_server_route_value_error_with_retries(self): # Enable retries and run test_get_vpn_server_route_value_error. _service.enable_retries() @@ -27440,7 +29977,6 @@ def test_update_vpn_server_route_value_error(self): with pytest.raises(ValueError): _service.update_vpn_server_route(**req_copy) - def test_update_vpn_server_route_value_error_with_retries(self): # Enable retries and run test_update_vpn_server_route_value_error. _service.enable_retries() @@ -27504,6 +30040,7 @@ def test_new_instance_required_param_none(self): service = VpcV1.new_instance( version=None, ) + class TestListLoadBalancerProfiles(): """ Test Class for list_load_balancer_profiles @@ -27605,7 +30142,6 @@ def test_list_load_balancer_profiles_value_error(self): with pytest.raises(ValueError): _service.list_load_balancer_profiles(**req_copy) - def test_list_load_balancer_profiles_value_error_with_retries(self): # Enable retries and run test_list_load_balancer_profiles_value_error. _service.enable_retries() @@ -27615,6 +30151,67 @@ def test_list_load_balancer_profiles_value_error_with_retries(self): _service.disable_retries() self.test_list_load_balancer_profiles_value_error() + @responses.activate + def test_list_load_balancer_profiles_with_pager_get_next(self): + """ + test_list_load_balancer_profiles_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/load_balancer/profiles') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"profiles":[{"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}}]}' + mock_response2 = '{"total_count":2,"limit":1,"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}}]}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + all_results = [] + pager = LoadBalancerProfilesPager( + client=_service, + limit=10, + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 + + @responses.activate + def test_list_load_balancer_profiles_with_pager_get_all(self): + """ + test_list_load_balancer_profiles_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/load_balancer/profiles') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"profiles":[{"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}}]}' + mock_response2 = '{"total_count":2,"limit":1,"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}}]}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + pager = LoadBalancerProfilesPager( + client=_service, + limit=10, + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + class TestGetLoadBalancerProfile(): """ Test Class for get_load_balancer_profile @@ -27682,7 +30279,6 @@ def test_get_load_balancer_profile_value_error(self): with pytest.raises(ValueError): _service.get_load_balancer_profile(**req_copy) - def test_get_load_balancer_profile_value_error_with_retries(self): # Enable retries and run test_get_load_balancer_profile_value_error. _service.enable_retries() @@ -27793,7 +30389,6 @@ def test_list_load_balancers_value_error(self): with pytest.raises(ValueError): _service.list_load_balancers(**req_copy) - def test_list_load_balancers_value_error_with_retries(self): # Enable retries and run test_list_load_balancers_value_error. _service.enable_retries() @@ -27803,6 +30398,67 @@ def test_list_load_balancers_value_error_with_retries(self): _service.disable_retries() self.test_list_load_balancers_value_error() + @responses.activate + def test_list_load_balancers_with_pager_get_next(self): + """ + test_list_load_balancers_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/load_balancers') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"load_balancers":[{"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","resource_type":"subnet"}],"udp_supported":true}]}' + mock_response2 = '{"total_count":2,"limit":1,"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","resource_type":"subnet"}],"udp_supported":true}]}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + all_results = [] + pager = LoadBalancersPager( + client=_service, + limit=10, + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 + + @responses.activate + def test_list_load_balancers_with_pager_get_all(self): + """ + test_list_load_balancers_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/load_balancers') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"load_balancers":[{"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","resource_type":"subnet"}],"udp_supported":true}]}' + mock_response2 = '{"total_count":2,"limit":1,"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","resource_type":"subnet"}],"udp_supported":true}]}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + pager = LoadBalancersPager( + client=_service, + limit=10, + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + class TestCreateLoadBalancer(): """ Test Class for create_load_balancer @@ -27826,15 +30482,31 @@ def test_create_load_balancer_all_params(self): subnet_identity_model = {} subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + # Construct a dict representation of a CertificateInstanceIdentityByCRN model + certificate_instance_identity_model = {} + certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5' + # Construct a dict representation of a LoadBalancerPoolIdentityByName model load_balancer_pool_identity_by_name_model = {} load_balancer_pool_identity_by_name_model['name'] = 'my-load-balancer-pool' + # Construct a dict representation of a LoadBalancerListenerIdentityById model + load_balancer_listener_identity_model = {} + load_balancer_listener_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + + # Construct a dict representation of a LoadBalancerListenerHTTPSRedirectPrototype model + load_balancer_listener_https_redirect_prototype_model = {} + load_balancer_listener_https_redirect_prototype_model['http_status_code'] = 301 + load_balancer_listener_https_redirect_prototype_model['listener'] = load_balancer_listener_identity_model + load_balancer_listener_https_redirect_prototype_model['uri'] = '/example?doc=get' + # Construct a dict representation of a LoadBalancerListenerPrototypeLoadBalancerContext model load_balancer_listener_prototype_load_balancer_context_model = {} load_balancer_listener_prototype_load_balancer_context_model['accept_proxy_protocol'] = True + load_balancer_listener_prototype_load_balancer_context_model['certificate_instance'] = certificate_instance_identity_model load_balancer_listener_prototype_load_balancer_context_model['connection_limit'] = 2000 load_balancer_listener_prototype_load_balancer_context_model['default_pool'] = load_balancer_pool_identity_by_name_model + load_balancer_listener_prototype_load_balancer_context_model['https_redirect'] = load_balancer_listener_https_redirect_prototype_model load_balancer_listener_prototype_load_balancer_context_model['port'] = 443 load_balancer_listener_prototype_load_balancer_context_model['port_max'] = 499 load_balancer_listener_prototype_load_balancer_context_model['port_min'] = 443 @@ -27964,15 +30636,31 @@ def test_create_load_balancer_value_error(self): subnet_identity_model = {} subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + # Construct a dict representation of a CertificateInstanceIdentityByCRN model + certificate_instance_identity_model = {} + certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5' + # Construct a dict representation of a LoadBalancerPoolIdentityByName model load_balancer_pool_identity_by_name_model = {} load_balancer_pool_identity_by_name_model['name'] = 'my-load-balancer-pool' + # Construct a dict representation of a LoadBalancerListenerIdentityById model + load_balancer_listener_identity_model = {} + load_balancer_listener_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + + # Construct a dict representation of a LoadBalancerListenerHTTPSRedirectPrototype model + load_balancer_listener_https_redirect_prototype_model = {} + load_balancer_listener_https_redirect_prototype_model['http_status_code'] = 301 + load_balancer_listener_https_redirect_prototype_model['listener'] = load_balancer_listener_identity_model + load_balancer_listener_https_redirect_prototype_model['uri'] = '/example?doc=get' + # Construct a dict representation of a LoadBalancerListenerPrototypeLoadBalancerContext model load_balancer_listener_prototype_load_balancer_context_model = {} load_balancer_listener_prototype_load_balancer_context_model['accept_proxy_protocol'] = True + load_balancer_listener_prototype_load_balancer_context_model['certificate_instance'] = certificate_instance_identity_model load_balancer_listener_prototype_load_balancer_context_model['connection_limit'] = 2000 load_balancer_listener_prototype_load_balancer_context_model['default_pool'] = load_balancer_pool_identity_by_name_model + load_balancer_listener_prototype_load_balancer_context_model['https_redirect'] = load_balancer_listener_https_redirect_prototype_model load_balancer_listener_prototype_load_balancer_context_model['port'] = 443 load_balancer_listener_prototype_load_balancer_context_model['port_max'] = 499 load_balancer_listener_prototype_load_balancer_context_model['port_min'] = 443 @@ -28054,7 +30742,6 @@ def test_create_load_balancer_value_error(self): with pytest.raises(ValueError): _service.create_load_balancer(**req_copy) - def test_create_load_balancer_value_error_with_retries(self): # Enable retries and run test_create_load_balancer_value_error. _service.enable_retries() @@ -28078,20 +30765,22 @@ def test_delete_load_balancer_all_params(self): url = preprocess_url('/load_balancers/testString') responses.add(responses.DELETE, url, - status=204) + status=202) # Set up parameter values id = 'testString' + if_match = 'W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"' # Invoke method response = _service.delete_load_balancer( id, + if_match=if_match, headers={} ) # Check for correct operation assert len(responses.calls) == 1 - assert response.status_code == 204 + assert response.status_code == 202 def test_delete_load_balancer_all_params_with_retries(self): # Enable retries and run test_delete_load_balancer_all_params. @@ -28102,6 +30791,39 @@ def test_delete_load_balancer_all_params_with_retries(self): _service.disable_retries() self.test_delete_load_balancer_all_params() + @responses.activate + def test_delete_load_balancer_required_params(self): + """ + test_delete_load_balancer_required_params() + """ + # Set up mock + url = preprocess_url('/load_balancers/testString') + responses.add(responses.DELETE, + url, + status=202) + + # Set up parameter values + id = 'testString' + + # Invoke method + response = _service.delete_load_balancer( + id, + headers={} + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 202 + + def test_delete_load_balancer_required_params_with_retries(self): + # Enable retries and run test_delete_load_balancer_required_params. + _service.enable_retries() + self.test_delete_load_balancer_required_params() + + # Disable retries and run test_delete_load_balancer_required_params. + _service.disable_retries() + self.test_delete_load_balancer_required_params() + @responses.activate def test_delete_load_balancer_value_error(self): """ @@ -28111,7 +30833,7 @@ def test_delete_load_balancer_value_error(self): url = preprocess_url('/load_balancers/testString') responses.add(responses.DELETE, url, - status=204) + status=202) # Set up parameter values id = 'testString' @@ -28125,7 +30847,6 @@ def test_delete_load_balancer_value_error(self): with pytest.raises(ValueError): _service.delete_load_balancer(**req_copy) - def test_delete_load_balancer_value_error_with_retries(self): # Enable retries and run test_delete_load_balancer_value_error. _service.enable_retries() @@ -28202,7 +30923,6 @@ def test_get_load_balancer_value_error(self): with pytest.raises(ValueError): _service.get_load_balancer(**req_copy) - def test_get_load_balancer_value_error_with_retries(self): # Enable retries and run test_get_load_balancer_value_error. _service.enable_retries() @@ -28239,19 +30959,26 @@ def test_update_load_balancer_all_params(self): load_balancer_logging_model = {} load_balancer_logging_model['datapath'] = load_balancer_logging_datapath_model + # Construct a dict representation of a SubnetIdentityById model + subnet_identity_model = {} + subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + # Construct a dict representation of a LoadBalancerPatch model load_balancer_patch_model = {} load_balancer_patch_model['logging'] = load_balancer_logging_model load_balancer_patch_model['name'] = 'my-load-balancer' + load_balancer_patch_model['subnets'] = [subnet_identity_model] # Set up parameter values id = 'testString' load_balancer_patch = load_balancer_patch_model + if_match = 'W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"' # Invoke method response = _service.update_load_balancer( id, load_balancer_patch, + if_match=if_match, headers={} ) @@ -28271,6 +30998,65 @@ def test_update_load_balancer_all_params_with_retries(self): _service.disable_retries() self.test_update_load_balancer_all_params() + @responses.activate + def test_update_load_balancer_required_params(self): + """ + test_update_load_balancer_required_params() + """ + # 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", "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", "resource_type": "subnet"}], "udp_supported": true}' + responses.add(responses.PATCH, + url, + body=mock_response, + content_type='application/json', + status=200) + + # Construct a dict representation of a LoadBalancerLoggingDatapath model + load_balancer_logging_datapath_model = {} + load_balancer_logging_datapath_model['active'] = True + + # Construct a dict representation of a LoadBalancerLogging model + load_balancer_logging_model = {} + load_balancer_logging_model['datapath'] = load_balancer_logging_datapath_model + + # Construct a dict representation of a SubnetIdentityById model + subnet_identity_model = {} + subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + + # Construct a dict representation of a LoadBalancerPatch model + load_balancer_patch_model = {} + load_balancer_patch_model['logging'] = load_balancer_logging_model + load_balancer_patch_model['name'] = 'my-load-balancer' + load_balancer_patch_model['subnets'] = [subnet_identity_model] + + # Set up parameter values + id = 'testString' + load_balancer_patch = load_balancer_patch_model + + # Invoke method + response = _service.update_load_balancer( + id, + load_balancer_patch, + headers={} + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + # Validate body params + req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) + assert req_body == load_balancer_patch + + def test_update_load_balancer_required_params_with_retries(self): + # Enable retries and run test_update_load_balancer_required_params. + _service.enable_retries() + self.test_update_load_balancer_required_params() + + # Disable retries and run test_update_load_balancer_required_params. + _service.disable_retries() + self.test_update_load_balancer_required_params() + @responses.activate def test_update_load_balancer_value_error(self): """ @@ -28293,10 +31079,15 @@ def test_update_load_balancer_value_error(self): load_balancer_logging_model = {} load_balancer_logging_model['datapath'] = load_balancer_logging_datapath_model + # Construct a dict representation of a SubnetIdentityById model + subnet_identity_model = {} + subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + # Construct a dict representation of a LoadBalancerPatch model load_balancer_patch_model = {} load_balancer_patch_model['logging'] = load_balancer_logging_model load_balancer_patch_model['name'] = 'my-load-balancer' + load_balancer_patch_model['subnets'] = [subnet_identity_model] # Set up parameter values id = 'testString' @@ -28312,7 +31103,6 @@ def test_update_load_balancer_value_error(self): with pytest.raises(ValueError): _service.update_load_balancer(**req_copy) - def test_update_load_balancer_value_error_with_retries(self): # Enable retries and run test_update_load_balancer_value_error. _service.enable_retries() @@ -28389,7 +31179,6 @@ def test_get_load_balancer_statistics_value_error(self): with pytest.raises(ValueError): _service.get_load_balancer_statistics(**req_copy) - def test_get_load_balancer_statistics_value_error_with_retries(self): # Enable retries and run test_get_load_balancer_statistics_value_error. _service.enable_retries() @@ -28466,7 +31255,6 @@ def test_list_load_balancer_listeners_value_error(self): with pytest.raises(ValueError): _service.list_load_balancer_listeners(**req_copy) - def test_list_load_balancer_listeners_value_error_with_retries(self): # Enable retries and run test_list_load_balancer_listeners_value_error. _service.enable_retries() @@ -28660,7 +31448,6 @@ def test_create_load_balancer_listener_value_error(self): with pytest.raises(ValueError): _service.create_load_balancer_listener(**req_copy) - def test_create_load_balancer_listener_value_error_with_retries(self): # Enable retries and run test_create_load_balancer_listener_value_error. _service.enable_retries() @@ -28684,7 +31471,7 @@ def test_delete_load_balancer_listener_all_params(self): url = preprocess_url('/load_balancers/testString/listeners/testString') responses.add(responses.DELETE, url, - status=204) + status=202) # Set up parameter values load_balancer_id = 'testString' @@ -28699,7 +31486,7 @@ def test_delete_load_balancer_listener_all_params(self): # Check for correct operation assert len(responses.calls) == 1 - assert response.status_code == 204 + assert response.status_code == 202 def test_delete_load_balancer_listener_all_params_with_retries(self): # Enable retries and run test_delete_load_balancer_listener_all_params. @@ -28719,7 +31506,7 @@ def test_delete_load_balancer_listener_value_error(self): url = preprocess_url('/load_balancers/testString/listeners/testString') responses.add(responses.DELETE, url, - status=204) + status=202) # Set up parameter values load_balancer_id = 'testString' @@ -28735,7 +31522,6 @@ def test_delete_load_balancer_listener_value_error(self): with pytest.raises(ValueError): _service.delete_load_balancer_listener(**req_copy) - def test_delete_load_balancer_listener_value_error_with_retries(self): # Enable retries and run test_delete_load_balancer_listener_value_error. _service.enable_retries() @@ -28816,7 +31602,6 @@ def test_get_load_balancer_listener_value_error(self): with pytest.raises(ValueError): _service.get_load_balancer_listener(**req_copy) - def test_get_load_balancer_listener_value_error_with_retries(self): # Enable retries and run test_get_load_balancer_listener_value_error. _service.enable_retries() @@ -28964,7 +31749,6 @@ def test_update_load_balancer_listener_value_error(self): with pytest.raises(ValueError): _service.update_load_balancer_listener(**req_copy) - def test_update_load_balancer_listener_value_error_with_retries(self): # Enable retries and run test_update_load_balancer_listener_value_error. _service.enable_retries() @@ -29045,7 +31829,6 @@ def test_list_load_balancer_listener_policies_value_error(self): with pytest.raises(ValueError): _service.list_load_balancer_listener_policies(**req_copy) - def test_list_load_balancer_listener_policies_value_error_with_retries(self): # Enable retries and run test_list_load_balancer_listener_policies_value_error. _service.enable_retries() @@ -29172,7 +31955,6 @@ def test_create_load_balancer_listener_policy_value_error(self): with pytest.raises(ValueError): _service.create_load_balancer_listener_policy(**req_copy) - def test_create_load_balancer_listener_policy_value_error_with_retries(self): # Enable retries and run test_create_load_balancer_listener_policy_value_error. _service.enable_retries() @@ -29196,7 +31978,7 @@ def test_delete_load_balancer_listener_policy_all_params(self): url = preprocess_url('/load_balancers/testString/listeners/testString/policies/testString') responses.add(responses.DELETE, url, - status=204) + status=202) # Set up parameter values load_balancer_id = 'testString' @@ -29213,7 +31995,7 @@ def test_delete_load_balancer_listener_policy_all_params(self): # Check for correct operation assert len(responses.calls) == 1 - assert response.status_code == 204 + assert response.status_code == 202 def test_delete_load_balancer_listener_policy_all_params_with_retries(self): # Enable retries and run test_delete_load_balancer_listener_policy_all_params. @@ -29233,7 +32015,7 @@ def test_delete_load_balancer_listener_policy_value_error(self): url = preprocess_url('/load_balancers/testString/listeners/testString/policies/testString') responses.add(responses.DELETE, url, - status=204) + status=202) # Set up parameter values load_balancer_id = 'testString' @@ -29251,7 +32033,6 @@ def test_delete_load_balancer_listener_policy_value_error(self): with pytest.raises(ValueError): _service.delete_load_balancer_listener_policy(**req_copy) - def test_delete_load_balancer_listener_policy_value_error_with_retries(self): # Enable retries and run test_delete_load_balancer_listener_policy_value_error. _service.enable_retries() @@ -29336,7 +32117,6 @@ def test_get_load_balancer_listener_policy_value_error(self): with pytest.raises(ValueError): _service.get_load_balancer_listener_policy(**req_copy) - def test_get_load_balancer_listener_policy_value_error_with_retries(self): # Enable retries and run test_get_load_balancer_listener_policy_value_error. _service.enable_retries() @@ -29448,7 +32228,6 @@ def test_update_load_balancer_listener_policy_value_error(self): with pytest.raises(ValueError): _service.update_load_balancer_listener_policy(**req_copy) - def test_update_load_balancer_listener_policy_value_error_with_retries(self): # Enable retries and run test_update_load_balancer_listener_policy_value_error. _service.enable_retries() @@ -29533,7 +32312,6 @@ def test_list_load_balancer_listener_policy_rules_value_error(self): with pytest.raises(ValueError): _service.list_load_balancer_listener_policy_rules(**req_copy) - def test_list_load_balancer_listener_policy_rules_value_error_with_retries(self): # Enable retries and run test_list_load_balancer_listener_policy_rules_value_error. _service.enable_retries() @@ -29639,7 +32417,6 @@ def test_create_load_balancer_listener_policy_rule_value_error(self): with pytest.raises(ValueError): _service.create_load_balancer_listener_policy_rule(**req_copy) - def test_create_load_balancer_listener_policy_rule_value_error_with_retries(self): # Enable retries and run test_create_load_balancer_listener_policy_rule_value_error. _service.enable_retries() @@ -29663,7 +32440,7 @@ def test_delete_load_balancer_listener_policy_rule_all_params(self): url = preprocess_url('/load_balancers/testString/listeners/testString/policies/testString/rules/testString') responses.add(responses.DELETE, url, - status=204) + status=202) # Set up parameter values load_balancer_id = 'testString' @@ -29682,7 +32459,7 @@ def test_delete_load_balancer_listener_policy_rule_all_params(self): # Check for correct operation assert len(responses.calls) == 1 - assert response.status_code == 204 + assert response.status_code == 202 def test_delete_load_balancer_listener_policy_rule_all_params_with_retries(self): # Enable retries and run test_delete_load_balancer_listener_policy_rule_all_params. @@ -29702,7 +32479,7 @@ def test_delete_load_balancer_listener_policy_rule_value_error(self): url = preprocess_url('/load_balancers/testString/listeners/testString/policies/testString/rules/testString') responses.add(responses.DELETE, url, - status=204) + status=202) # Set up parameter values load_balancer_id = 'testString' @@ -29722,7 +32499,6 @@ def test_delete_load_balancer_listener_policy_rule_value_error(self): with pytest.raises(ValueError): _service.delete_load_balancer_listener_policy_rule(**req_copy) - def test_delete_load_balancer_listener_policy_rule_value_error_with_retries(self): # Enable retries and run test_delete_load_balancer_listener_policy_rule_value_error. _service.enable_retries() @@ -29811,7 +32587,6 @@ def test_get_load_balancer_listener_policy_rule_value_error(self): with pytest.raises(ValueError): _service.get_load_balancer_listener_policy_rule(**req_copy) - def test_get_load_balancer_listener_policy_rule_value_error_with_retries(self): # Enable retries and run test_get_load_balancer_listener_policy_rule_value_error. _service.enable_retries() @@ -29921,7 +32696,6 @@ def test_update_load_balancer_listener_policy_rule_value_error(self): with pytest.raises(ValueError): _service.update_load_balancer_listener_policy_rule(**req_copy) - def test_update_load_balancer_listener_policy_rule_value_error_with_retries(self): # Enable retries and run test_update_load_balancer_listener_policy_rule_value_error. _service.enable_retries() @@ -29998,7 +32772,6 @@ def test_list_load_balancer_pools_value_error(self): with pytest.raises(ValueError): _service.list_load_balancer_pools(**req_copy) - def test_list_load_balancer_pools_value_error_with_retries(self): # Enable retries and run test_list_load_balancer_pools_value_error. _service.enable_retries() @@ -30156,7 +32929,6 @@ def test_create_load_balancer_pool_value_error(self): with pytest.raises(ValueError): _service.create_load_balancer_pool(**req_copy) - def test_create_load_balancer_pool_value_error_with_retries(self): # Enable retries and run test_create_load_balancer_pool_value_error. _service.enable_retries() @@ -30180,7 +32952,7 @@ def test_delete_load_balancer_pool_all_params(self): url = preprocess_url('/load_balancers/testString/pools/testString') responses.add(responses.DELETE, url, - status=204) + status=202) # Set up parameter values load_balancer_id = 'testString' @@ -30195,7 +32967,7 @@ def test_delete_load_balancer_pool_all_params(self): # Check for correct operation assert len(responses.calls) == 1 - assert response.status_code == 204 + assert response.status_code == 202 def test_delete_load_balancer_pool_all_params_with_retries(self): # Enable retries and run test_delete_load_balancer_pool_all_params. @@ -30215,7 +32987,7 @@ def test_delete_load_balancer_pool_value_error(self): url = preprocess_url('/load_balancers/testString/pools/testString') responses.add(responses.DELETE, url, - status=204) + status=202) # Set up parameter values load_balancer_id = 'testString' @@ -30231,7 +33003,6 @@ def test_delete_load_balancer_pool_value_error(self): with pytest.raises(ValueError): _service.delete_load_balancer_pool(**req_copy) - def test_delete_load_balancer_pool_value_error_with_retries(self): # Enable retries and run test_delete_load_balancer_pool_value_error. _service.enable_retries() @@ -30312,7 +33083,6 @@ def test_get_load_balancer_pool_value_error(self): with pytest.raises(ValueError): _service.get_load_balancer_pool(**req_copy) - def test_get_load_balancer_pool_value_error_with_retries(self): # Enable retries and run test_get_load_balancer_pool_value_error. _service.enable_retries() @@ -30446,7 +33216,6 @@ def test_update_load_balancer_pool_value_error(self): with pytest.raises(ValueError): _service.update_load_balancer_pool(**req_copy) - def test_update_load_balancer_pool_value_error_with_retries(self): # Enable retries and run test_update_load_balancer_pool_value_error. _service.enable_retries() @@ -30527,7 +33296,6 @@ def test_list_load_balancer_pool_members_value_error(self): with pytest.raises(ValueError): _service.list_load_balancer_pool_members(**req_copy) - def test_list_load_balancer_pool_members_value_error_with_retries(self): # Enable retries and run test_list_load_balancer_pool_members_value_error. _service.enable_retries() @@ -30632,7 +33400,6 @@ def test_create_load_balancer_pool_member_value_error(self): with pytest.raises(ValueError): _service.create_load_balancer_pool_member(**req_copy) - def test_create_load_balancer_pool_member_value_error_with_retries(self): # Enable retries and run test_create_load_balancer_pool_member_value_error. _service.enable_retries() @@ -30740,7 +33507,6 @@ def test_replace_load_balancer_pool_members_value_error(self): with pytest.raises(ValueError): _service.replace_load_balancer_pool_members(**req_copy) - def test_replace_load_balancer_pool_members_value_error_with_retries(self): # Enable retries and run test_replace_load_balancer_pool_members_value_error. _service.enable_retries() @@ -30764,7 +33530,7 @@ def test_delete_load_balancer_pool_member_all_params(self): url = preprocess_url('/load_balancers/testString/pools/testString/members/testString') responses.add(responses.DELETE, url, - status=204) + status=202) # Set up parameter values load_balancer_id = 'testString' @@ -30781,7 +33547,7 @@ def test_delete_load_balancer_pool_member_all_params(self): # Check for correct operation assert len(responses.calls) == 1 - assert response.status_code == 204 + assert response.status_code == 202 def test_delete_load_balancer_pool_member_all_params_with_retries(self): # Enable retries and run test_delete_load_balancer_pool_member_all_params. @@ -30801,7 +33567,7 @@ def test_delete_load_balancer_pool_member_value_error(self): url = preprocess_url('/load_balancers/testString/pools/testString/members/testString') responses.add(responses.DELETE, url, - status=204) + status=202) # Set up parameter values load_balancer_id = 'testString' @@ -30819,7 +33585,6 @@ def test_delete_load_balancer_pool_member_value_error(self): with pytest.raises(ValueError): _service.delete_load_balancer_pool_member(**req_copy) - def test_delete_load_balancer_pool_member_value_error_with_retries(self): # Enable retries and run test_delete_load_balancer_pool_member_value_error. _service.enable_retries() @@ -30904,7 +33669,6 @@ def test_get_load_balancer_pool_member_value_error(self): with pytest.raises(ValueError): _service.get_load_balancer_pool_member(**req_copy) - def test_get_load_balancer_pool_member_value_error_with_retries(self): # Enable retries and run test_get_load_balancer_pool_member_value_error. _service.enable_retries() @@ -31016,7 +33780,6 @@ def test_update_load_balancer_pool_member_value_error(self): with pytest.raises(ValueError): _service.update_load_balancer_pool_member(**req_copy) - def test_update_load_balancer_pool_member_value_error_with_retries(self): # Enable retries and run test_update_load_balancer_pool_member_value_error. _service.enable_retries() @@ -31080,6 +33843,7 @@ def test_new_instance_required_param_none(self): service = VpcV1.new_instance( version=None, ) + class TestListEndpointGateways(): """ Test Class for list_endpoint_gateways @@ -31187,7 +33951,6 @@ def test_list_endpoint_gateways_value_error(self): with pytest.raises(ValueError): _service.list_endpoint_gateways(**req_copy) - def test_list_endpoint_gateways_value_error_with_retries(self): # Enable retries and run test_list_endpoint_gateways_value_error. _service.enable_retries() @@ -31197,6 +33960,71 @@ def test_list_endpoint_gateways_value_error_with_retries(self): _service.disable_retries() self.test_list_endpoint_gateways_value_error() + @responses.activate + def test_list_endpoint_gateways_with_pager_get_next(self): + """ + test_list_endpoint_gateways_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/endpoint_gateways') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"endpoint_gateways":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5","health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5","id":"d7cc5196-9864-48c4-82d8-3f30da41fcc5","ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/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"}],"lifecycle_state":"stable","name":"my-endpoint-gateway","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"endpoint_gateway","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/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"}],"service_endpoint":"my-cloudant-instance.appdomain.cloud","service_endpoints":["my-cloudant-instance.appdomain.cloud"],"target":{"crn":"crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::","resource_type":"provider_cloud_service"},"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","resource_type":"vpc"}}],"total_count":2,"limit":1}' + mock_response2 = '{"endpoint_gateways":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5","health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5","id":"d7cc5196-9864-48c4-82d8-3f30da41fcc5","ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/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"}],"lifecycle_state":"stable","name":"my-endpoint-gateway","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"endpoint_gateway","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/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"}],"service_endpoint":"my-cloudant-instance.appdomain.cloud","service_endpoints":["my-cloudant-instance.appdomain.cloud"],"target":{"crn":"crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::","resource_type":"provider_cloud_service"},"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","resource_type":"vpc"}}],"total_count":2,"limit":1}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + all_results = [] + pager = EndpointGatewaysPager( + client=_service, + name='testString', + limit=10, + resource_group_id='testString', + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 + + @responses.activate + def test_list_endpoint_gateways_with_pager_get_all(self): + """ + test_list_endpoint_gateways_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/endpoint_gateways') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"endpoint_gateways":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5","health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5","id":"d7cc5196-9864-48c4-82d8-3f30da41fcc5","ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/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"}],"lifecycle_state":"stable","name":"my-endpoint-gateway","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"endpoint_gateway","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/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"}],"service_endpoint":"my-cloudant-instance.appdomain.cloud","service_endpoints":["my-cloudant-instance.appdomain.cloud"],"target":{"crn":"crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::","resource_type":"provider_cloud_service"},"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","resource_type":"vpc"}}],"total_count":2,"limit":1}' + mock_response2 = '{"endpoint_gateways":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5","health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5","id":"d7cc5196-9864-48c4-82d8-3f30da41fcc5","ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/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"}],"lifecycle_state":"stable","name":"my-endpoint-gateway","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"endpoint_gateway","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/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"}],"service_endpoint":"my-cloudant-instance.appdomain.cloud","service_endpoints":["my-cloudant-instance.appdomain.cloud"],"target":{"crn":"crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::","resource_type":"provider_cloud_service"},"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","resource_type":"vpc"}}],"total_count":2,"limit":1}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + pager = EndpointGatewaysPager( + client=_service, + name='testString', + limit=10, + resource_group_id='testString', + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + class TestCreateEndpointGateway(): """ Test Class for create_endpoint_gateway @@ -31330,7 +34158,6 @@ def test_create_endpoint_gateway_value_error(self): with pytest.raises(ValueError): _service.create_endpoint_gateway(**req_copy) - def test_create_endpoint_gateway_value_error_with_retries(self): # Enable retries and run test_create_endpoint_gateway_value_error. _service.enable_retries() @@ -31455,7 +34282,6 @@ def test_list_endpoint_gateway_ips_value_error(self): with pytest.raises(ValueError): _service.list_endpoint_gateway_ips(**req_copy) - def test_list_endpoint_gateway_ips_value_error_with_retries(self): # Enable retries and run test_list_endpoint_gateway_ips_value_error. _service.enable_retries() @@ -31465,6 +34291,71 @@ def test_list_endpoint_gateway_ips_value_error_with_retries(self): _service.disable_retries() self.test_list_endpoint_gateway_ips_value_error() + @responses.activate + def test_list_endpoint_gateway_ips_with_pager_get_next(self): + """ + test_list_endpoint_gateway_ips_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/endpoint_gateways/testString/ips') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"ips":[{"address":"192.168.3.4","auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/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"}}]}' + mock_response2 = '{"total_count":2,"limit":1,"ips":[{"address":"192.168.3.4","auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/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_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + all_results = [] + pager = EndpointGatewayIpsPager( + client=_service, + endpoint_gateway_id='testString', + limit=10, + sort='name', + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 + + @responses.activate + def test_list_endpoint_gateway_ips_with_pager_get_all(self): + """ + test_list_endpoint_gateway_ips_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/endpoint_gateways/testString/ips') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"ips":[{"address":"192.168.3.4","auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/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"}}]}' + mock_response2 = '{"total_count":2,"limit":1,"ips":[{"address":"192.168.3.4","auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/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_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + pager = EndpointGatewayIpsPager( + client=_service, + endpoint_gateway_id='testString', + limit=10, + sort='name', + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + class TestRemoveEndpointGatewayIp(): """ Test Class for remove_endpoint_gateway_ip @@ -31530,7 +34421,6 @@ def test_remove_endpoint_gateway_ip_value_error(self): with pytest.raises(ValueError): _service.remove_endpoint_gateway_ip(**req_copy) - def test_remove_endpoint_gateway_ip_value_error_with_retries(self): # Enable retries and run test_remove_endpoint_gateway_ip_value_error. _service.enable_retries() @@ -31611,7 +34501,6 @@ def test_get_endpoint_gateway_ip_value_error(self): with pytest.raises(ValueError): _service.get_endpoint_gateway_ip(**req_copy) - def test_get_endpoint_gateway_ip_value_error_with_retries(self): # Enable retries and run test_get_endpoint_gateway_ip_value_error. _service.enable_retries() @@ -31692,7 +34581,6 @@ def test_add_endpoint_gateway_ip_value_error(self): with pytest.raises(ValueError): _service.add_endpoint_gateway_ip(**req_copy) - def test_add_endpoint_gateway_ip_value_error_with_retries(self): # Enable retries and run test_add_endpoint_gateway_ip_value_error. _service.enable_retries() @@ -31763,7 +34651,6 @@ def test_delete_endpoint_gateway_value_error(self): with pytest.raises(ValueError): _service.delete_endpoint_gateway(**req_copy) - def test_delete_endpoint_gateway_value_error_with_retries(self): # Enable retries and run test_delete_endpoint_gateway_value_error. _service.enable_retries() @@ -31840,7 +34727,6 @@ def test_get_endpoint_gateway_value_error(self): with pytest.raises(ValueError): _service.get_endpoint_gateway(**req_copy) - def test_get_endpoint_gateway_value_error_with_retries(self): # Enable retries and run test_get_endpoint_gateway_value_error. _service.enable_retries() @@ -31932,7 +34818,6 @@ def test_update_endpoint_gateway_value_error(self): with pytest.raises(ValueError): _service.update_endpoint_gateway(**req_copy) - def test_update_endpoint_gateway_value_error_with_retries(self): # Enable retries and run test_update_endpoint_gateway_value_error. _service.enable_retries() @@ -31989,6 +34874,7 @@ def test_new_instance_required_param_none(self): service = VpcV1.new_instance( version=None, ) + class TestListFlowLogCollectors(): """ Test Class for list_flow_log_collectors @@ -32111,7 +34997,6 @@ def test_list_flow_log_collectors_value_error(self): with pytest.raises(ValueError): _service.list_flow_log_collectors(**req_copy) - def test_list_flow_log_collectors_value_error_with_retries(self): # Enable retries and run test_list_flow_log_collectors_value_error. _service.enable_retries() @@ -32121,6 +35006,81 @@ def test_list_flow_log_collectors_value_error_with_retries(self): _service.disable_retries() self.test_list_flow_log_collectors_value_error() + @responses.activate + def test_list_flow_log_collectors_with_pager_get_next(self): + """ + test_list_flow_log_collectors_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/flow_log_collectors') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"flow_log_collectors":[{"active":true,"auto_delete":true,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689","href":"https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","lifecycle_state":"stable","name":"my-flow-log-collector","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"storage_bucket":{"name":"bucket-27200-lwx4cfvcue"},"target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/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","resource_type":"vpc"}}]}' + mock_response2 = '{"total_count":2,"limit":1,"flow_log_collectors":[{"active":true,"auto_delete":true,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689","href":"https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","lifecycle_state":"stable","name":"my-flow-log-collector","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"storage_bucket":{"name":"bucket-27200-lwx4cfvcue"},"target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/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","resource_type":"vpc"}}]}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + all_results = [] + pager = FlowLogCollectorsPager( + client=_service, + limit=10, + resource_group_id='testString', + name='testString', + vpc_id='testString', + vpc_crn='testString', + vpc_name='testString', + target_id='testString', + target_resource_type='instance', + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 + + @responses.activate + def test_list_flow_log_collectors_with_pager_get_all(self): + """ + test_list_flow_log_collectors_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/flow_log_collectors') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"flow_log_collectors":[{"active":true,"auto_delete":true,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689","href":"https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","lifecycle_state":"stable","name":"my-flow-log-collector","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"storage_bucket":{"name":"bucket-27200-lwx4cfvcue"},"target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/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","resource_type":"vpc"}}]}' + mock_response2 = '{"total_count":2,"limit":1,"flow_log_collectors":[{"active":true,"auto_delete":true,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689","href":"https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","lifecycle_state":"stable","name":"my-flow-log-collector","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"storage_bucket":{"name":"bucket-27200-lwx4cfvcue"},"target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/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","resource_type":"vpc"}}]}' + responses.add(responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200) + responses.add(responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200) + + # Exercise the pager class for this operation + pager = FlowLogCollectorsPager( + client=_service, + limit=10, + resource_group_id='testString', + name='testString', + vpc_id='testString', + vpc_crn='testString', + vpc_name='testString', + target_id='testString', + target_resource_type='instance', + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + class TestCreateFlowLogCollector(): """ Test Class for create_flow_log_collector @@ -32232,7 +35192,6 @@ def test_create_flow_log_collector_value_error(self): with pytest.raises(ValueError): _service.create_flow_log_collector(**req_copy) - def test_create_flow_log_collector_value_error_with_retries(self): # Enable retries and run test_create_flow_log_collector_value_error. _service.enable_retries() @@ -32303,7 +35262,6 @@ def test_delete_flow_log_collector_value_error(self): with pytest.raises(ValueError): _service.delete_flow_log_collector(**req_copy) - def test_delete_flow_log_collector_value_error_with_retries(self): # Enable retries and run test_delete_flow_log_collector_value_error. _service.enable_retries() @@ -32380,7 +35338,6 @@ def test_get_flow_log_collector_value_error(self): with pytest.raises(ValueError): _service.get_flow_log_collector(**req_copy) - def test_get_flow_log_collector_value_error_with_retries(self): # Enable retries and run test_get_flow_log_collector_value_error. _service.enable_retries() @@ -32474,7 +35431,6 @@ def test_update_flow_log_collector_value_error(self): with pytest.raises(ValueError): _service.update_flow_log_collector(**req_copy) - def test_update_flow_log_collector_value_error_with_retries(self): # Enable retries and run test_update_flow_log_collector_value_error. _service.enable_retries() @@ -33256,7 +36212,7 @@ def test_bare_metal_server_serialization(self): bare_metal_server_disk_model['created_at'] = '2019-01-01T12:00:00Z' bare_metal_server_disk_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e' bare_metal_server_disk_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' - bare_metal_server_disk_model['interface_type'] = 'nvme' + bare_metal_server_disk_model['interface_type'] = 'fcp' bare_metal_server_disk_model['name'] = 'my-bare-metal-disk' bare_metal_server_disk_model['resource_type'] = 'bare_metal_server_disk' bare_metal_server_disk_model['size'] = 100 @@ -33432,7 +36388,7 @@ def test_bare_metal_server_collection_serialization(self): bare_metal_server_disk_model['created_at'] = '2019-01-01T12:00:00Z' bare_metal_server_disk_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e' bare_metal_server_disk_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' - bare_metal_server_disk_model['interface_type'] = 'nvme' + bare_metal_server_disk_model['interface_type'] = 'fcp' bare_metal_server_disk_model['name'] = 'my-bare-metal-disk' bare_metal_server_disk_model['resource_type'] = 'bare_metal_server_disk' bare_metal_server_disk_model['size'] = 100 @@ -33664,7 +36620,7 @@ def test_bare_metal_server_disk_serialization(self): bare_metal_server_disk_model_json['created_at'] = '2019-01-01T12:00:00Z' bare_metal_server_disk_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e' bare_metal_server_disk_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' - bare_metal_server_disk_model_json['interface_type'] = 'nvme' + bare_metal_server_disk_model_json['interface_type'] = 'fcp' bare_metal_server_disk_model_json['name'] = 'my-bare-metal-disk' bare_metal_server_disk_model_json['resource_type'] = 'bare_metal_server_disk' bare_metal_server_disk_model_json['size'] = 100 @@ -33700,7 +36656,7 @@ def test_bare_metal_server_disk_collection_serialization(self): bare_metal_server_disk_model['created_at'] = '2019-01-01T12:00:00Z' bare_metal_server_disk_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e' bare_metal_server_disk_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' - bare_metal_server_disk_model['interface_type'] = 'nvme' + bare_metal_server_disk_model['interface_type'] = 'fcp' bare_metal_server_disk_model['name'] = 'my-bare-metal-disk' bare_metal_server_disk_model['resource_type'] = 'bare_metal_server_disk' bare_metal_server_disk_model['size'] = 100 @@ -33939,7 +36895,7 @@ def test_bare_metal_server_network_interface_collection_serialization(self): subnet_reference_model['name'] = 'my-subnet' subnet_reference_model['resource_type'] = 'subnet' - bare_metal_server_network_interface_model = {} # BareMetalServerNetworkInterfaceByPCI + bare_metal_server_network_interface_model = {} # BareMetalServerNetworkInterfaceByHiperSocket bare_metal_server_network_interface_model['allow_ip_spoofing'] = True bare_metal_server_network_interface_model['created_at'] = '2019-01-01T12:00:00Z' bare_metal_server_network_interface_model['enable_infrastructure_nat'] = True @@ -33955,8 +36911,7 @@ def test_bare_metal_server_network_interface_collection_serialization(self): bare_metal_server_network_interface_model['status'] = 'available' bare_metal_server_network_interface_model['subnet'] = subnet_reference_model bare_metal_server_network_interface_model['type'] = 'primary' - bare_metal_server_network_interface_model['allowed_vlans'] = [4] - bare_metal_server_network_interface_model['interface_type'] = 'pci' + bare_metal_server_network_interface_model['interface_type'] = 'hipersocket' bare_metal_server_network_interface_collection_next_model = {} # BareMetalServerNetworkInterfaceCollectionNext bare_metal_server_network_interface_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20' @@ -34190,9 +37145,9 @@ def test_bare_metal_server_profile_serialization(self): bare_metal_server_profile_disk_size_model['value'] = 100 bare_metal_server_profile_disk_supported_interfaces_model = {} # BareMetalServerProfileDiskSupportedInterfaces - bare_metal_server_profile_disk_supported_interfaces_model['default'] = 'nvme' + bare_metal_server_profile_disk_supported_interfaces_model['default'] = 'fcp' bare_metal_server_profile_disk_supported_interfaces_model['type'] = 'enum' - bare_metal_server_profile_disk_supported_interfaces_model['values'] = ['nvme'] + bare_metal_server_profile_disk_supported_interfaces_model['values'] = ['fcp'] bare_metal_server_profile_disk_model = {} # BareMetalServerProfileDisk bare_metal_server_profile_disk_model['quantity'] = bare_metal_server_profile_disk_quantity_model @@ -34317,9 +37272,9 @@ def test_bare_metal_server_profile_collection_serialization(self): bare_metal_server_profile_disk_size_model['value'] = 100 bare_metal_server_profile_disk_supported_interfaces_model = {} # BareMetalServerProfileDiskSupportedInterfaces - bare_metal_server_profile_disk_supported_interfaces_model['default'] = 'nvme' + bare_metal_server_profile_disk_supported_interfaces_model['default'] = 'fcp' bare_metal_server_profile_disk_supported_interfaces_model['type'] = 'enum' - bare_metal_server_profile_disk_supported_interfaces_model['values'] = ['nvme'] + bare_metal_server_profile_disk_supported_interfaces_model['values'] = ['fcp'] bare_metal_server_profile_disk_model = {} # BareMetalServerProfileDisk bare_metal_server_profile_disk_model['quantity'] = bare_metal_server_profile_disk_quantity_model @@ -34455,9 +37410,9 @@ def test_bare_metal_server_profile_disk_serialization(self): bare_metal_server_profile_disk_size_model['value'] = 100 bare_metal_server_profile_disk_supported_interfaces_model = {} # BareMetalServerProfileDiskSupportedInterfaces - bare_metal_server_profile_disk_supported_interfaces_model['default'] = 'nvme' + bare_metal_server_profile_disk_supported_interfaces_model['default'] = 'fcp' bare_metal_server_profile_disk_supported_interfaces_model['type'] = 'enum' - bare_metal_server_profile_disk_supported_interfaces_model['values'] = ['nvme'] + bare_metal_server_profile_disk_supported_interfaces_model['values'] = ['fcp'] # Construct a json representation of a BareMetalServerProfileDisk model bare_metal_server_profile_disk_model_json = {} @@ -34492,9 +37447,9 @@ def test_bare_metal_server_profile_disk_supported_interfaces_serialization(self) # Construct a json representation of a BareMetalServerProfileDiskSupportedInterfaces model bare_metal_server_profile_disk_supported_interfaces_model_json = {} - bare_metal_server_profile_disk_supported_interfaces_model_json['default'] = 'nvme' + bare_metal_server_profile_disk_supported_interfaces_model_json['default'] = 'fcp' bare_metal_server_profile_disk_supported_interfaces_model_json['type'] = 'enum' - bare_metal_server_profile_disk_supported_interfaces_model_json['values'] = ['nvme'] + bare_metal_server_profile_disk_supported_interfaces_model_json['values'] = ['fcp'] # Construct a model instance of BareMetalServerProfileDiskSupportedInterfaces by calling from_dict on the json representation bare_metal_server_profile_disk_supported_interfaces_model = BareMetalServerProfileDiskSupportedInterfaces.from_dict(bare_metal_server_profile_disk_supported_interfaces_model_json) @@ -34664,6 +37619,35 @@ def test_bare_metal_server_trusted_platform_module_serialization(self): bare_metal_server_trusted_platform_module_model_json2 = bare_metal_server_trusted_platform_module_model.to_dict() assert bare_metal_server_trusted_platform_module_model_json2 == bare_metal_server_trusted_platform_module_model_json +class TestModel_CatalogOfferingVersionReference(): + """ + Test Class for CatalogOfferingVersionReference + """ + + def test_catalog_offering_version_reference_serialization(self): + """ + Test serialization/deserialization for CatalogOfferingVersionReference + """ + + # Construct a json representation of a CatalogOfferingVersionReference model + catalog_offering_version_reference_model_json = {} + catalog_offering_version_reference_model_json['crn'] = 'crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d' + + # Construct a model instance of CatalogOfferingVersionReference by calling from_dict on the json representation + catalog_offering_version_reference_model = CatalogOfferingVersionReference.from_dict(catalog_offering_version_reference_model_json) + assert catalog_offering_version_reference_model != False + + # Construct a model instance of CatalogOfferingVersionReference by calling from_dict on the json representation + catalog_offering_version_reference_model_dict = CatalogOfferingVersionReference.from_dict(catalog_offering_version_reference_model_json).__dict__ + catalog_offering_version_reference_model2 = CatalogOfferingVersionReference(**catalog_offering_version_reference_model_dict) + + # Verify the model instances are equivalent + assert catalog_offering_version_reference_model == catalog_offering_version_reference_model2 + + # Convert model instance back to dict and verify no loss of data + catalog_offering_version_reference_model_json2 = catalog_offering_version_reference_model.to_dict() + assert catalog_offering_version_reference_model_json2 == catalog_offering_version_reference_model_json + class TestModel_CertificateInstanceReference(): """ Test Class for CertificateInstanceReference @@ -36060,7 +39044,7 @@ def test_default_network_acl_serialization(self): network_acl_rule_reference_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' network_acl_rule_reference_model['name'] = 'my-rule-1' - network_acl_rule_item_model = {} # NetworkACLRuleItemNetworkACLRuleProtocolICMP + network_acl_rule_item_model = {} # NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP network_acl_rule_item_model['action'] = 'allow' network_acl_rule_item_model['before'] = network_acl_rule_reference_model network_acl_rule_item_model['created_at'] = '2019-01-01T12:00:00Z' @@ -36069,11 +39053,13 @@ def test_default_network_acl_serialization(self): network_acl_rule_item_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9' network_acl_rule_item_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' network_acl_rule_item_model['ip_version'] = 'ipv4' - network_acl_rule_item_model['name'] = 'my-rule-2' + network_acl_rule_item_model['name'] = 'my-rule-1' network_acl_rule_item_model['source'] = '192.168.3.0/24' - network_acl_rule_item_model['code'] = 0 - network_acl_rule_item_model['protocol'] = 'icmp' - network_acl_rule_item_model['type'] = 8 + network_acl_rule_item_model['destination_port_max'] = 22 + network_acl_rule_item_model['destination_port_min'] = 22 + network_acl_rule_item_model['protocol'] = 'udp' + network_acl_rule_item_model['source_port_max'] = 65535 + network_acl_rule_item_model['source_port_min'] = 49152 subnet_reference_deleted_model = {} # SubnetReferenceDeleted subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' @@ -36103,7 +39089,7 @@ def test_default_network_acl_serialization(self): default_network_acl_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf' default_network_acl_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf' default_network_acl_model_json['id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf' - default_network_acl_model_json['name'] = 'mnemonic-ersatz-eatery-malaise' + default_network_acl_model_json['name'] = 'mnemonic-ersatz-eatery-mythology' default_network_acl_model_json['resource_group'] = resource_group_reference_model default_network_acl_model_json['rules'] = [network_acl_rule_item_model] default_network_acl_model_json['subnets'] = [subnet_reference_model] @@ -36170,6 +39156,7 @@ def test_default_routing_table_serialization(self): default_routing_table_model_json['name'] = 'milled-easy-equine-machines' default_routing_table_model_json['resource_type'] = 'routing_table' default_routing_table_model_json['route_direct_link_ingress'] = True + default_routing_table_model_json['route_internet_ingress'] = True default_routing_table_model_json['route_transit_gateway_ingress'] = True default_routing_table_model_json['route_vpc_zone_ingress'] = True default_routing_table_model_json['routes'] = [route_reference_model] @@ -37604,7 +40591,7 @@ def test_i_psec_policy_serialization(self): # Construct a json representation of a IPsecPolicy model i_psec_policy_model_json = {} - i_psec_policy_model_json['authentication_algorithm'] = 'md5' + i_psec_policy_model_json['authentication_algorithm'] = 'disabled' i_psec_policy_model_json['connections'] = [vpn_gateway_connection_reference_model] i_psec_policy_model_json['created_at'] = '2019-01-01T12:00:00Z' i_psec_policy_model_json['encapsulation_mode'] = 'tunnel' @@ -37664,7 +40651,7 @@ def test_i_psec_policy_collection_serialization(self): resource_group_reference_model['name'] = 'my-resource-group' i_psec_policy_model = {} # IPsecPolicy - i_psec_policy_model['authentication_algorithm'] = 'md5' + i_psec_policy_model['authentication_algorithm'] = 'disabled' i_psec_policy_model['connections'] = [vpn_gateway_connection_reference_model] i_psec_policy_model['created_at'] = '2019-01-01T12:00:00Z' i_psec_policy_model['encapsulation_mode'] = 'tunnel' @@ -37774,7 +40761,7 @@ def test_i_psec_policy_patch_serialization(self): # Construct a json representation of a IPsecPolicyPatch model i_psec_policy_patch_model_json = {} - i_psec_policy_patch_model_json['authentication_algorithm'] = 'md5' + i_psec_policy_patch_model_json['authentication_algorithm'] = 'disabled' i_psec_policy_patch_model_json['encryption_algorithm'] = 'aes128' i_psec_policy_patch_model_json['key_lifetime'] = 3600 i_psec_policy_patch_model_json['name'] = 'my-ipsec-policy' @@ -37874,6 +40861,13 @@ def test_image_serialization(self): # Construct dict forms of any model objects needed in order to build this model. + catalog_offering_version_reference_model = {} # CatalogOfferingVersionReference + catalog_offering_version_reference_model['crn'] = 'crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d' + + image_catalog_offering_model = {} # ImageCatalogOffering + image_catalog_offering_model['managed'] = True + image_catalog_offering_model['version'] = catalog_offering_version_reference_model + encryption_key_reference_model = {} # EncryptionKeyReference encryption_key_reference_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' @@ -37916,6 +40910,7 @@ def test_image_serialization(self): # Construct a json representation of a Image model image_model_json = {} + image_model_json['catalog_offering'] = image_catalog_offering_model image_model_json['created_at'] = '2019-01-01T12:00:00Z' image_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' image_model_json['encryption'] = 'user_managed' @@ -37947,6 +40942,41 @@ def test_image_serialization(self): image_model_json2 = image_model.to_dict() assert image_model_json2 == image_model_json +class TestModel_ImageCatalogOffering(): + """ + Test Class for ImageCatalogOffering + """ + + def test_image_catalog_offering_serialization(self): + """ + Test serialization/deserialization for ImageCatalogOffering + """ + + # Construct dict forms of any model objects needed in order to build this model. + + catalog_offering_version_reference_model = {} # CatalogOfferingVersionReference + catalog_offering_version_reference_model['crn'] = 'crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d' + + # Construct a json representation of a ImageCatalogOffering model + image_catalog_offering_model_json = {} + image_catalog_offering_model_json['managed'] = True + image_catalog_offering_model_json['version'] = catalog_offering_version_reference_model + + # Construct a model instance of ImageCatalogOffering by calling from_dict on the json representation + image_catalog_offering_model = ImageCatalogOffering.from_dict(image_catalog_offering_model_json) + assert image_catalog_offering_model != False + + # Construct a model instance of ImageCatalogOffering by calling from_dict on the json representation + image_catalog_offering_model_dict = ImageCatalogOffering.from_dict(image_catalog_offering_model_json).__dict__ + image_catalog_offering_model2 = ImageCatalogOffering(**image_catalog_offering_model_dict) + + # Verify the model instances are equivalent + assert image_catalog_offering_model == image_catalog_offering_model2 + + # Convert model instance back to dict and verify no loss of data + image_catalog_offering_model_json2 = image_catalog_offering_model.to_dict() + assert image_catalog_offering_model_json2 == image_catalog_offering_model_json + class TestModel_ImageCollection(): """ Test Class for ImageCollection @@ -37962,6 +40992,13 @@ def test_image_collection_serialization(self): image_collection_first_model = {} # ImageCollectionFirst image_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images?limit=20' + catalog_offering_version_reference_model = {} # CatalogOfferingVersionReference + catalog_offering_version_reference_model['crn'] = 'crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d' + + image_catalog_offering_model = {} # ImageCatalogOffering + image_catalog_offering_model['managed'] = True + image_catalog_offering_model['version'] = catalog_offering_version_reference_model + encryption_key_reference_model = {} # EncryptionKeyReference encryption_key_reference_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' @@ -38003,6 +41040,7 @@ def test_image_collection_serialization(self): image_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys' image_model = {} # Image + image_model['catalog_offering'] = image_catalog_offering_model image_model['created_at'] = '2019-01-01T12:00:00Z' image_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' image_model['encryption'] = 'user_managed' @@ -38361,6 +41399,12 @@ def test_instance_serialization(self): volume_attachment_reference_instance_context_model['name'] = 'my-boot-volume-attachment' volume_attachment_reference_instance_context_model['volume'] = volume_reference_model + catalog_offering_version_reference_model = {} # CatalogOfferingVersionReference + catalog_offering_version_reference_model['crn'] = 'crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d' + + instance_catalog_offering_model = {} # InstanceCatalogOffering + instance_catalog_offering_model['version'] = catalog_offering_version_reference_model + dedicated_host_reference_deleted_model = {} # DedicatedHostReferenceDeleted dedicated_host_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' @@ -38397,6 +41441,11 @@ def test_instance_serialization(self): image_reference_model['id'] = '9aaf3bcb-dcd7-4de7-bb60-24e39ff9d366' image_reference_model['name'] = 'my-image' + lifecycle_reason_model = {} # LifecycleReason + lifecycle_reason_model['code'] = 'resource_suspended_by_provider' + lifecycle_reason_model['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.' + lifecycle_reason_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension' + instance_metadata_service_model = {} # InstanceMetadataService instance_metadata_service_model['enabled'] = True @@ -38483,6 +41532,7 @@ def test_instance_serialization(self): 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['catalog_offering'] = instance_catalog_offering_model instance_model_json['created_at'] = '2019-01-01T12:00:00Z' instance_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a' instance_model_json['dedicated_host'] = dedicated_host_reference_model @@ -38491,6 +41541,8 @@ def test_instance_serialization(self): instance_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a' instance_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' instance_model_json['image'] = image_reference_model + instance_model_json['lifecycle_reasons'] = [lifecycle_reason_model] + instance_model_json['lifecycle_state'] = 'stable' instance_model_json['memory'] = 8 instance_model_json['metadata_service'] = instance_metadata_service_model instance_model_json['name'] = 'my-instance' @@ -38648,6 +41700,40 @@ def test_instance_availability_prototype_serialization(self): instance_availability_prototype_model_json2 = instance_availability_prototype_model.to_dict() assert instance_availability_prototype_model_json2 == instance_availability_prototype_model_json +class TestModel_InstanceCatalogOffering(): + """ + Test Class for InstanceCatalogOffering + """ + + def test_instance_catalog_offering_serialization(self): + """ + Test serialization/deserialization for InstanceCatalogOffering + """ + + # Construct dict forms of any model objects needed in order to build this model. + + catalog_offering_version_reference_model = {} # CatalogOfferingVersionReference + catalog_offering_version_reference_model['crn'] = 'crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d' + + # Construct a json representation of a InstanceCatalogOffering model + instance_catalog_offering_model_json = {} + instance_catalog_offering_model_json['version'] = catalog_offering_version_reference_model + + # Construct a model instance of InstanceCatalogOffering by calling from_dict on the json representation + instance_catalog_offering_model = InstanceCatalogOffering.from_dict(instance_catalog_offering_model_json) + assert instance_catalog_offering_model != False + + # Construct a model instance of InstanceCatalogOffering by calling from_dict on the json representation + instance_catalog_offering_model_dict = InstanceCatalogOffering.from_dict(instance_catalog_offering_model_json).__dict__ + instance_catalog_offering_model2 = InstanceCatalogOffering(**instance_catalog_offering_model_dict) + + # Verify the model instances are equivalent + assert instance_catalog_offering_model == instance_catalog_offering_model2 + + # Convert model instance back to dict and verify no loss of data + instance_catalog_offering_model_json2 = instance_catalog_offering_model.to_dict() + assert instance_catalog_offering_model_json2 == instance_catalog_offering_model_json + class TestModel_InstanceCollection(): """ Test Class for InstanceCollection @@ -38690,6 +41776,12 @@ def test_instance_collection_serialization(self): volume_attachment_reference_instance_context_model['name'] = 'my-volume-attachment' volume_attachment_reference_instance_context_model['volume'] = volume_reference_model + catalog_offering_version_reference_model = {} # CatalogOfferingVersionReference + catalog_offering_version_reference_model['crn'] = 'crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d' + + instance_catalog_offering_model = {} # InstanceCatalogOffering + instance_catalog_offering_model['version'] = catalog_offering_version_reference_model + dedicated_host_reference_deleted_model = {} # DedicatedHostReferenceDeleted dedicated_host_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' @@ -38726,6 +41818,11 @@ def test_instance_collection_serialization(self): image_reference_model['id'] = '72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' image_reference_model['name'] = 'my-image' + lifecycle_reason_model = {} # LifecycleReason + lifecycle_reason_model['code'] = 'resource_suspended_by_provider' + lifecycle_reason_model['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.' + lifecycle_reason_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension' + instance_metadata_service_model = {} # InstanceMetadataService instance_metadata_service_model['enabled'] = True @@ -38811,6 +41908,7 @@ def test_instance_collection_serialization(self): 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['catalog_offering'] = instance_catalog_offering_model instance_model['created_at'] = '2019-01-01T12:00:00Z' instance_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a' instance_model['dedicated_host'] = dedicated_host_reference_model @@ -38819,6 +41917,8 @@ def test_instance_collection_serialization(self): instance_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a' instance_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a' instance_model['image'] = image_reference_model + instance_model['lifecycle_reasons'] = [lifecycle_reason_model] + instance_model['lifecycle_state'] = 'stable' instance_model['memory'] = 8 instance_model['metadata_service'] = instance_metadata_service_model instance_model['name'] = 'my-instance' @@ -41490,6 +44590,7 @@ def test_instance_template_collection_serialization(self): 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_prototype_instance_by_image_context_model['user_tags'] = ['testString'] volume_attachment_prototype_instance_by_image_context_model = {} # VolumeAttachmentPrototypeInstanceByImageContext volume_attachment_prototype_instance_by_image_context_model['delete_volume_on_instance_delete'] = True @@ -42019,6 +45120,37 @@ def test_legacy_cloud_object_storage_bucket_reference_serialization(self): 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_LifecycleReason(): + """ + Test Class for LifecycleReason + """ + + def test_lifecycle_reason_serialization(self): + """ + Test serialization/deserialization for LifecycleReason + """ + + # Construct a json representation of a LifecycleReason model + lifecycle_reason_model_json = {} + lifecycle_reason_model_json['code'] = 'resource_suspended_by_provider' + lifecycle_reason_model_json['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.' + lifecycle_reason_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension' + + # Construct a model instance of LifecycleReason by calling from_dict on the json representation + lifecycle_reason_model = LifecycleReason.from_dict(lifecycle_reason_model_json) + assert lifecycle_reason_model != False + + # Construct a model instance of LifecycleReason by calling from_dict on the json representation + lifecycle_reason_model_dict = LifecycleReason.from_dict(lifecycle_reason_model_json).__dict__ + lifecycle_reason_model2 = LifecycleReason(**lifecycle_reason_model_dict) + + # Verify the model instances are equivalent + assert lifecycle_reason_model == lifecycle_reason_model2 + + # Convert model instance back to dict and verify no loss of data + lifecycle_reason_model_json2 = lifecycle_reason_model.to_dict() + assert lifecycle_reason_model_json2 == lifecycle_reason_model_json + class TestModel_LoadBalancer(): """ Test Class for LoadBalancer @@ -43131,14 +46263,27 @@ def test_load_balancer_listener_prototype_load_balancer_context_serialization(se # 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:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5' + load_balancer_pool_identity_by_name_model = {} # LoadBalancerPoolIdentityByName load_balancer_pool_identity_by_name_model['name'] = 'my-load-balancer-pool' + load_balancer_listener_identity_model = {} # LoadBalancerListenerIdentityById + load_balancer_listener_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + + load_balancer_listener_https_redirect_prototype_model = {} # LoadBalancerListenerHTTPSRedirectPrototype + load_balancer_listener_https_redirect_prototype_model['http_status_code'] = 301 + load_balancer_listener_https_redirect_prototype_model['listener'] = load_balancer_listener_identity_model + load_balancer_listener_https_redirect_prototype_model['uri'] = '/example?doc=get' + # Construct a json representation of a LoadBalancerListenerPrototypeLoadBalancerContext model load_balancer_listener_prototype_load_balancer_context_model_json = {} load_balancer_listener_prototype_load_balancer_context_model_json['accept_proxy_protocol'] = True + load_balancer_listener_prototype_load_balancer_context_model_json['certificate_instance'] = certificate_instance_identity_model load_balancer_listener_prototype_load_balancer_context_model_json['connection_limit'] = 2000 load_balancer_listener_prototype_load_balancer_context_model_json['default_pool'] = load_balancer_pool_identity_by_name_model + load_balancer_listener_prototype_load_balancer_context_model_json['https_redirect'] = load_balancer_listener_https_redirect_prototype_model load_balancer_listener_prototype_load_balancer_context_model_json['port'] = 443 load_balancer_listener_prototype_load_balancer_context_model_json['port_max'] = 499 load_balancer_listener_prototype_load_balancer_context_model_json['port_min'] = 443 @@ -43305,10 +46450,14 @@ def test_load_balancer_patch_serialization(self): load_balancer_logging_model = {} # LoadBalancerLogging load_balancer_logging_model['datapath'] = load_balancer_logging_datapath_model + subnet_identity_model = {} # SubnetIdentityById + subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + # Construct a json representation of a LoadBalancerPatch model load_balancer_patch_model_json = {} load_balancer_patch_model_json['logging'] = load_balancer_logging_model load_balancer_patch_model_json['name'] = 'my-load-balancer' + load_balancer_patch_model_json['subnets'] = [subnet_identity_model] # Construct a model instance of LoadBalancerPatch by calling from_dict on the json representation load_balancer_patch_model = LoadBalancerPatch.from_dict(load_balancer_patch_model_json) @@ -44464,7 +47613,7 @@ def test_network_acl_serialization(self): network_acl_rule_reference_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' network_acl_rule_reference_model['name'] = 'my-rule-1' - network_acl_rule_item_model = {} # NetworkACLRuleItemNetworkACLRuleProtocolICMP + network_acl_rule_item_model = {} # NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP network_acl_rule_item_model['action'] = 'allow' network_acl_rule_item_model['before'] = network_acl_rule_reference_model network_acl_rule_item_model['created_at'] = '2019-01-01T12:00:00Z' @@ -44473,11 +47622,13 @@ def test_network_acl_serialization(self): network_acl_rule_item_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9' network_acl_rule_item_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' network_acl_rule_item_model['ip_version'] = 'ipv4' - network_acl_rule_item_model['name'] = 'my-rule-2' + network_acl_rule_item_model['name'] = 'my-rule-1' network_acl_rule_item_model['source'] = '192.168.3.0/24' - network_acl_rule_item_model['code'] = 0 - network_acl_rule_item_model['protocol'] = 'icmp' - network_acl_rule_item_model['type'] = 8 + network_acl_rule_item_model['destination_port_max'] = 22 + network_acl_rule_item_model['destination_port_min'] = 22 + network_acl_rule_item_model['protocol'] = 'udp' + network_acl_rule_item_model['source_port_max'] = 65535 + network_acl_rule_item_model['source_port_min'] = 49152 subnet_reference_deleted_model = {} # SubnetReferenceDeleted subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' @@ -44557,7 +47708,7 @@ def test_network_acl_collection_serialization(self): network_acl_rule_reference_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' network_acl_rule_reference_model['name'] = 'my-rule-1' - network_acl_rule_item_model = {} # NetworkACLRuleItemNetworkACLRuleProtocolICMP + network_acl_rule_item_model = {} # NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP network_acl_rule_item_model['action'] = 'allow' network_acl_rule_item_model['before'] = network_acl_rule_reference_model network_acl_rule_item_model['created_at'] = '2019-01-01T12:00:00Z' @@ -44566,11 +47717,13 @@ def test_network_acl_collection_serialization(self): network_acl_rule_item_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9' network_acl_rule_item_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' network_acl_rule_item_model['ip_version'] = 'ipv4' - network_acl_rule_item_model['name'] = 'my-rule-2' + network_acl_rule_item_model['name'] = 'my-rule-1' network_acl_rule_item_model['source'] = '192.168.3.0/24' - network_acl_rule_item_model['code'] = 0 - network_acl_rule_item_model['protocol'] = 'icmp' - network_acl_rule_item_model['type'] = 8 + network_acl_rule_item_model['destination_port_max'] = 22 + network_acl_rule_item_model['destination_port_min'] = 22 + network_acl_rule_item_model['protocol'] = 'udp' + network_acl_rule_item_model['source_port_max'] = 65535 + network_acl_rule_item_model['source_port_min'] = 49152 subnet_reference_deleted_model = {} # SubnetReferenceDeleted subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' @@ -44812,7 +47965,7 @@ def test_network_acl_rule_collection_serialization(self): network_acl_rule_reference_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' network_acl_rule_reference_model['name'] = 'my-rule-1' - network_acl_rule_item_model = {} # NetworkACLRuleItemNetworkACLRuleProtocolICMP + network_acl_rule_item_model = {} # NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP network_acl_rule_item_model['action'] = 'allow' network_acl_rule_item_model['before'] = network_acl_rule_reference_model network_acl_rule_item_model['created_at'] = '2019-01-01T12:00:00Z' @@ -44821,11 +47974,13 @@ def test_network_acl_rule_collection_serialization(self): network_acl_rule_item_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9' network_acl_rule_item_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' network_acl_rule_item_model['ip_version'] = 'ipv4' - network_acl_rule_item_model['name'] = 'my-rule-2' + network_acl_rule_item_model['name'] = 'my-rule-1' network_acl_rule_item_model['source'] = '192.168.3.0/24' - network_acl_rule_item_model['code'] = 0 - network_acl_rule_item_model['protocol'] = 'icmp' - network_acl_rule_item_model['type'] = 8 + network_acl_rule_item_model['destination_port_max'] = 22 + network_acl_rule_item_model['destination_port_min'] = 22 + network_acl_rule_item_model['protocol'] = 'udp' + network_acl_rule_item_model['source_port_max'] = 65535 + network_acl_rule_item_model['source_port_min'] = 49152 # Construct a json representation of a NetworkACLRuleCollection model network_acl_rule_collection_model_json = {} @@ -44932,7 +48087,8 @@ def test_network_acl_rule_patch_serialization(self): network_acl_rule_patch_model_json['destination_port_max'] = 22 network_acl_rule_patch_model_json['destination_port_min'] = 22 network_acl_rule_patch_model_json['direction'] = 'inbound' - network_acl_rule_patch_model_json['name'] = 'my-rule-2' + network_acl_rule_patch_model_json['name'] = 'my-rule-1' + network_acl_rule_patch_model_json['protocol'] = 'tcp' network_acl_rule_patch_model_json['source'] = '192.168.3.2/32' network_acl_rule_patch_model_json['source_port_max'] = 65535 network_acl_rule_patch_model_json['source_port_min'] = 49152 @@ -46938,17 +50094,6 @@ def test_route_serialization(self): # 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' - - route_creator_model = {} # RouteCreatorVPNGatewayReference - route_creator_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b' - route_creator_model['deleted'] = vpn_gateway_reference_deleted_model - route_creator_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b' - route_creator_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' - route_creator_model['name'] = 'my-vpn-gateway' - route_creator_model['resource_type'] = 'vpn_gateway' - route_next_hop_model = {} # RouteNextHopIP route_next_hop_model['address'] = '192.168.3.4' @@ -46960,14 +50105,12 @@ def test_route_serialization(self): route_model_json = {} route_model_json['action'] = 'delegate' route_model_json['created_at'] = '2019-01-01T12:00:00Z' - route_model_json['creator'] = route_creator_model route_model_json['destination'] = '192.168.3.0/24' route_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531' route_model_json['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' route_model_json['lifecycle_state'] = 'stable' route_model_json['name'] = 'my-route-1' route_model_json['next_hop'] = route_next_hop_model - route_model_json['origin'] = 'service' route_model_json['zone'] = zone_reference_model # Construct a model instance of Route by calling from_dict on the json representation @@ -47003,17 +50146,6 @@ def test_route_collection_serialization(self): route_collection_next_model = {} # RouteCollectionNext route_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20' - vpn_gateway_reference_deleted_model = {} # VPNGatewayReferenceDeleted - vpn_gateway_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' - - route_creator_model = {} # RouteCreatorVPNGatewayReference - route_creator_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b' - route_creator_model['deleted'] = vpn_gateway_reference_deleted_model - route_creator_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b' - route_creator_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b' - route_creator_model['name'] = 'my-vpn-gateway' - route_creator_model['resource_type'] = 'vpn_gateway' - route_next_hop_model = {} # RouteNextHopIP route_next_hop_model['address'] = '192.168.3.4' @@ -47024,14 +50156,12 @@ def test_route_collection_serialization(self): route_model = {} # Route route_model['action'] = 'delegate' route_model['created_at'] = '2019-01-01T12:00:00Z' - route_model['creator'] = route_creator_model route_model['destination'] = '192.168.3.0/24' route_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531' route_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' route_model['lifecycle_state'] = 'stable' route_model['name'] = 'my-route-1' route_model['next_hop'] = route_next_hop_model - route_model['origin'] = 'service' route_model['zone'] = zone_reference_model # Construct a json representation of a RouteCollection model @@ -47297,6 +50427,7 @@ def test_routing_table_serialization(self): routing_table_model_json['name'] = 'my-routing-table-1' routing_table_model_json['resource_type'] = 'routing_table' routing_table_model_json['route_direct_link_ingress'] = True + routing_table_model_json['route_internet_ingress'] = True routing_table_model_json['route_transit_gateway_ingress'] = True routing_table_model_json['route_vpc_zone_ingress'] = True routing_table_model_json['routes'] = [route_reference_model] @@ -47368,6 +50499,7 @@ def test_routing_table_collection_serialization(self): routing_table_model['name'] = 'my-routing-table-1' routing_table_model['resource_type'] = 'routing_table' routing_table_model['route_direct_link_ingress'] = True + routing_table_model['route_internet_ingress'] = True routing_table_model['route_transit_gateway_ingress'] = True routing_table_model['route_vpc_zone_ingress'] = True routing_table_model['routes'] = [route_reference_model] @@ -47474,6 +50606,7 @@ def test_routing_table_patch_serialization(self): routing_table_patch_model_json['accept_routes_from'] = [resource_filter_model] routing_table_patch_model_json['name'] = 'my-routing-table-2' routing_table_patch_model_json['route_direct_link_ingress'] = True + routing_table_patch_model_json['route_internet_ingress'] = True routing_table_patch_model_json['route_transit_gateway_ingress'] = True routing_table_patch_model_json['route_vpc_zone_ingress'] = True @@ -49313,6 +52446,17 @@ def test_vpn_gateway_collection_serialization(self): subnet_reference_model['name'] = 'my-subnet' subnet_reference_model['resource_type'] = 'subnet' + vpc_reference_deleted_model = {} # VPCReferenceDeleted + vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + vpc_reference_model = {} # VPCReference + vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model['deleted'] = vpc_reference_deleted_model + vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model['name'] = 'my-vpc' + vpc_reference_model['resource_type'] = 'vpc' + vpn_gateway_model = {} # VPNGatewayRouteMode vpn_gateway_model['connections'] = [vpn_gateway_connection_reference_model] vpn_gateway_model['created_at'] = '2019-01-01T12:00:00Z' @@ -49325,6 +52469,7 @@ def test_vpn_gateway_collection_serialization(self): vpn_gateway_model['resource_type'] = 'vpn_gateway' vpn_gateway_model['status'] = 'available' vpn_gateway_model['subnet'] = subnet_reference_model + vpn_gateway_model['vpc'] = vpc_reference_model vpn_gateway_model['mode'] = 'route' # Construct a json representation of a VPNGatewayCollection model @@ -50872,6 +54017,7 @@ def test_volume_attachment_prototype_instance_by_image_context_serialization(sel 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_prototype_instance_by_image_context_model['user_tags'] = ['testString'] # Construct a json representation of a VolumeAttachmentPrototypeInstanceByImageContext model volume_attachment_prototype_instance_by_image_context_model_json = {} @@ -50922,6 +54068,7 @@ def test_volume_attachment_prototype_instance_by_source_snapshot_context_seriali 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 + volume_prototype_instance_by_source_snapshot_context_model['user_tags'] = ['testString'] # Construct a json representation of a VolumeAttachmentPrototypeInstanceBySourceSnapshotContext model volume_attachment_prototype_instance_by_source_snapshot_context_model_json = {} @@ -51566,6 +54713,7 @@ def test_volume_prototype_instance_by_image_context_serialization(self): volume_prototype_instance_by_image_context_model_json['iops'] = 10000 volume_prototype_instance_by_image_context_model_json['name'] = 'my-volume' volume_prototype_instance_by_image_context_model_json['profile'] = volume_profile_identity_model + volume_prototype_instance_by_image_context_model_json['user_tags'] = ['testString'] # Construct a model instance of VolumePrototypeInstanceByImageContext by calling from_dict on the json representation volume_prototype_instance_by_image_context_model = VolumePrototypeInstanceByImageContext.from_dict(volume_prototype_instance_by_image_context_model_json) @@ -51611,6 +54759,7 @@ def test_volume_prototype_instance_by_source_snapshot_context_serialization(self 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 + volume_prototype_instance_by_source_snapshot_context_model_json['user_tags'] = ['testString'] # 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) @@ -51917,14 +55066,14 @@ def test_bare_metal_server_initialization_user_account_bare_metal_server_initial bare_metal_server_initialization_user_account_bare_metal_server_initialization_host_user_account_model_json2 = bare_metal_server_initialization_user_account_bare_metal_server_initialization_host_user_account_model.to_dict() assert bare_metal_server_initialization_user_account_bare_metal_server_initialization_host_user_account_model_json2 == bare_metal_server_initialization_user_account_bare_metal_server_initialization_host_user_account_model_json -class TestModel_BareMetalServerNetworkInterfaceByPCI(): +class TestModel_BareMetalServerNetworkInterfaceByHiperSocket(): """ - Test Class for BareMetalServerNetworkInterfaceByPCI + Test Class for BareMetalServerNetworkInterfaceByHiperSocket """ - def test_bare_metal_server_network_interface_by_pci_serialization(self): + def test_bare_metal_server_network_interface_by_hiper_socket_serialization(self): """ - Test serialization/deserialization for BareMetalServerNetworkInterfaceByPCI + Test serialization/deserialization for BareMetalServerNetworkInterfaceByHiperSocket """ # Construct dict forms of any model objects needed in order to build this model. @@ -51972,49 +55121,138 @@ def test_bare_metal_server_network_interface_by_pci_serialization(self): subnet_reference_model['name'] = 'my-subnet' subnet_reference_model['resource_type'] = 'subnet' - # Construct a json representation of a BareMetalServerNetworkInterfaceByPCI model - bare_metal_server_network_interface_by_pci_model_json = {} - bare_metal_server_network_interface_by_pci_model_json['allow_ip_spoofing'] = True - bare_metal_server_network_interface_by_pci_model_json['created_at'] = '2019-01-01T12:00:00Z' - bare_metal_server_network_interface_by_pci_model_json['enable_infrastructure_nat'] = True - bare_metal_server_network_interface_by_pci_model_json['floating_ips'] = [floating_ip_reference_model] - bare_metal_server_network_interface_by_pci_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' - bare_metal_server_network_interface_by_pci_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' - bare_metal_server_network_interface_by_pci_model_json['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_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' - bare_metal_server_network_interface_by_pci_model_json['subnet'] = subnet_reference_model - bare_metal_server_network_interface_by_pci_model_json['type'] = 'primary' - bare_metal_server_network_interface_by_pci_model_json['allowed_vlans'] = [4] - bare_metal_server_network_interface_by_pci_model_json['interface_type'] = 'pci' + # Construct a json representation of a BareMetalServerNetworkInterfaceByHiperSocket model + bare_metal_server_network_interface_by_hiper_socket_model_json = {} + bare_metal_server_network_interface_by_hiper_socket_model_json['allow_ip_spoofing'] = True + bare_metal_server_network_interface_by_hiper_socket_model_json['created_at'] = '2019-01-01T12:00:00Z' + bare_metal_server_network_interface_by_hiper_socket_model_json['enable_infrastructure_nat'] = True + bare_metal_server_network_interface_by_hiper_socket_model_json['floating_ips'] = [floating_ip_reference_model] + bare_metal_server_network_interface_by_hiper_socket_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' + bare_metal_server_network_interface_by_hiper_socket_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' + bare_metal_server_network_interface_by_hiper_socket_model_json['mac_address'] = '02:00:0a:00:23:94' + bare_metal_server_network_interface_by_hiper_socket_model_json['name'] = 'my-network-interface' + bare_metal_server_network_interface_by_hiper_socket_model_json['port_speed'] = 1000 + bare_metal_server_network_interface_by_hiper_socket_model_json['primary_ip'] = reserved_ip_reference_model + bare_metal_server_network_interface_by_hiper_socket_model_json['resource_type'] = 'network_interface' + bare_metal_server_network_interface_by_hiper_socket_model_json['security_groups'] = [security_group_reference_model] + bare_metal_server_network_interface_by_hiper_socket_model_json['status'] = 'available' + bare_metal_server_network_interface_by_hiper_socket_model_json['subnet'] = subnet_reference_model + bare_metal_server_network_interface_by_hiper_socket_model_json['type'] = 'primary' + bare_metal_server_network_interface_by_hiper_socket_model_json['interface_type'] = 'hipersocket' - # Construct a model instance of BareMetalServerNetworkInterfaceByPCI by calling from_dict on the json representation - bare_metal_server_network_interface_by_pci_model = BareMetalServerNetworkInterfaceByPCI.from_dict(bare_metal_server_network_interface_by_pci_model_json) - assert bare_metal_server_network_interface_by_pci_model != False + # Construct a model instance of BareMetalServerNetworkInterfaceByHiperSocket by calling from_dict on the json representation + bare_metal_server_network_interface_by_hiper_socket_model = BareMetalServerNetworkInterfaceByHiperSocket.from_dict(bare_metal_server_network_interface_by_hiper_socket_model_json) + assert bare_metal_server_network_interface_by_hiper_socket_model != False - # Construct a model instance of BareMetalServerNetworkInterfaceByPCI by calling from_dict on the json representation - bare_metal_server_network_interface_by_pci_model_dict = BareMetalServerNetworkInterfaceByPCI.from_dict(bare_metal_server_network_interface_by_pci_model_json).__dict__ - bare_metal_server_network_interface_by_pci_model2 = BareMetalServerNetworkInterfaceByPCI(**bare_metal_server_network_interface_by_pci_model_dict) + # Construct a model instance of BareMetalServerNetworkInterfaceByHiperSocket by calling from_dict on the json representation + bare_metal_server_network_interface_by_hiper_socket_model_dict = BareMetalServerNetworkInterfaceByHiperSocket.from_dict(bare_metal_server_network_interface_by_hiper_socket_model_json).__dict__ + bare_metal_server_network_interface_by_hiper_socket_model2 = BareMetalServerNetworkInterfaceByHiperSocket(**bare_metal_server_network_interface_by_hiper_socket_model_dict) # Verify the model instances are equivalent - assert bare_metal_server_network_interface_by_pci_model == bare_metal_server_network_interface_by_pci_model2 + assert bare_metal_server_network_interface_by_hiper_socket_model == bare_metal_server_network_interface_by_hiper_socket_model2 # Convert model instance back to dict and verify no loss of data - bare_metal_server_network_interface_by_pci_model_json2 = bare_metal_server_network_interface_by_pci_model.to_dict() - assert bare_metal_server_network_interface_by_pci_model_json2 == bare_metal_server_network_interface_by_pci_model_json + bare_metal_server_network_interface_by_hiper_socket_model_json2 = bare_metal_server_network_interface_by_hiper_socket_model.to_dict() + assert bare_metal_server_network_interface_by_hiper_socket_model_json2 == bare_metal_server_network_interface_by_hiper_socket_model_json -class TestModel_BareMetalServerNetworkInterfaceByVLAN(): +class TestModel_BareMetalServerNetworkInterfaceByPCI(): """ - Test Class for BareMetalServerNetworkInterfaceByVLAN + Test Class for BareMetalServerNetworkInterfaceByPCI """ - def test_bare_metal_server_network_interface_by_vlan_serialization(self): + def test_bare_metal_server_network_interface_by_pci_serialization(self): """ - Test serialization/deserialization for BareMetalServerNetworkInterfaceByVLAN + Test serialization/deserialization for BareMetalServerNetworkInterfaceByPCI + """ + + # Construct dict forms of any model objects needed in order to build this model. + + 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' + + 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' + + 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' + subnet_reference_model['resource_type'] = 'subnet' + + # Construct a json representation of a BareMetalServerNetworkInterfaceByPCI model + bare_metal_server_network_interface_by_pci_model_json = {} + bare_metal_server_network_interface_by_pci_model_json['allow_ip_spoofing'] = True + bare_metal_server_network_interface_by_pci_model_json['created_at'] = '2019-01-01T12:00:00Z' + bare_metal_server_network_interface_by_pci_model_json['enable_infrastructure_nat'] = True + bare_metal_server_network_interface_by_pci_model_json['floating_ips'] = [floating_ip_reference_model] + bare_metal_server_network_interface_by_pci_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' + bare_metal_server_network_interface_by_pci_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' + bare_metal_server_network_interface_by_pci_model_json['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_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' + bare_metal_server_network_interface_by_pci_model_json['subnet'] = subnet_reference_model + bare_metal_server_network_interface_by_pci_model_json['type'] = 'primary' + bare_metal_server_network_interface_by_pci_model_json['allowed_vlans'] = [4] + bare_metal_server_network_interface_by_pci_model_json['interface_type'] = 'pci' + + # Construct a model instance of BareMetalServerNetworkInterfaceByPCI by calling from_dict on the json representation + bare_metal_server_network_interface_by_pci_model = BareMetalServerNetworkInterfaceByPCI.from_dict(bare_metal_server_network_interface_by_pci_model_json) + assert bare_metal_server_network_interface_by_pci_model != False + + # Construct a model instance of BareMetalServerNetworkInterfaceByPCI by calling from_dict on the json representation + bare_metal_server_network_interface_by_pci_model_dict = BareMetalServerNetworkInterfaceByPCI.from_dict(bare_metal_server_network_interface_by_pci_model_json).__dict__ + bare_metal_server_network_interface_by_pci_model2 = BareMetalServerNetworkInterfaceByPCI(**bare_metal_server_network_interface_by_pci_model_dict) + + # Verify the model instances are equivalent + assert bare_metal_server_network_interface_by_pci_model == bare_metal_server_network_interface_by_pci_model2 + + # Convert model instance back to dict and verify no loss of data + bare_metal_server_network_interface_by_pci_model_json2 = bare_metal_server_network_interface_by_pci_model.to_dict() + assert bare_metal_server_network_interface_by_pci_model_json2 == bare_metal_server_network_interface_by_pci_model_json + +class TestModel_BareMetalServerNetworkInterfaceByVLAN(): + """ + Test Class for BareMetalServerNetworkInterfaceByVLAN + """ + + def test_bare_metal_server_network_interface_by_vlan_serialization(self): + """ + Test serialization/deserialization for BareMetalServerNetworkInterfaceByVLAN """ # Construct dict forms of any model objects needed in order to build this model. @@ -52098,6 +55336,54 @@ def test_bare_metal_server_network_interface_by_vlan_serialization(self): bare_metal_server_network_interface_by_vlan_model_json2 = bare_metal_server_network_interface_by_vlan_model.to_dict() assert bare_metal_server_network_interface_by_vlan_model_json2 == bare_metal_server_network_interface_by_vlan_model_json +class TestModel_BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype(): + """ + Test Class for BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype + """ + + def test_bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_serialization(self): + """ + Test serialization/deserialization for BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype + """ + + # 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' + + subnet_identity_model = {} # SubnetIdentityById + subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + + # Construct a json representation of a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype model + bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model_json = {} + bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model_json['allow_ip_spoofing'] = True + bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model_json['enable_infrastructure_nat'] = True + bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model_json['name'] = 'my-network-interface' + bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model_json['primary_ip'] = network_interface_ip_prototype_model + bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model_json['security_groups'] = [security_group_identity_model] + bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model_json['subnet'] = subnet_identity_model + bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model_json['interface_type'] = 'hipersocket' + + # Construct a model instance of BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype by calling from_dict on the json representation + bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model = BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype.from_dict(bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model_json) + assert bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model != False + + # Construct a model instance of BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype by calling from_dict on the json representation + bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model_dict = BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype.from_dict(bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model_json).__dict__ + bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model2 = BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype(**bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model_dict) + + # Verify the model instances are equivalent + assert bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model == bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model2 + + # Convert model instance back to dict and verify no loss of data + bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model_json2 = bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model.to_dict() + assert bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model_json2 == bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model_json + class TestModel_BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype(): """ Test Class for BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype @@ -52993,6 +56279,64 @@ def test_bare_metal_server_profile_memory_range_serialization(self): bare_metal_server_profile_memory_range_model_json2 = bare_metal_server_profile_memory_range_model.to_dict() assert bare_metal_server_profile_memory_range_model_json2 == bare_metal_server_profile_memory_range_model_json +class TestModel_CatalogOfferingIdentityCatalogOfferingByCRN(): + """ + Test Class for CatalogOfferingIdentityCatalogOfferingByCRN + """ + + def test_catalog_offering_identity_catalog_offering_by_crn_serialization(self): + """ + Test serialization/deserialization for CatalogOfferingIdentityCatalogOfferingByCRN + """ + + # Construct a json representation of a CatalogOfferingIdentityCatalogOfferingByCRN model + catalog_offering_identity_catalog_offering_by_crn_model_json = {} + catalog_offering_identity_catalog_offering_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:offering:00111601-0ec5-41ac-b142-96d1e64e6442' + + # Construct a model instance of CatalogOfferingIdentityCatalogOfferingByCRN by calling from_dict on the json representation + catalog_offering_identity_catalog_offering_by_crn_model = CatalogOfferingIdentityCatalogOfferingByCRN.from_dict(catalog_offering_identity_catalog_offering_by_crn_model_json) + assert catalog_offering_identity_catalog_offering_by_crn_model != False + + # Construct a model instance of CatalogOfferingIdentityCatalogOfferingByCRN by calling from_dict on the json representation + catalog_offering_identity_catalog_offering_by_crn_model_dict = CatalogOfferingIdentityCatalogOfferingByCRN.from_dict(catalog_offering_identity_catalog_offering_by_crn_model_json).__dict__ + catalog_offering_identity_catalog_offering_by_crn_model2 = CatalogOfferingIdentityCatalogOfferingByCRN(**catalog_offering_identity_catalog_offering_by_crn_model_dict) + + # Verify the model instances are equivalent + assert catalog_offering_identity_catalog_offering_by_crn_model == catalog_offering_identity_catalog_offering_by_crn_model2 + + # Convert model instance back to dict and verify no loss of data + catalog_offering_identity_catalog_offering_by_crn_model_json2 = catalog_offering_identity_catalog_offering_by_crn_model.to_dict() + assert catalog_offering_identity_catalog_offering_by_crn_model_json2 == catalog_offering_identity_catalog_offering_by_crn_model_json + +class TestModel_CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN(): + """ + Test Class for CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN + """ + + def test_catalog_offering_version_identity_catalog_offering_version_by_crn_serialization(self): + """ + Test serialization/deserialization for CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN + """ + + # Construct a json representation of a CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN model + catalog_offering_version_identity_catalog_offering_version_by_crn_model_json = {} + catalog_offering_version_identity_catalog_offering_version_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d' + + # Construct a model instance of CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN by calling from_dict on the json representation + catalog_offering_version_identity_catalog_offering_version_by_crn_model = CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN.from_dict(catalog_offering_version_identity_catalog_offering_version_by_crn_model_json) + assert catalog_offering_version_identity_catalog_offering_version_by_crn_model != False + + # Construct a model instance of CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN by calling from_dict on the json representation + catalog_offering_version_identity_catalog_offering_version_by_crn_model_dict = CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN.from_dict(catalog_offering_version_identity_catalog_offering_version_by_crn_model_json).__dict__ + catalog_offering_version_identity_catalog_offering_version_by_crn_model2 = CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN(**catalog_offering_version_identity_catalog_offering_version_by_crn_model_dict) + + # Verify the model instances are equivalent + assert catalog_offering_version_identity_catalog_offering_version_by_crn_model == catalog_offering_version_identity_catalog_offering_version_by_crn_model2 + + # Convert model instance back to dict and verify no loss of data + catalog_offering_version_identity_catalog_offering_version_by_crn_model_json2 = catalog_offering_version_identity_catalog_offering_version_by_crn_model.to_dict() + assert catalog_offering_version_identity_catalog_offering_version_by_crn_model_json2 == catalog_offering_version_identity_catalog_offering_version_by_crn_model_json + class TestModel_CertificateInstanceIdentityByCRN(): """ Test Class for CertificateInstanceIdentityByCRN @@ -54370,6 +57714,74 @@ def test_image_prototype_image_by_source_volume_serialization(self): image_prototype_image_by_source_volume_model_json2 = image_prototype_image_by_source_volume_model.to_dict() assert image_prototype_image_by_source_volume_model_json2 == image_prototype_image_by_source_volume_model_json +class TestModel_InstanceCatalogOfferingPrototypeCatalogOfferingByOffering(): + """ + Test Class for InstanceCatalogOfferingPrototypeCatalogOfferingByOffering + """ + + def test_instance_catalog_offering_prototype_catalog_offering_by_offering_serialization(self): + """ + Test serialization/deserialization for InstanceCatalogOfferingPrototypeCatalogOfferingByOffering + """ + + # Construct dict forms of any model objects needed in order to build this model. + + catalog_offering_identity_model = {} # CatalogOfferingIdentityCatalogOfferingByCRN + catalog_offering_identity_model['crn'] = 'crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:offering:00111601-0ec5-41ac-b142-96d1e64e6442' + + # Construct a json representation of a InstanceCatalogOfferingPrototypeCatalogOfferingByOffering model + instance_catalog_offering_prototype_catalog_offering_by_offering_model_json = {} + instance_catalog_offering_prototype_catalog_offering_by_offering_model_json['offering'] = catalog_offering_identity_model + + # Construct a model instance of InstanceCatalogOfferingPrototypeCatalogOfferingByOffering by calling from_dict on the json representation + instance_catalog_offering_prototype_catalog_offering_by_offering_model = InstanceCatalogOfferingPrototypeCatalogOfferingByOffering.from_dict(instance_catalog_offering_prototype_catalog_offering_by_offering_model_json) + assert instance_catalog_offering_prototype_catalog_offering_by_offering_model != False + + # Construct a model instance of InstanceCatalogOfferingPrototypeCatalogOfferingByOffering by calling from_dict on the json representation + instance_catalog_offering_prototype_catalog_offering_by_offering_model_dict = InstanceCatalogOfferingPrototypeCatalogOfferingByOffering.from_dict(instance_catalog_offering_prototype_catalog_offering_by_offering_model_json).__dict__ + instance_catalog_offering_prototype_catalog_offering_by_offering_model2 = InstanceCatalogOfferingPrototypeCatalogOfferingByOffering(**instance_catalog_offering_prototype_catalog_offering_by_offering_model_dict) + + # Verify the model instances are equivalent + assert instance_catalog_offering_prototype_catalog_offering_by_offering_model == instance_catalog_offering_prototype_catalog_offering_by_offering_model2 + + # Convert model instance back to dict and verify no loss of data + instance_catalog_offering_prototype_catalog_offering_by_offering_model_json2 = instance_catalog_offering_prototype_catalog_offering_by_offering_model.to_dict() + assert instance_catalog_offering_prototype_catalog_offering_by_offering_model_json2 == instance_catalog_offering_prototype_catalog_offering_by_offering_model_json + +class TestModel_InstanceCatalogOfferingPrototypeCatalogOfferingByVersion(): + """ + Test Class for InstanceCatalogOfferingPrototypeCatalogOfferingByVersion + """ + + def test_instance_catalog_offering_prototype_catalog_offering_by_version_serialization(self): + """ + Test serialization/deserialization for InstanceCatalogOfferingPrototypeCatalogOfferingByVersion + """ + + # Construct dict forms of any model objects needed in order to build this model. + + catalog_offering_version_identity_model = {} # CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN + catalog_offering_version_identity_model['crn'] = 'crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d' + + # Construct a json representation of a InstanceCatalogOfferingPrototypeCatalogOfferingByVersion model + instance_catalog_offering_prototype_catalog_offering_by_version_model_json = {} + instance_catalog_offering_prototype_catalog_offering_by_version_model_json['version'] = catalog_offering_version_identity_model + + # Construct a model instance of InstanceCatalogOfferingPrototypeCatalogOfferingByVersion by calling from_dict on the json representation + instance_catalog_offering_prototype_catalog_offering_by_version_model = InstanceCatalogOfferingPrototypeCatalogOfferingByVersion.from_dict(instance_catalog_offering_prototype_catalog_offering_by_version_model_json) + assert instance_catalog_offering_prototype_catalog_offering_by_version_model != False + + # Construct a model instance of InstanceCatalogOfferingPrototypeCatalogOfferingByVersion by calling from_dict on the json representation + instance_catalog_offering_prototype_catalog_offering_by_version_model_dict = InstanceCatalogOfferingPrototypeCatalogOfferingByVersion.from_dict(instance_catalog_offering_prototype_catalog_offering_by_version_model_json).__dict__ + instance_catalog_offering_prototype_catalog_offering_by_version_model2 = InstanceCatalogOfferingPrototypeCatalogOfferingByVersion(**instance_catalog_offering_prototype_catalog_offering_by_version_model_dict) + + # Verify the model instances are equivalent + assert instance_catalog_offering_prototype_catalog_offering_by_version_model == instance_catalog_offering_prototype_catalog_offering_by_version_model2 + + # Convert model instance back to dict and verify no loss of data + instance_catalog_offering_prototype_catalog_offering_by_version_model_json2 = instance_catalog_offering_prototype_catalog_offering_by_version_model.to_dict() + assert instance_catalog_offering_prototype_catalog_offering_by_version_model_json2 == instance_catalog_offering_prototype_catalog_offering_by_version_model_json + class TestModel_InstanceGroupManagerAutoScale(): """ Test Class for InstanceGroupManagerAutoScale @@ -55918,6 +59330,135 @@ def test_instance_profile_volume_bandwidth_range_serialization(self): instance_profile_volume_bandwidth_range_model_json2 = instance_profile_volume_bandwidth_range_model.to_dict() assert instance_profile_volume_bandwidth_range_model_json2 == instance_profile_volume_bandwidth_range_model_json +class TestModel_InstancePrototypeInstanceByCatalogOffering(): + """ + Test Class for InstancePrototypeInstanceByCatalogOffering + """ + + def test_instance_prototype_instance_by_catalog_offering_serialization(self): + """ + Test serialization/deserialization for InstancePrototypeInstanceByCatalogOffering + """ + + # 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'] = False + + 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' + + 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_ip'] = network_interface_ip_prototype_model + 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'] = 'cx2-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' + + 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_prototype_instance_by_image_context_model['user_tags'] = ['testString'] + + 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 + + catalog_offering_identity_model = {} # CatalogOfferingIdentityCatalogOfferingByCRN + catalog_offering_identity_model['crn'] = 'crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:offering:00111601-0ec5-41ac-b142-96d1e64e6442' + + instance_catalog_offering_prototype_model = {} # InstanceCatalogOfferingPrototypeCatalogOfferingByOffering + instance_catalog_offering_prototype_model['offering'] = catalog_offering_identity_model + + zone_identity_model = {} # ZoneIdentityByName + zone_identity_model['name'] = 'us-south-1' + + # Construct a json representation of a InstancePrototypeInstanceByCatalogOffering model + instance_prototype_instance_by_catalog_offering_model_json = {} + instance_prototype_instance_by_catalog_offering_model_json['availability_policy'] = instance_availability_prototype_model + instance_prototype_instance_by_catalog_offering_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model + instance_prototype_instance_by_catalog_offering_model_json['keys'] = [key_identity_model] + instance_prototype_instance_by_catalog_offering_model_json['metadata_service'] = instance_metadata_service_prototype_model + instance_prototype_instance_by_catalog_offering_model_json['name'] = 'my-instance' + instance_prototype_instance_by_catalog_offering_model_json['network_interfaces'] = [network_interface_prototype_model] + instance_prototype_instance_by_catalog_offering_model_json['placement_target'] = instance_placement_target_prototype_model + instance_prototype_instance_by_catalog_offering_model_json['profile'] = instance_profile_identity_model + instance_prototype_instance_by_catalog_offering_model_json['resource_group'] = resource_group_identity_model + instance_prototype_instance_by_catalog_offering_model_json['total_volume_bandwidth'] = 500 + instance_prototype_instance_by_catalog_offering_model_json['user_data'] = 'testString' + instance_prototype_instance_by_catalog_offering_model_json['volume_attachments'] = [volume_attachment_prototype_instance_context_model] + instance_prototype_instance_by_catalog_offering_model_json['vpc'] = vpc_identity_model + instance_prototype_instance_by_catalog_offering_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model + instance_prototype_instance_by_catalog_offering_model_json['catalog_offering'] = instance_catalog_offering_prototype_model + instance_prototype_instance_by_catalog_offering_model_json['primary_network_interface'] = network_interface_prototype_model + instance_prototype_instance_by_catalog_offering_model_json['zone'] = zone_identity_model + + # Construct a model instance of InstancePrototypeInstanceByCatalogOffering by calling from_dict on the json representation + instance_prototype_instance_by_catalog_offering_model = InstancePrototypeInstanceByCatalogOffering.from_dict(instance_prototype_instance_by_catalog_offering_model_json) + assert instance_prototype_instance_by_catalog_offering_model != False + + # Construct a model instance of InstancePrototypeInstanceByCatalogOffering by calling from_dict on the json representation + instance_prototype_instance_by_catalog_offering_model_dict = InstancePrototypeInstanceByCatalogOffering.from_dict(instance_prototype_instance_by_catalog_offering_model_json).__dict__ + instance_prototype_instance_by_catalog_offering_model2 = InstancePrototypeInstanceByCatalogOffering(**instance_prototype_instance_by_catalog_offering_model_dict) + + # Verify the model instances are equivalent + assert instance_prototype_instance_by_catalog_offering_model == instance_prototype_instance_by_catalog_offering_model2 + + # Convert model instance back to dict and verify no loss of data + instance_prototype_instance_by_catalog_offering_model_json2 = instance_prototype_instance_by_catalog_offering_model.to_dict() + assert instance_prototype_instance_by_catalog_offering_model_json2 == instance_prototype_instance_by_catalog_offering_model_json + class TestModel_InstancePrototypeInstanceByImage(): """ Test Class for InstancePrototypeInstanceByImage @@ -55996,6 +59537,7 @@ def test_instance_prototype_instance_by_image_serialization(self): 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_prototype_instance_by_image_context_model['user_tags'] = ['testString'] volume_attachment_prototype_instance_by_image_context_model = {} # VolumeAttachmentPrototypeInstanceByImageContext volume_attachment_prototype_instance_by_image_context_model['delete_volume_on_instance_delete'] = True @@ -56125,6 +59667,7 @@ def test_instance_prototype_instance_by_source_snapshot_serialization(self): 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 + volume_prototype_instance_by_source_snapshot_context_model['user_tags'] = ['testString'] 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 @@ -56246,12 +59789,19 @@ def test_instance_prototype_instance_by_source_template_serialization(self): 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_prototype_instance_by_image_context_model['user_tags'] = ['testString'] 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 + catalog_offering_identity_model = {} # CatalogOfferingIdentityCatalogOfferingByCRN + catalog_offering_identity_model['crn'] = 'crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:offering:00111601-0ec5-41ac-b142-96d1e64e6442' + + instance_catalog_offering_prototype_model = {} # InstanceCatalogOfferingPrototypeCatalogOfferingByOffering + instance_catalog_offering_prototype_model['offering'] = catalog_offering_identity_model + image_identity_model = {} # ImageIdentityById image_identity_model['id'] = '72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' @@ -56277,6 +59827,7 @@ def test_instance_prototype_instance_by_source_template_serialization(self): 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['catalog_offering'] = instance_catalog_offering_prototype_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 @@ -56384,6 +59935,135 @@ def test_instance_template_identity_by_id_serialization(self): instance_template_identity_by_id_model_json2 = instance_template_identity_by_id_model.to_dict() assert instance_template_identity_by_id_model_json2 == instance_template_identity_by_id_model_json +class TestModel_InstanceTemplatePrototypeInstanceByCatalogOffering(): + """ + Test Class for InstanceTemplatePrototypeInstanceByCatalogOffering + """ + + def test_instance_template_prototype_instance_by_catalog_offering_serialization(self): + """ + Test serialization/deserialization for InstanceTemplatePrototypeInstanceByCatalogOffering + """ + + # 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'] = False + + 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' + + 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_ip'] = network_interface_ip_prototype_model + 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'] = 'cx2-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' + + 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_prototype_instance_by_image_context_model['user_tags'] = ['testString'] + + 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 + + catalog_offering_identity_model = {} # CatalogOfferingIdentityCatalogOfferingByCRN + catalog_offering_identity_model['crn'] = 'crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:offering:00111601-0ec5-41ac-b142-96d1e64e6442' + + instance_catalog_offering_prototype_model = {} # InstanceCatalogOfferingPrototypeCatalogOfferingByOffering + instance_catalog_offering_prototype_model['offering'] = catalog_offering_identity_model + + zone_identity_model = {} # ZoneIdentityByName + zone_identity_model['name'] = 'us-south-1' + + # Construct a json representation of a InstanceTemplatePrototypeInstanceByCatalogOffering model + instance_template_prototype_instance_by_catalog_offering_model_json = {} + instance_template_prototype_instance_by_catalog_offering_model_json['availability_policy'] = instance_availability_prototype_model + instance_template_prototype_instance_by_catalog_offering_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model + instance_template_prototype_instance_by_catalog_offering_model_json['keys'] = [key_identity_model] + instance_template_prototype_instance_by_catalog_offering_model_json['metadata_service'] = instance_metadata_service_prototype_model + instance_template_prototype_instance_by_catalog_offering_model_json['name'] = 'my-instance' + instance_template_prototype_instance_by_catalog_offering_model_json['network_interfaces'] = [network_interface_prototype_model] + instance_template_prototype_instance_by_catalog_offering_model_json['placement_target'] = instance_placement_target_prototype_model + instance_template_prototype_instance_by_catalog_offering_model_json['profile'] = instance_profile_identity_model + instance_template_prototype_instance_by_catalog_offering_model_json['resource_group'] = resource_group_identity_model + instance_template_prototype_instance_by_catalog_offering_model_json['total_volume_bandwidth'] = 500 + instance_template_prototype_instance_by_catalog_offering_model_json['user_data'] = 'testString' + instance_template_prototype_instance_by_catalog_offering_model_json['volume_attachments'] = [volume_attachment_prototype_instance_context_model] + instance_template_prototype_instance_by_catalog_offering_model_json['vpc'] = vpc_identity_model + instance_template_prototype_instance_by_catalog_offering_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model + instance_template_prototype_instance_by_catalog_offering_model_json['catalog_offering'] = instance_catalog_offering_prototype_model + instance_template_prototype_instance_by_catalog_offering_model_json['primary_network_interface'] = network_interface_prototype_model + instance_template_prototype_instance_by_catalog_offering_model_json['zone'] = zone_identity_model + + # Construct a model instance of InstanceTemplatePrototypeInstanceByCatalogOffering by calling from_dict on the json representation + instance_template_prototype_instance_by_catalog_offering_model = InstanceTemplatePrototypeInstanceByCatalogOffering.from_dict(instance_template_prototype_instance_by_catalog_offering_model_json) + assert instance_template_prototype_instance_by_catalog_offering_model != False + + # Construct a model instance of InstanceTemplatePrototypeInstanceByCatalogOffering by calling from_dict on the json representation + instance_template_prototype_instance_by_catalog_offering_model_dict = InstanceTemplatePrototypeInstanceByCatalogOffering.from_dict(instance_template_prototype_instance_by_catalog_offering_model_json).__dict__ + instance_template_prototype_instance_by_catalog_offering_model2 = InstanceTemplatePrototypeInstanceByCatalogOffering(**instance_template_prototype_instance_by_catalog_offering_model_dict) + + # Verify the model instances are equivalent + assert instance_template_prototype_instance_by_catalog_offering_model == instance_template_prototype_instance_by_catalog_offering_model2 + + # Convert model instance back to dict and verify no loss of data + instance_template_prototype_instance_by_catalog_offering_model_json2 = instance_template_prototype_instance_by_catalog_offering_model.to_dict() + assert instance_template_prototype_instance_by_catalog_offering_model_json2 == instance_template_prototype_instance_by_catalog_offering_model_json + class TestModel_InstanceTemplatePrototypeInstanceByImage(): """ Test Class for InstanceTemplatePrototypeInstanceByImage @@ -56462,6 +60142,7 @@ def test_instance_template_prototype_instance_by_image_serialization(self): 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_prototype_instance_by_image_context_model['user_tags'] = ['testString'] volume_attachment_prototype_instance_by_image_context_model = {} # VolumeAttachmentPrototypeInstanceByImageContext volume_attachment_prototype_instance_by_image_context_model['delete_volume_on_instance_delete'] = True @@ -56509,6 +60190,132 @@ def test_instance_template_prototype_instance_by_image_serialization(self): instance_template_prototype_instance_by_image_model_json2 = instance_template_prototype_instance_by_image_model.to_dict() assert instance_template_prototype_instance_by_image_model_json2 == instance_template_prototype_instance_by_image_model_json +class TestModel_InstanceTemplatePrototypeInstanceBySourceSnapshot(): + """ + Test Class for InstanceTemplatePrototypeInstanceBySourceSnapshot + """ + + def test_instance_template_prototype_instance_by_source_snapshot_serialization(self): + """ + Test serialization/deserialization for InstanceTemplatePrototypeInstanceBySourceSnapshot + """ + + # 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'] = False + + 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' + + 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_ip'] = network_interface_ip_prototype_model + 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'] = 'cx2-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_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 + volume_prototype_instance_by_source_snapshot_context_model['user_tags'] = ['testString'] + + 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 InstanceTemplatePrototypeInstanceBySourceSnapshot model + instance_template_prototype_instance_by_source_snapshot_model_json = {} + instance_template_prototype_instance_by_source_snapshot_model_json['availability_policy'] = instance_availability_prototype_model + instance_template_prototype_instance_by_source_snapshot_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model + instance_template_prototype_instance_by_source_snapshot_model_json['keys'] = [key_identity_model] + instance_template_prototype_instance_by_source_snapshot_model_json['metadata_service'] = instance_metadata_service_prototype_model + instance_template_prototype_instance_by_source_snapshot_model_json['name'] = 'my-instance' + instance_template_prototype_instance_by_source_snapshot_model_json['network_interfaces'] = [network_interface_prototype_model] + instance_template_prototype_instance_by_source_snapshot_model_json['placement_target'] = instance_placement_target_prototype_model + instance_template_prototype_instance_by_source_snapshot_model_json['profile'] = instance_profile_identity_model + instance_template_prototype_instance_by_source_snapshot_model_json['resource_group'] = resource_group_identity_model + instance_template_prototype_instance_by_source_snapshot_model_json['total_volume_bandwidth'] = 500 + instance_template_prototype_instance_by_source_snapshot_model_json['user_data'] = 'testString' + instance_template_prototype_instance_by_source_snapshot_model_json['volume_attachments'] = [volume_attachment_prototype_instance_context_model] + instance_template_prototype_instance_by_source_snapshot_model_json['vpc'] = vpc_identity_model + instance_template_prototype_instance_by_source_snapshot_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_source_snapshot_context_model + instance_template_prototype_instance_by_source_snapshot_model_json['primary_network_interface'] = network_interface_prototype_model + instance_template_prototype_instance_by_source_snapshot_model_json['zone'] = zone_identity_model + + # Construct a model instance of InstanceTemplatePrototypeInstanceBySourceSnapshot by calling from_dict on the json representation + instance_template_prototype_instance_by_source_snapshot_model = InstanceTemplatePrototypeInstanceBySourceSnapshot.from_dict(instance_template_prototype_instance_by_source_snapshot_model_json) + assert instance_template_prototype_instance_by_source_snapshot_model != False + + # Construct a model instance of InstanceTemplatePrototypeInstanceBySourceSnapshot by calling from_dict on the json representation + instance_template_prototype_instance_by_source_snapshot_model_dict = InstanceTemplatePrototypeInstanceBySourceSnapshot.from_dict(instance_template_prototype_instance_by_source_snapshot_model_json).__dict__ + instance_template_prototype_instance_by_source_snapshot_model2 = InstanceTemplatePrototypeInstanceBySourceSnapshot(**instance_template_prototype_instance_by_source_snapshot_model_dict) + + # Verify the model instances are equivalent + assert instance_template_prototype_instance_by_source_snapshot_model == instance_template_prototype_instance_by_source_snapshot_model2 + + # Convert model instance back to dict and verify no loss of data + instance_template_prototype_instance_by_source_snapshot_model_json2 = instance_template_prototype_instance_by_source_snapshot_model.to_dict() + assert instance_template_prototype_instance_by_source_snapshot_model_json2 == instance_template_prototype_instance_by_source_snapshot_model_json + class TestModel_InstanceTemplatePrototypeInstanceBySourceTemplate(): """ Test Class for InstanceTemplatePrototypeInstanceBySourceTemplate @@ -56587,12 +60394,19 @@ def test_instance_template_prototype_instance_by_source_template_serialization(s 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_prototype_instance_by_image_context_model['user_tags'] = ['testString'] 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 + catalog_offering_identity_model = {} # CatalogOfferingIdentityCatalogOfferingByCRN + catalog_offering_identity_model['crn'] = 'crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:offering:00111601-0ec5-41ac-b142-96d1e64e6442' + + instance_catalog_offering_prototype_model = {} # InstanceCatalogOfferingPrototypeCatalogOfferingByOffering + instance_catalog_offering_prototype_model['offering'] = catalog_offering_identity_model + image_identity_model = {} # ImageIdentityById image_identity_model['id'] = '72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' @@ -56618,6 +60432,7 @@ def test_instance_template_prototype_instance_by_source_template_serialization(s instance_template_prototype_instance_by_source_template_model_json['volume_attachments'] = [volume_attachment_prototype_instance_context_model] instance_template_prototype_instance_by_source_template_model_json['vpc'] = vpc_identity_model instance_template_prototype_instance_by_source_template_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model + instance_template_prototype_instance_by_source_template_model_json['catalog_offering'] = instance_catalog_offering_prototype_model instance_template_prototype_instance_by_source_template_model_json['image'] = image_identity_model instance_template_prototype_instance_by_source_template_model_json['primary_network_interface'] = network_interface_prototype_model instance_template_prototype_instance_by_source_template_model_json['source_template'] = instance_template_identity_model @@ -56638,6 +60453,141 @@ 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_InstanceTemplateInstanceByCatalogOffering(): + """ + Test Class for InstanceTemplateInstanceByCatalogOffering + """ + + def test_instance_template_instance_by_catalog_offering_serialization(self): + """ + Test serialization/deserialization for InstanceTemplateInstanceByCatalogOffering + """ + + # 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'] = False + + 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' + + 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_ip'] = network_interface_ip_prototype_model + 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'] = 'cx2-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' + + 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'] = 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_prototype_instance_by_image_context_model['user_tags'] = ['testString'] + + 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 + + catalog_offering_identity_model = {} # CatalogOfferingIdentityCatalogOfferingByCRN + catalog_offering_identity_model['crn'] = 'crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:offering:00111601-0ec5-41ac-b142-96d1e64e6442' + + instance_catalog_offering_prototype_model = {} # InstanceCatalogOfferingPrototypeCatalogOfferingByOffering + instance_catalog_offering_prototype_model['offering'] = catalog_offering_identity_model + + zone_identity_model = {} # ZoneIdentityByName + zone_identity_model['name'] = 'us-south-1' + + # Construct a json representation of a InstanceTemplateInstanceByCatalogOffering model + instance_template_instance_by_catalog_offering_model_json = {} + instance_template_instance_by_catalog_offering_model_json['availability_policy'] = instance_availability_prototype_model + instance_template_instance_by_catalog_offering_model_json['created_at'] = '2019-01-01T12:00:00Z' + instance_template_instance_by_catalog_offering_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_template_instance_by_catalog_offering_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model + instance_template_instance_by_catalog_offering_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_template_instance_by_catalog_offering_model_json['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' + instance_template_instance_by_catalog_offering_model_json['keys'] = [key_identity_model] + instance_template_instance_by_catalog_offering_model_json['metadata_service'] = instance_metadata_service_prototype_model + instance_template_instance_by_catalog_offering_model_json['name'] = 'my-instance-template' + instance_template_instance_by_catalog_offering_model_json['network_interfaces'] = [network_interface_prototype_model] + instance_template_instance_by_catalog_offering_model_json['placement_target'] = instance_placement_target_prototype_model + instance_template_instance_by_catalog_offering_model_json['profile'] = instance_profile_identity_model + instance_template_instance_by_catalog_offering_model_json['resource_group'] = resource_group_reference_model + instance_template_instance_by_catalog_offering_model_json['total_volume_bandwidth'] = 500 + instance_template_instance_by_catalog_offering_model_json['user_data'] = 'testString' + instance_template_instance_by_catalog_offering_model_json['volume_attachments'] = [volume_attachment_prototype_instance_context_model] + instance_template_instance_by_catalog_offering_model_json['vpc'] = vpc_identity_model + instance_template_instance_by_catalog_offering_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model + instance_template_instance_by_catalog_offering_model_json['catalog_offering'] = instance_catalog_offering_prototype_model + instance_template_instance_by_catalog_offering_model_json['primary_network_interface'] = network_interface_prototype_model + instance_template_instance_by_catalog_offering_model_json['zone'] = zone_identity_model + + # Construct a model instance of InstanceTemplateInstanceByCatalogOffering by calling from_dict on the json representation + instance_template_instance_by_catalog_offering_model = InstanceTemplateInstanceByCatalogOffering.from_dict(instance_template_instance_by_catalog_offering_model_json) + assert instance_template_instance_by_catalog_offering_model != False + + # Construct a model instance of InstanceTemplateInstanceByCatalogOffering by calling from_dict on the json representation + instance_template_instance_by_catalog_offering_model_dict = InstanceTemplateInstanceByCatalogOffering.from_dict(instance_template_instance_by_catalog_offering_model_json).__dict__ + instance_template_instance_by_catalog_offering_model2 = InstanceTemplateInstanceByCatalogOffering(**instance_template_instance_by_catalog_offering_model_dict) + + # Verify the model instances are equivalent + assert instance_template_instance_by_catalog_offering_model == instance_template_instance_by_catalog_offering_model2 + + # Convert model instance back to dict and verify no loss of data + instance_template_instance_by_catalog_offering_model_json2 = instance_template_instance_by_catalog_offering_model.to_dict() + assert instance_template_instance_by_catalog_offering_model_json2 == instance_template_instance_by_catalog_offering_model_json + class TestModel_InstanceTemplateInstanceByImage(): """ Test Class for InstanceTemplateInstanceByImage @@ -56718,6 +60668,7 @@ def test_instance_template_instance_by_image_serialization(self): 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_prototype_instance_by_image_context_model['user_tags'] = ['testString'] volume_attachment_prototype_instance_by_image_context_model = {} # VolumeAttachmentPrototypeInstanceByImageContext volume_attachment_prototype_instance_by_image_context_model['delete_volume_on_instance_delete'] = True @@ -56853,6 +60804,7 @@ def test_instance_template_instance_by_source_snapshot_serialization(self): 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 + volume_prototype_instance_by_source_snapshot_context_model['user_tags'] = ['testString'] 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 @@ -57924,7 +61876,7 @@ def test_network_acl_prototype_network_acl_by_rules_serialization(self): vpc_identity_model = {} # VPCIdentityById vpc_identity_model['id'] = 'cf7cd5a-2f30-4336-a495-6addc820cd61' - network_acl_rule_prototype_network_acl_context_model = {} # NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP + network_acl_rule_prototype_network_acl_context_model = {} # NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype network_acl_rule_prototype_network_acl_context_model['action'] = 'allow' network_acl_rule_prototype_network_acl_context_model['destination'] = '192.168.3.2/32' network_acl_rule_prototype_network_acl_context_model['direction'] = 'inbound' @@ -58148,7 +62100,7 @@ def test_network_acl_rule_item_network_acl_rule_protocol_all_serialization(self) network_acl_rule_item_network_acl_rule_protocol_all_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9' network_acl_rule_item_network_acl_rule_protocol_all_model_json['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' network_acl_rule_item_network_acl_rule_protocol_all_model_json['ip_version'] = 'ipv4' - network_acl_rule_item_network_acl_rule_protocol_all_model_json['name'] = 'my-rule-2' + network_acl_rule_item_network_acl_rule_protocol_all_model_json['name'] = 'my-rule-1' network_acl_rule_item_network_acl_rule_protocol_all_model_json['source'] = '192.168.3.0/24' network_acl_rule_item_network_acl_rule_protocol_all_model_json['protocol'] = 'all' @@ -58198,7 +62150,7 @@ def test_network_acl_rule_item_network_acl_rule_protocol_icmp_serialization(self network_acl_rule_item_network_acl_rule_protocol_icmp_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9' network_acl_rule_item_network_acl_rule_protocol_icmp_model_json['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' network_acl_rule_item_network_acl_rule_protocol_icmp_model_json['ip_version'] = 'ipv4' - network_acl_rule_item_network_acl_rule_protocol_icmp_model_json['name'] = 'my-rule-2' + network_acl_rule_item_network_acl_rule_protocol_icmp_model_json['name'] = 'my-rule-1' network_acl_rule_item_network_acl_rule_protocol_icmp_model_json['source'] = '192.168.3.0/24' network_acl_rule_item_network_acl_rule_protocol_icmp_model_json['code'] = 0 network_acl_rule_item_network_acl_rule_protocol_icmp_model_json['protocol'] = 'icmp' @@ -58250,7 +62202,7 @@ def test_network_acl_rule_item_network_acl_rule_protocol_tcpudp_serialization(se network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9' network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json['ip_version'] = 'ipv4' - network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json['name'] = 'my-rule-2' + network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json['name'] = 'my-rule-1' network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json['source'] = '192.168.3.0/24' network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json['destination_port_max'] = 22 network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json['destination_port_min'] = 22 @@ -58273,122 +62225,122 @@ def test_network_acl_rule_item_network_acl_rule_protocol_tcpudp_serialization(se network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json2 = network_acl_rule_item_network_acl_rule_protocol_tcpudp_model.to_dict() assert network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json2 == network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json -class TestModel_NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAll(): +class TestModel_NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype(): """ - Test Class for NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAll + Test Class for NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype """ - def test_network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_serialization(self): + def test_network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_serialization(self): """ - Test serialization/deserialization for NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAll + Test serialization/deserialization for NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype """ - # Construct a json representation of a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAll model - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_model_json = {} - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_model_json['action'] = 'allow' - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_model_json['destination'] = '192.168.3.2/32' - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_model_json['direction'] = 'inbound' - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_model_json['name'] = 'my-rule-2' - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_model_json['source'] = '192.168.3.2/32' - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_model_json['protocol'] = 'all' + # Construct a json representation of a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype model + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model_json = {} + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model_json['action'] = 'allow' + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model_json['destination'] = '192.168.3.2/32' + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model_json['direction'] = 'inbound' + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model_json['name'] = 'my-rule-2' + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model_json['source'] = '192.168.3.2/32' + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model_json['protocol'] = 'all' - # Construct a model instance of NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAll by calling from_dict on the json representation - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_model = NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAll.from_dict(network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_model_json) - assert network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_model != False + # Construct a model instance of NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype by calling from_dict on the json representation + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model = NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype.from_dict(network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model_json) + assert network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model != False - # Construct a model instance of NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAll by calling from_dict on the json representation - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_model_dict = NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAll.from_dict(network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_model_json).__dict__ - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_model2 = NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAll(**network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_model_dict) + # Construct a model instance of NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype by calling from_dict on the json representation + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model_dict = NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype.from_dict(network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model_json).__dict__ + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model2 = NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype(**network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model_dict) # Verify the model instances are equivalent - assert network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_model == network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_model2 + assert network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model == network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model2 # Convert model instance back to dict and verify no loss of data - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_model_json2 = network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_model.to_dict() - assert network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_model_json2 == network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_model_json + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model_json2 = network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model.to_dict() + assert network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model_json2 == network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model_json -class TestModel_NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMP(): +class TestModel_NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype(): """ - Test Class for NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMP + Test Class for NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype """ - def test_network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_serialization(self): + def test_network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_serialization(self): """ - Test serialization/deserialization for NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMP + Test serialization/deserialization for NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype """ - # Construct a json representation of a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMP model - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_model_json = {} - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_model_json['action'] = 'allow' - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_model_json['destination'] = '192.168.3.2/32' - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_model_json['direction'] = 'inbound' - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_model_json['name'] = 'my-rule-2' - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_model_json['source'] = '192.168.3.2/32' - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_model_json['code'] = 0 - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_model_json['protocol'] = 'icmp' - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_model_json['type'] = 8 + # Construct a json representation of a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype model + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model_json = {} + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model_json['action'] = 'allow' + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model_json['destination'] = '192.168.3.2/32' + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model_json['direction'] = 'inbound' + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model_json['name'] = 'my-rule-2' + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model_json['source'] = '192.168.3.2/32' + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model_json['code'] = 0 + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model_json['protocol'] = 'icmp' + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model_json['type'] = 8 - # Construct a model instance of NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMP by calling from_dict on the json representation - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_model = NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMP.from_dict(network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_model_json) - assert network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_model != False + # Construct a model instance of NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype by calling from_dict on the json representation + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model = NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype.from_dict(network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model_json) + assert network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model != False - # Construct a model instance of NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMP by calling from_dict on the json representation - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_model_dict = NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMP.from_dict(network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_model_json).__dict__ - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_model2 = NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMP(**network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_model_dict) + # Construct a model instance of NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype by calling from_dict on the json representation + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model_dict = NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype.from_dict(network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model_json).__dict__ + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model2 = NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype(**network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model_dict) # Verify the model instances are equivalent - assert network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_model == network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_model2 + assert network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model == network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model2 # Convert model instance back to dict and verify no loss of data - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_model_json2 = network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_model.to_dict() - assert network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_model_json2 == network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_model_json + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model_json2 = network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model.to_dict() + assert network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model_json2 == network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model_json -class TestModel_NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP(): +class TestModel_NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype(): """ - Test Class for NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP + Test Class for NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype """ - def test_network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_serialization(self): + def test_network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_serialization(self): """ - Test serialization/deserialization for NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP + Test serialization/deserialization for NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype """ - # Construct a json representation of a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP model - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model_json = {} - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model_json['action'] = 'allow' - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model_json['destination'] = '192.168.3.2/32' - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model_json['direction'] = 'inbound' - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model_json['name'] = 'my-rule-2' - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model_json['source'] = '192.168.3.2/32' - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model_json['destination_port_max'] = 22 - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model_json['destination_port_min'] = 22 - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model_json['protocol'] = 'udp' - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model_json['source_port_max'] = 65535 - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model_json['source_port_min'] = 49152 + # Construct a json representation of a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype model + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model_json = {} + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model_json['action'] = 'allow' + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model_json['destination'] = '192.168.3.2/32' + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model_json['direction'] = 'inbound' + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model_json['name'] = 'my-rule-2' + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model_json['source'] = '192.168.3.2/32' + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model_json['destination_port_max'] = 22 + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model_json['destination_port_min'] = 22 + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model_json['protocol'] = 'udp' + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model_json['source_port_max'] = 65535 + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model_json['source_port_min'] = 49152 - # Construct a model instance of NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP by calling from_dict on the json representation - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model = NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP.from_dict(network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model_json) - assert network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model != False + # Construct a model instance of NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype by calling from_dict on the json representation + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model = NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype.from_dict(network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model_json) + assert network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model != False - # Construct a model instance of NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP by calling from_dict on the json representation - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model_dict = NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP.from_dict(network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model_json).__dict__ - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model2 = NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP(**network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model_dict) + # Construct a model instance of NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype by calling from_dict on the json representation + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model_dict = NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype.from_dict(network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model_json).__dict__ + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model2 = NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype(**network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model_dict) # Verify the model instances are equivalent - assert network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model == network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model2 + assert network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model == network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model2 # Convert model instance back to dict and verify no loss of data - network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model_json2 = network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model.to_dict() - assert network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model_json2 == network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_model_json + network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model_json2 = network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model.to_dict() + assert network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model_json2 == network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model_json -class TestModel_NetworkACLRulePrototypeNetworkACLRuleProtocolAll(): +class TestModel_NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype(): """ - Test Class for NetworkACLRulePrototypeNetworkACLRuleProtocolAll + Test Class for NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype """ - def test_network_acl_rule_prototype_network_acl_rule_protocol_all_serialization(self): + def test_network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_serialization(self): """ - Test serialization/deserialization for NetworkACLRulePrototypeNetworkACLRuleProtocolAll + Test serialization/deserialization for NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype """ # Construct dict forms of any model objects needed in order to build this model. @@ -58396,39 +62348,39 @@ def test_network_acl_rule_prototype_network_acl_rule_protocol_all_serialization( network_acl_rule_before_prototype_model = {} # NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById network_acl_rule_before_prototype_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' - # Construct a json representation of a NetworkACLRulePrototypeNetworkACLRuleProtocolAll model - network_acl_rule_prototype_network_acl_rule_protocol_all_model_json = {} - network_acl_rule_prototype_network_acl_rule_protocol_all_model_json['action'] = 'allow' - network_acl_rule_prototype_network_acl_rule_protocol_all_model_json['before'] = network_acl_rule_before_prototype_model - network_acl_rule_prototype_network_acl_rule_protocol_all_model_json['destination'] = '192.168.3.2/32' - network_acl_rule_prototype_network_acl_rule_protocol_all_model_json['direction'] = 'inbound' - network_acl_rule_prototype_network_acl_rule_protocol_all_model_json['name'] = 'my-rule-2' - network_acl_rule_prototype_network_acl_rule_protocol_all_model_json['source'] = '192.168.3.2/32' - network_acl_rule_prototype_network_acl_rule_protocol_all_model_json['protocol'] = 'all' + # Construct a json representation of a NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype model + network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model_json = {} + network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model_json['action'] = 'allow' + network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model_json['before'] = network_acl_rule_before_prototype_model + network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model_json['destination'] = '192.168.3.2/32' + network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model_json['direction'] = 'inbound' + network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model_json['name'] = 'my-rule-2' + network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model_json['source'] = '192.168.3.2/32' + network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model_json['protocol'] = 'all' - # Construct a model instance of NetworkACLRulePrototypeNetworkACLRuleProtocolAll by calling from_dict on the json representation - network_acl_rule_prototype_network_acl_rule_protocol_all_model = NetworkACLRulePrototypeNetworkACLRuleProtocolAll.from_dict(network_acl_rule_prototype_network_acl_rule_protocol_all_model_json) - assert network_acl_rule_prototype_network_acl_rule_protocol_all_model != False + # Construct a model instance of NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype by calling from_dict on the json representation + network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model = NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype.from_dict(network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model_json) + assert network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model != False - # Construct a model instance of NetworkACLRulePrototypeNetworkACLRuleProtocolAll by calling from_dict on the json representation - network_acl_rule_prototype_network_acl_rule_protocol_all_model_dict = NetworkACLRulePrototypeNetworkACLRuleProtocolAll.from_dict(network_acl_rule_prototype_network_acl_rule_protocol_all_model_json).__dict__ - network_acl_rule_prototype_network_acl_rule_protocol_all_model2 = NetworkACLRulePrototypeNetworkACLRuleProtocolAll(**network_acl_rule_prototype_network_acl_rule_protocol_all_model_dict) + # Construct a model instance of NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype by calling from_dict on the json representation + network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model_dict = NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype.from_dict(network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model_json).__dict__ + network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model2 = NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype(**network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model_dict) # Verify the model instances are equivalent - assert network_acl_rule_prototype_network_acl_rule_protocol_all_model == network_acl_rule_prototype_network_acl_rule_protocol_all_model2 + assert network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model == network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model2 # Convert model instance back to dict and verify no loss of data - network_acl_rule_prototype_network_acl_rule_protocol_all_model_json2 = network_acl_rule_prototype_network_acl_rule_protocol_all_model.to_dict() - assert network_acl_rule_prototype_network_acl_rule_protocol_all_model_json2 == network_acl_rule_prototype_network_acl_rule_protocol_all_model_json + network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model_json2 = network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model.to_dict() + assert network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model_json2 == network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model_json -class TestModel_NetworkACLRulePrototypeNetworkACLRuleProtocolICMP(): +class TestModel_NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype(): """ - Test Class for NetworkACLRulePrototypeNetworkACLRuleProtocolICMP + Test Class for NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype """ - def test_network_acl_rule_prototype_network_acl_rule_protocol_icmp_serialization(self): + def test_network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_serialization(self): """ - Test serialization/deserialization for NetworkACLRulePrototypeNetworkACLRuleProtocolICMP + Test serialization/deserialization for NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype """ # Construct dict forms of any model objects needed in order to build this model. @@ -58436,41 +62388,41 @@ def test_network_acl_rule_prototype_network_acl_rule_protocol_icmp_serialization network_acl_rule_before_prototype_model = {} # NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById network_acl_rule_before_prototype_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' - # Construct a json representation of a NetworkACLRulePrototypeNetworkACLRuleProtocolICMP model - network_acl_rule_prototype_network_acl_rule_protocol_icmp_model_json = {} - network_acl_rule_prototype_network_acl_rule_protocol_icmp_model_json['action'] = 'allow' - network_acl_rule_prototype_network_acl_rule_protocol_icmp_model_json['before'] = network_acl_rule_before_prototype_model - network_acl_rule_prototype_network_acl_rule_protocol_icmp_model_json['destination'] = '192.168.3.2/32' - network_acl_rule_prototype_network_acl_rule_protocol_icmp_model_json['direction'] = 'inbound' - network_acl_rule_prototype_network_acl_rule_protocol_icmp_model_json['name'] = 'my-rule-2' - network_acl_rule_prototype_network_acl_rule_protocol_icmp_model_json['source'] = '192.168.3.2/32' - network_acl_rule_prototype_network_acl_rule_protocol_icmp_model_json['code'] = 0 - network_acl_rule_prototype_network_acl_rule_protocol_icmp_model_json['protocol'] = 'icmp' - network_acl_rule_prototype_network_acl_rule_protocol_icmp_model_json['type'] = 8 + # Construct a json representation of a NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype model + network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model_json = {} + network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model_json['action'] = 'allow' + network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model_json['before'] = network_acl_rule_before_prototype_model + network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model_json['destination'] = '192.168.3.2/32' + network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model_json['direction'] = 'inbound' + network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model_json['name'] = 'my-rule-2' + network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model_json['source'] = '192.168.3.2/32' + network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model_json['code'] = 0 + network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model_json['protocol'] = 'icmp' + network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model_json['type'] = 8 - # Construct a model instance of NetworkACLRulePrototypeNetworkACLRuleProtocolICMP by calling from_dict on the json representation - network_acl_rule_prototype_network_acl_rule_protocol_icmp_model = NetworkACLRulePrototypeNetworkACLRuleProtocolICMP.from_dict(network_acl_rule_prototype_network_acl_rule_protocol_icmp_model_json) - assert network_acl_rule_prototype_network_acl_rule_protocol_icmp_model != False + # Construct a model instance of NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype by calling from_dict on the json representation + network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model = NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype.from_dict(network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model_json) + assert network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model != False - # Construct a model instance of NetworkACLRulePrototypeNetworkACLRuleProtocolICMP by calling from_dict on the json representation - network_acl_rule_prototype_network_acl_rule_protocol_icmp_model_dict = NetworkACLRulePrototypeNetworkACLRuleProtocolICMP.from_dict(network_acl_rule_prototype_network_acl_rule_protocol_icmp_model_json).__dict__ - network_acl_rule_prototype_network_acl_rule_protocol_icmp_model2 = NetworkACLRulePrototypeNetworkACLRuleProtocolICMP(**network_acl_rule_prototype_network_acl_rule_protocol_icmp_model_dict) + # Construct a model instance of NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype by calling from_dict on the json representation + network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model_dict = NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype.from_dict(network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model_json).__dict__ + network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model2 = NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype(**network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model_dict) # Verify the model instances are equivalent - assert network_acl_rule_prototype_network_acl_rule_protocol_icmp_model == network_acl_rule_prototype_network_acl_rule_protocol_icmp_model2 + assert network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model == network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model2 # Convert model instance back to dict and verify no loss of data - network_acl_rule_prototype_network_acl_rule_protocol_icmp_model_json2 = network_acl_rule_prototype_network_acl_rule_protocol_icmp_model.to_dict() - assert network_acl_rule_prototype_network_acl_rule_protocol_icmp_model_json2 == network_acl_rule_prototype_network_acl_rule_protocol_icmp_model_json + network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model_json2 = network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model.to_dict() + assert network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model_json2 == network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model_json -class TestModel_NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDP(): +class TestModel_NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype(): """ - Test Class for NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDP + Test Class for NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype """ - def test_network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_serialization(self): + def test_network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_serialization(self): """ - Test serialization/deserialization for NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDP + Test serialization/deserialization for NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype """ # Construct dict forms of any model objects needed in order to build this model. @@ -58478,34 +62430,34 @@ def test_network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_serializati network_acl_rule_before_prototype_model = {} # NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById network_acl_rule_before_prototype_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' - # Construct a json representation of a NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDP model - network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model_json = {} - network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model_json['action'] = 'allow' - network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model_json['before'] = network_acl_rule_before_prototype_model - network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model_json['destination'] = '192.168.3.2/32' - network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model_json['direction'] = 'inbound' - network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model_json['name'] = 'my-rule-2' - network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model_json['source'] = '192.168.3.2/32' - network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model_json['destination_port_max'] = 22 - network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model_json['destination_port_min'] = 22 - network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model_json['protocol'] = 'udp' - network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model_json['source_port_max'] = 65535 - network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model_json['source_port_min'] = 49152 + # Construct a json representation of a NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype model + network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model_json = {} + network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model_json['action'] = 'allow' + network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model_json['before'] = network_acl_rule_before_prototype_model + network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model_json['destination'] = '192.168.3.2/32' + network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model_json['direction'] = 'inbound' + network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model_json['name'] = 'my-rule-2' + network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model_json['source'] = '192.168.3.2/32' + network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model_json['destination_port_max'] = 22 + network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model_json['destination_port_min'] = 22 + network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model_json['protocol'] = 'udp' + network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model_json['source_port_max'] = 65535 + network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model_json['source_port_min'] = 49152 - # Construct a model instance of NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDP by calling from_dict on the json representation - network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model = NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDP.from_dict(network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model_json) - assert network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model != False + # Construct a model instance of NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype by calling from_dict on the json representation + network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model = NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype.from_dict(network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model_json) + assert network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model != False - # Construct a model instance of NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDP by calling from_dict on the json representation - network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model_dict = NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDP.from_dict(network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model_json).__dict__ - network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model2 = NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDP(**network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model_dict) + # Construct a model instance of NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype by calling from_dict on the json representation + network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model_dict = NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype.from_dict(network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model_json).__dict__ + network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model2 = NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype(**network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model_dict) # Verify the model instances are equivalent - assert network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model == network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model2 + assert network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model == network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model2 # Convert model instance back to dict and verify no loss of data - network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model_json2 = network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model.to_dict() - assert network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model_json2 == network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_model_json + network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model_json2 = network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model.to_dict() + assert network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model_json2 == network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model_json class TestModel_NetworkACLRuleNetworkACLRuleProtocolAll(): """ @@ -58538,7 +62490,7 @@ def test_network_acl_rule_network_acl_rule_protocol_all_serialization(self): network_acl_rule_network_acl_rule_protocol_all_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9' network_acl_rule_network_acl_rule_protocol_all_model_json['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' network_acl_rule_network_acl_rule_protocol_all_model_json['ip_version'] = 'ipv4' - network_acl_rule_network_acl_rule_protocol_all_model_json['name'] = 'my-rule-2' + network_acl_rule_network_acl_rule_protocol_all_model_json['name'] = 'my-rule-1' network_acl_rule_network_acl_rule_protocol_all_model_json['source'] = '192.168.3.0/24' network_acl_rule_network_acl_rule_protocol_all_model_json['protocol'] = 'all' @@ -58588,7 +62540,7 @@ def test_network_acl_rule_network_acl_rule_protocol_icmp_serialization(self): network_acl_rule_network_acl_rule_protocol_icmp_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9' network_acl_rule_network_acl_rule_protocol_icmp_model_json['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' network_acl_rule_network_acl_rule_protocol_icmp_model_json['ip_version'] = 'ipv4' - network_acl_rule_network_acl_rule_protocol_icmp_model_json['name'] = 'my-rule-2' + network_acl_rule_network_acl_rule_protocol_icmp_model_json['name'] = 'my-rule-1' network_acl_rule_network_acl_rule_protocol_icmp_model_json['source'] = '192.168.3.0/24' network_acl_rule_network_acl_rule_protocol_icmp_model_json['code'] = 0 network_acl_rule_network_acl_rule_protocol_icmp_model_json['protocol'] = 'icmp' @@ -58640,7 +62592,7 @@ def test_network_acl_rule_network_acl_rule_protocol_tcpudp_serialization(self): network_acl_rule_network_acl_rule_protocol_tcpudp_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9' network_acl_rule_network_acl_rule_protocol_tcpudp_model_json['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9' network_acl_rule_network_acl_rule_protocol_tcpudp_model_json['ip_version'] = 'ipv4' - network_acl_rule_network_acl_rule_protocol_tcpudp_model_json['name'] = 'my-rule-2' + network_acl_rule_network_acl_rule_protocol_tcpudp_model_json['name'] = 'my-rule-1' network_acl_rule_network_acl_rule_protocol_tcpudp_model_json['source'] = '192.168.3.0/24' network_acl_rule_network_acl_rule_protocol_tcpudp_model_json['destination_port_max'] = 22 network_acl_rule_network_acl_rule_protocol_tcpudp_model_json['destination_port_min'] = 22 @@ -61191,6 +65143,17 @@ def test_vpn_gateway_policy_mode_serialization(self): subnet_reference_model['name'] = 'my-subnet' subnet_reference_model['resource_type'] = 'subnet' + vpc_reference_deleted_model = {} # VPCReferenceDeleted + vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + vpc_reference_model = {} # VPCReference + vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model['deleted'] = vpc_reference_deleted_model + vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model['name'] = 'my-vpc' + vpc_reference_model['resource_type'] = 'vpc' + # Construct a json representation of a VPNGatewayPolicyMode model vpn_gateway_policy_mode_model_json = {} vpn_gateway_policy_mode_model_json['connections'] = [vpn_gateway_connection_reference_model] @@ -61204,6 +65167,7 @@ def test_vpn_gateway_policy_mode_serialization(self): vpn_gateway_policy_mode_model_json['resource_type'] = 'vpn_gateway' vpn_gateway_policy_mode_model_json['status'] = 'available' vpn_gateway_policy_mode_model_json['subnet'] = subnet_reference_model + vpn_gateway_policy_mode_model_json['vpc'] = vpc_reference_model vpn_gateway_policy_mode_model_json['mode'] = 'policy' # Construct a model instance of VPNGatewayPolicyMode by calling from_dict on the json representation @@ -61348,6 +65312,17 @@ def test_vpn_gateway_route_mode_serialization(self): subnet_reference_model['name'] = 'my-subnet' subnet_reference_model['resource_type'] = 'subnet' + vpc_reference_deleted_model = {} # VPCReferenceDeleted + vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + vpc_reference_model = {} # VPCReference + vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model['deleted'] = vpc_reference_deleted_model + vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model['name'] = 'my-vpc' + vpc_reference_model['resource_type'] = 'vpc' + # Construct a json representation of a VPNGatewayRouteMode model vpn_gateway_route_mode_model_json = {} vpn_gateway_route_mode_model_json['connections'] = [vpn_gateway_connection_reference_model] @@ -61361,6 +65336,7 @@ def test_vpn_gateway_route_mode_serialization(self): vpn_gateway_route_mode_model_json['resource_type'] = 'vpn_gateway' vpn_gateway_route_mode_model_json['status'] = 'available' vpn_gateway_route_mode_model_json['subnet'] = subnet_reference_model + vpn_gateway_route_mode_model_json['vpc'] = vpc_reference_model vpn_gateway_route_mode_model_json['mode'] = 'route' # Construct a model instance of VPNGatewayRouteMode by calling from_dict on the json representation @@ -63698,6 +67674,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_capacity_model_json['iops'] = 10000 volume_attachment_prototype_volume_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_capacity_model_json['name'] = 'my-volume' volume_attachment_prototype_volume_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_capacity_model_json['profile'] = volume_profile_identity_model + volume_attachment_prototype_volume_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_capacity_model_json['user_tags'] = ['testString'] volume_attachment_prototype_volume_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_capacity_model_json['capacity'] = 100 volume_attachment_prototype_volume_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_capacity_model_json['encryption_key'] = encryption_key_identity_model @@ -63742,6 +67719,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['user_tags'] = ['testString'] 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 @@ -63871,6 +67849,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_capacity_model_json['iops'] = 10000 volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_capacity_model_json['name'] = 'my-volume' volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_capacity_model_json['profile'] = volume_profile_identity_model + volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_capacity_model_json['user_tags'] = ['testString'] volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_capacity_model_json['capacity'] = 100 volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_capacity_model_json['encryption_key'] = encryption_key_identity_model @@ -63915,6 +67894,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['user_tags'] = ['testString'] 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