From b72e42670e0cb8d49aa19b4c52d2a9cb4634b242 Mon Sep 17 00:00:00 2001 From: Deepak Selvakumar Date: Sun, 25 Dec 2022 12:40:30 +0530 Subject: [PATCH] feat(2022-12-21): Update SDK to use API generated on 2022-12-21 Signed-off-by: Deepak Selvakumar --- .travis.yml | 2 +- ibm_vpc/vpc_v1.py | 8217 +++++++++++++++++++++++---------- test/integration/test_gen2.py | 42 +- test/unit/test_vpc_v1.py | 1427 ++++-- 4 files changed, 6647 insertions(+), 3041 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7eaf632..9b053ee 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,7 +20,7 @@ before_install: - pip install pypandoc install: -- pip install tox-travis +- pip install tox-travis 'tox<4' script: tox diff --git a/ibm_vpc/vpc_v1.py b/ibm_vpc/vpc_v1.py index b89b1f8..6129db8 100644 --- a/ibm_vpc/vpc_v1.py +++ b/ibm_vpc/vpc_v1.py @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -# IBM OpenAPI SDK Code Generator Version: 3.57.0-b6d48d21-20220921-194423 +# IBM OpenAPI SDK Code Generator Version: 3.62.2-e5d4c32b-20221214-193750 """ The IBM Cloud Virtual Private Cloud (VPC) API can be used to programmatically provision @@ -29,6 +29,7 @@ from typing import Dict, List import base64 import json +import logging import sys from ibm_cloud_sdk_core import BaseService, DetailedResponse, get_query_param @@ -59,7 +60,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-10-13` and today's + behavior documented here, specify any date between `2022-09-13` and today's date (UTC). """ if version is None: @@ -83,7 +84,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-10-13` and today's + behavior documented here, specify any date between `2022-09-13` and today's date (UTC). :param Authenticator authenticator: The authenticator specifies the authentication mechanism. @@ -179,9 +180,10 @@ def create_vpc(self, necessary to create the new VPC. :param str address_prefix_management: (optional) Indicates whether a - default address prefix will be automatically created for each zone in this - VPC. If `manual`, this VPC will be created with no default address - prefixes. + [default address + prefix](https://cloud.ibm.com/docs/vpc?topic=vpc-configuring-address-prefixes) + will be automatically created for each zone in this VPC. If `manual`, this + VPC will be created with no default address prefixes. Since address prefixes are managed identically regardless of whether they were automatically created, the value is not preserved as a VPC property. :param bool classic_access: (optional) Indicates whether this VPC will be @@ -189,8 +191,9 @@ def create_vpc(self, have private network connectivity to the account's Classic Infrastructure resources. Only one VPC, per region, may be connected in this way. This value is set at creation and subsequently immutable. - :param str name: (optional) The unique user-defined name for this VPC. If - unspecified, the name will be a hyphenated list of randomly-selected words. + :param str name: (optional) The name for this VPC. The name must not be + used by another VPC in the region. If unspecified, the name will be a + hyphenated list of randomly-selected words. :param ResourceGroupIdentity resource_group: (optional) The resource group to use. If unspecified, the account's [default resource group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is @@ -447,8 +450,7 @@ def get_vpc_default_routing_table(self, This request retrieves the default routing table for the VPC specified by the identifier in the URL. The default routing table is associated with any subnets in - the VPC which have not been explicitly associated with a user-defined routing - table. + the VPC which have not been explicitly associated with another routing table. :param str id: The VPC identifier. :param dict headers: A `dict` containing the request headers @@ -621,9 +623,9 @@ def create_vpc_address_prefix(self, :param bool is_default: (optional) Indicates whether this will be the default address prefix for this zone in this VPC. If `true`, the VPC must not have a default address prefix for this zone. - :param str name: (optional) The user-defined name for this address prefix. - Names must be unique within the VPC the address prefix resides in. If - unspecified, the name will be a hyphenated list of randomly-selected words. + :param str name: (optional) The name for this address prefix. The name must + not be used by another address prefix for the VPC. If unspecified, the name + will be a hyphenated list of randomly-selected words. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `AddressPrefix` object @@ -864,8 +866,12 @@ def list_vpc_routes(self, :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 `RouteCollection` object + + Deprecated: this method is deprecated and may be removed in a future release. """ + logging.warning('A deprecated operation has been invoked: list_vpc_routes') + if not vpc_id: raise ValueError('vpc_id must be provided') headers = {} @@ -932,17 +938,22 @@ def create_vpc_route(self, 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 - 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. + :param str name: (optional) The name for this route. The name must not be + used by another route in the routing table. Names starting with `ibm-` are + reserved for system-provided routes, and are not allowed. If unspecified, + the name will be a hyphenated list of randomly-selected words. :param RoutePrototypeNextHop next_hop: (optional) If `action` is `deliver`, the next hop that packets will be delivered to. For other `action` values, it must be omitted or specified as `0.0.0.0`. :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 `Route` object + + Deprecated: this method is deprecated and may be removed in a future release. """ + logging.warning('A deprecated operation has been invoked: create_vpc_route') + if not vpc_id: raise ValueError('vpc_id must be provided') if destination is None: @@ -1008,8 +1019,12 @@ def delete_vpc_route(self, :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse + + Deprecated: this method is deprecated and may be removed in a future release. """ + logging.warning('A deprecated operation has been invoked: delete_vpc_route') + if not vpc_id: raise ValueError('vpc_id must be provided') if not id: @@ -1057,8 +1072,12 @@ def get_vpc_route(self, :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 `Route` object + + Deprecated: this method is deprecated and may be removed in a future release. """ + logging.warning('A deprecated operation has been invoked: get_vpc_route') + if not vpc_id: raise ValueError('vpc_id must be provided') if not id: @@ -1111,8 +1130,12 @@ def update_vpc_route(self, :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 `Route` object + + Deprecated: this method is deprecated and may be removed in a future release. """ + logging.warning('A deprecated operation has been invoked: update_vpc_route') + if not vpc_id: raise ValueError('vpc_id must be provided') if not id: @@ -1165,12 +1188,12 @@ def list_vpc_routing_tables(self, """ List all routing tables for a VPC. - This request lists all user-defined routing tables for a VPC. Each subnet in a - VPC is associated with a routing table, which controls delivery of packets sent on - that subnet according to the action of the most specific matching route in the - table. If multiple equally-specific routes exist, traffic will be distributed - across them. If no routes match, delivery will be controlled by the system's - built-in routes. + This request lists all routing tables for a VPC. Each subnet in a VPC is + associated with a routing table, which controls delivery of packets sent on that + subnet according to the action of the most specific matching route in the table. + If multiple equally-specific routes exist, traffic will be distributed across + them. If no routes match, delivery will be controlled by the system's built-in + routes. :param str vpc_id: The VPC identifier. :param str start: (optional) A server-provided token determining what @@ -1232,9 +1255,9 @@ def create_vpc_routing_table(self, """ Create a routing table for a VPC. - This request creates a user-defined routing table from a routing table prototype - object. The prototype object is structured in the same way as a retrieved routing - table, and contains the information necessary to create the new routing table. + This request creates a routing table from a routing table prototype object. The + prototype object is structured in the same way as a retrieved routing table, and + contains the information necessary to create the new routing table. :param str vpc_id: The VPC identifier. :param List[ResourceFilter] accept_routes_from: (optional) The filters @@ -1242,9 +1265,9 @@ def create_vpc_routing_table(self, 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. - :param str name: (optional) The user-defined name for this routing table. - Names must be unique within the VPC the routing table resides in. If - unspecified, the name will be a hyphenated list of randomly-selected words. + :param str name: (optional) The name for this routing table. The name must + not be used by another routing table in the VPC. If 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. The VPC must not already @@ -1626,9 +1649,10 @@ def create_vpc_routing_table_route(self, 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 - 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. + :param str name: (optional) The name for this route. The name must not be + used by another route in the routing table. Names starting with `ibm-` are + reserved for system-provided routes, and are not allowed. If unspecified, + the name will be a hyphenated list of randomly-selected words. :param RoutePrototypeNextHop next_hop: (optional) If `action` is `deliver`, the next hop that packets will be delivered to. For other `action` values, it must be omitted or specified as `0.0.0.0`. @@ -2586,10 +2610,10 @@ def create_subnet_reserved_ip(self, member will be automatically deleted when either `target` is deleted, or the reserved IP is unbound. Must be `false` if the reserved IP is unbound. - :param str name: (optional) The user-defined name for this reserved IP. If + :param str name: (optional) The name for this reserved IP. The name must + not be used by another reserved IP in the subnet. Names starting with + `ibm-` are reserved for provider-owned resources, and are not allowed. If unspecified, the name will be a hyphenated list of randomly-selected words. - 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 to bind this reserved IP to. The target must be in the same VPC. At present, only endpoint gateway targets are supported. The endpoint @@ -3253,8 +3277,9 @@ def create_key(self, (consisting of three space-separated fields: the algorithm name, base64-encoded key, and a comment). The algorithm and comment fields may be omitted, as only the key field is imported. - :param str name: (optional) The unique user-defined name for this key. If - unspecified, the name will be a hyphenated list of randomly-selected words. + :param str name: (optional) The name for this key. The name must not be + used by another key in the region. If unspecified, the name will be a + hyphenated list of randomly-selected words. :param ResourceGroupIdentity resource_group: (optional) The resource group to use. If unspecified, the account's [default resource group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is @@ -4502,10 +4527,9 @@ def create_instance_network_interface(self, 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 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 str name: (optional) The name for network interface. The name must + not be used by another network interface on the virtual server instance. 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. @@ -5137,12 +5161,11 @@ def create_instance_volume_attachment(self, :param str instance_id: The instance identifier. :param VolumeAttachmentPrototypeVolume volume: An existing volume to attach to the instance, or a prototype object for a new volume. - :param bool delete_volume_on_instance_delete: (optional) If set to true, - when deleting the instance the volume will also be deleted. - :param str name: (optional) The user-defined name for this volume - attachment. Names must be unique within the instance the volume attachment - resides in. If unspecified, the name will be a hyphenated list of - randomly-selected words. + :param bool delete_volume_on_instance_delete: (optional) Indicates whether + deleting the instance will also delete the attached volume. + :param str name: (optional) The name for this volume attachment. The name + must not be used by another volume attachment on the instance. If + unspecified, the name will be a hyphenated list of randomly-selected words. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `VolumeAttachment` object @@ -5438,10 +5461,8 @@ def create_instance_group(self, 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 `load_balancer_pool`. - This property must be specified if and only if `load_balancer_pool` has - been - specified. + associated with the specified load balancer pool. + Required if `load_balancer_pool` is specified. At present, only load balancers in the `application` family are supported. :param LoadBalancerPoolIdentity load_balancer_pool: (optional) If specified, the load balancer pool this instance group will manage. A pool @@ -5451,9 +5472,9 @@ def create_instance_group(self, 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 - group. If unspecified, the name will be a hyphenated list of - randomly-selected words. + :param str name: (optional) The name for this instance group. The name must + not be used by another instance group in the region. If unspecified, the + name will be a hyphenated list of randomly-selected words. :param ResourceGroupIdentity resource_group: (optional) The resource group to use. If unspecified, the account's [default resource group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is @@ -6934,9 +6955,9 @@ def create_dedicated_host_group(self, in this group. :param ZoneIdentity zone: (optional) The zone this dedicated host group will reside in. - :param str name: (optional) The unique user-defined name for this dedicated - host group. If unspecified, the name will be a hyphenated list of - randomly-selected words. + :param str name: (optional) The name for this dedicated host group. The + name must not be used by another dedicated host group in the region. If + unspecified, the name will be a hyphenated list of randomly-selected words. :param ResourceGroupIdentity resource_group: (optional) The resource group to use. If unspecified, the account's [default resource group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is @@ -7749,9 +7770,9 @@ def create_backup_policy(self, :param List[str] match_resource_types: (optional) A resource type this backup policy applies to. Resources that have both a matching type and a matching user tag will be subject to the backup policy. - :param str name: (optional) The user-defined name for this backup policy. - Names must be unique within the region this backup policy resides in. If - unspecified, the name will be a hyphenated list of randomly-selected words. + :param str name: (optional) The name for this backup policy. The name must + not be used by another backup policy in the region. If unspecified, the + name will be a hyphenated list of randomly-selected words. :param List[BackupPolicyPlanPrototype] plans: (optional) The prototype objects for backup plans to be created for this backup policy. :param ResourceGroupIdentity resource_group: (optional) The resource group @@ -7805,6 +7826,139 @@ def create_backup_policy(self, return response + def list_backup_policy_jobs(self, + backup_policy_id: str, + *, + status: str = None, + backup_policy_plan_id: str = None, + start: str = None, + limit: int = None, + sort: str = None, + source_id: str = None, + target_snapshots_id: str = None, + target_snapshots_crn: str = None, + **kwargs + ) -> DetailedResponse: + """ + List all jobs for a backup policy. + + This request retrieves all jobs for a backup policy. A backup job represents the + execution of a backup policy plan for a resource matching the policy's criteria. + + :param str backup_policy_id: The backup policy identifier. + :param str status: (optional) Filters the collection to backup policy jobs + with the specified status. + :param str backup_policy_plan_id: (optional) Filters the collection to + backup policy jobs with the backup plan with the specified identifier. + :param str start: (optional) A server-provided token determining what + resource to start the page on. + :param int limit: (optional) The number of resources to return on a page. + :param str sort: (optional) Sorts the returned collection by the specified + property name in ascending order. A `-` may be prepended to the name to + sort in descending order. For example, the value `-created_at` sorts the + collection by the `created_at` property in descending order, and the value + `name` sorts it by the `name` property in ascending order. + :param str source_id: (optional) Filters the collection to backup policy + jobs with a source with the specified identifier. + :param str target_snapshots_id: (optional) Filters the collection to + resources with the target snapshot with the specified identifier. + :param str target_snapshots_crn: (optional) Filters the collection to + backup policy jobs with the target snapshot with the specified CRN. + :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 `BackupPolicyJobCollection` object + """ + + 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, + service_version='V1', + operation_id='list_backup_policy_jobs') + headers.update(sdk_headers) + + params = { + 'version': self.version, + 'generation': self.generation, + 'status': status, + 'backup_policy_plan.id': backup_policy_plan_id, + 'start': start, + 'limit': limit, + 'sort': sort, + 'source.id': source_id, + 'target_snapshots[].id': target_snapshots_id, + 'target_snapshots[].crn': target_snapshots_crn + } + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' + + path_param_keys = ['backup_policy_id'] + path_param_values = self.encode_path_vars(backup_policy_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/backup_policies/{backup_policy_id}/jobs'.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_backup_policy_job(self, + backup_policy_id: str, + id: str, + **kwargs + ) -> DetailedResponse: + """ + Retrieve a backup policy job. + + This request retrieves a single backup policy job specified by the identifier in + the URL. + + :param str backup_policy_id: The backup policy identifier. + :param str id: The backup policy job 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 `BackupPolicyJob` object + """ + + if not backup_policy_id: + raise ValueError('backup_policy_id must be provided') + if not id: + raise ValueError('id must be provided') + headers = {} + sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_backup_policy_job') + 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 = ['backup_policy_id', 'id'] + path_param_values = self.encode_path_vars(backup_policy_id, id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/backup_policies/{backup_policy_id}/jobs/{id}'.format(**path_param_dict) + request = self.prepare_request(method='GET', + url=url, + headers=headers, + params=params) + + response = self.send(request, **kwargs) + return response + + def list_backup_policy_plans(self, backup_policy_id: str, *, @@ -7895,10 +8049,9 @@ def create_backup_policy_plan(self, source's user tags to the created backups (snapshots). :param BackupPolicyPlanDeletionTriggerPrototype deletion_trigger: (optional) - :param str name: (optional) The user-defined name for this backup policy - plan. Names must be unique within the backup policy this plan resides in. - If unspecified, the name will be a hyphenated list of randomly-selected - words. + :param str name: (optional) The name for this backup policy plan. The name + must not be used by another plan for the backup policy. If unspecified, the + name will be a hyphenated list of randomly-selected words. :param 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 `BackupPolicyPlan` object @@ -8372,9 +8525,9 @@ def create_placement_group(self, processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the placement group on which the unexpected strategy was encountered. - :param str name: (optional) The unique user-defined name for this placement - group. If unspecified, the name will be a hyphenated list of - randomly-selected words. + :param str name: (optional) The name for this placement group. The name + must not be used by another placement group in the region. If unspecified, + the name will be a hyphenated list of randomly-selected words. :param ResourceGroupIdentity resource_group: (optional) The resource group to use. If unspecified, the account's [default resource group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is @@ -8785,9 +8938,10 @@ def create_bare_metal_server(self, [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 - be a hyphenated list of randomly-selected words. + :param str name: (optional) The name for this bare metal server. The name + must not be used by another bare metal server in the region. If + unspecified, the name will be a hyphenated list of randomly-selected words. + The system hostname will be based on this name. :param List[BareMetalServerNetworkInterfacePrototype] network_interfaces: (optional) The additional network interfaces to create for the bare metal server. @@ -11055,9 +11209,9 @@ def create_public_gateway(self, :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. - Names must be unique within the VPC the public gateway resides in. If - unspecified, the name will be a hyphenated list of randomly-selected words. + :param str name: (optional) The name for this public gateway. The name must + not be used by another public gateway in the VPC. If unspecified, the name + will be a hyphenated list of randomly-selected words. :param ResourceGroupIdentity resource_group: (optional) The resource group to use. If unspecified, the account's [default resource group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is @@ -12160,9 +12314,9 @@ def create_security_group(self, network interfaces on instances in that VPC can be added to the security group. :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. + :param str name: (optional) The name for this security group. The name must + not be used by another security group for the VPC. If unspecified, the name + will be a hyphenated list of randomly-selected words. :param ResourceGroupIdentity resource_group: (optional) The resource group to use. If unspecified, the account's [default resource group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is @@ -12715,7 +12869,8 @@ def delete_security_group_target_binding(self, This request removes a target from a security group. For this request to succeed, the target must be attached to at least one other security group. The specified target identifier can be: - - A network interface identifier + - An instance network interface identifier + - A bare metal server network interface identifier - A VPN server identifier - An application load balancer identifier - An endpoint gateway identifier @@ -12822,7 +12977,8 @@ def create_security_group_target_binding(self, This request adds a resource to an existing security group. The specified target identifier can be: - - A network interface identifier + - An instance network interface identifier + - A bare metal server network interface identifier - A VPN server identifier - An application load balancer identifier - An endpoint gateway identifier @@ -12944,7 +13100,9 @@ def create_ike_policy(self, 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. + :param str name: (optional) The name for this IKE policy. The name must not + be used by another IKE policies in the region. If unspecified, the name + will be a hyphenated list of randomly-selected words. :param ResourceGroupIdentity resource_group: (optional) The resource group to use. If unspecified, the account's [default resource group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is @@ -13273,7 +13431,9 @@ def create_ipsec_policy(self, :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 str name: (optional) The name for this IPsec policy. The name must + not be used by another IPsec policies in the region. If unspecified, the + name will be a hyphenated list of randomly-selected words. :param ResourceGroupIdentity resource_group: (optional) The resource group to use. If unspecified, the account's [default resource group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is @@ -14629,9 +14789,9 @@ def create_vpn_server(self, the server from disconnecting idle clients. :param bool enable_split_tunneling: (optional) Indicates whether the split tunneling is enabled on this VPN server. - :param str name: (optional) The user-defined name for this VPN server. If - unspecified, the name will be a hyphenated list of randomly-selected words. - Names must be unique within the VPC this VPN server is serving. + :param str name: (optional) The name for this VPN server. The name must not + be used by another VPN server in the VPC. If unspecified, the name will be + a hyphenated list of randomly-selected words. :param int port: (optional) The port number to use for this VPN server. :param str protocol: (optional) The transport protocol to use for this VPN server. @@ -15228,9 +15388,9 @@ def create_vpn_server_route(self, future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the VPN route on which the unexpected property value was encountered. - :param str name: (optional) The user-defined name for this VPN route. If - unspecified, the name will be a hyphenated list of randomly-selected words. - Names must be unique within the VPN server the VPN route resides in. + :param str name: (optional) The name for this VPN server route. The name + must not be used by another route for the VPN server. If unspecified, the + name will be a hyphenated list of randomly-selected words. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `VPNServerRoute` object @@ -15622,9 +15782,9 @@ def create_load_balancer(self, 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 str name: (optional) The name for this load balancer. The name must + not be used by another load balancer in the VPC. If unspecified, the name + will be a hyphenated list of randomly-selected words. :param List[LoadBalancerPoolPrototype] pools: (optional) The pools of this load balancer. :param LoadBalancerProfileIdentity profile: (optional) The profile to use @@ -16029,7 +16189,9 @@ def create_load_balancer_listener(self, `protocol` of `http`, and the target listener must have a `protocol` of `https`. :param List[LoadBalancerListenerPolicyPrototype] policies: (optional) The - policy prototype objects for this listener. + policy prototype objects for this listener. The load balancer must be in + the + `application` family. :param int port: (optional) The listener port number, or the inclusive lower bound of the port range. Each listener in the load balancer must have a unique `port` and `protocol` combination. @@ -16352,8 +16514,9 @@ def create_load_balancer_listener_policy(self, which the unexpected property value was encountered. :param int priority: Priority of the policy. Lower value indicates higher priority. - :param str name: (optional) The user-defined name for this policy. Names - must be unique within the load balancer listener the policy resides in. + :param str name: (optional) The name for this policy. The name must not be + used by another policy for the load balancer listener. If unspecified, the + name will be a hyphenated list of randomly-selected words. :param List[LoadBalancerListenerPolicyRulePrototype] rules: (optional) The rule prototype objects for this policy. :param LoadBalancerListenerPolicyTargetPrototype target: (optional) - If @@ -16996,9 +17159,9 @@ def create_load_balancer_pool(self, members for this load balancer pool. For load balancers in the `network` family, the same `port` and `target` tuple cannot be shared by a pool member of any other load balancer in the same VPC. - :param str name: (optional) The user-defined name for this load balancer - pool. If unspecified, the name will be a hyphenated list of - randomly-selected words. + :param str name: (optional) The name for this load balancer pool. The name + must not be used by another pool for the load balancer. If unspecified, the + name will be a hyphenated list of randomly-selected words. :param str proxy_protocol: (optional) The PROXY protocol setting for this pool: - `v1`: Enabled with version 1 (human-readable header format) @@ -17688,10 +17851,9 @@ def create_endpoint_gateway(self, :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 - gateway. If unspecified, the name will be a hyphenated list of - randomly-selected words. Names must be unique within the VPC this endpoint - gateway is serving. + :param str name: (optional) The name for this endpoint gateway. The name + must not be used by another endpoint gateway in the VPC. If unspecified, + the name will be a hyphenated list of randomly-selected words. :param ResourceGroupIdentity resource_group: (optional) The resource group to use. If unspecified, the account's [default resource group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is @@ -18234,9 +18396,9 @@ def create_flow_log_collector(self, collector. :param bool active: (optional) Indicates whether this collector will be active upon creation. - :param str name: (optional) The unique user-defined name for this flow log - collector. If unspecified, the name will be a hyphenated list of - randomly-selected words. + :param str name: (optional) The name for this flow log collector. The name + must not be used by another flow log collector in the region. If + unspecified, the name will be a hyphenated list of randomly-selected words. :param ResourceGroupIdentity resource_group: (optional) The resource group to use. If unspecified, the account's [default resource group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is @@ -18478,6 +18640,23 @@ class Visibility(str, Enum): PUBLIC = 'public' +class ListBackupPolicyJobsEnums: + """ + Enums for list_backup_policy_jobs parameters. + """ + + class Sort(str, Enum): + """ + Sorts the returned collection by the specified property name in ascending order. A + `-` may be prepended to the name to sort in descending order. For example, the + value `-created_at` sorts the collection by the `created_at` property in + descending order, and the value `name` sorts it by the `name` property in + ascending order. + """ + CREATED_AT = 'created_at' + NAME = 'name' + + class ListSnapshotsEnums: """ Enums for list_snapshots parameters. @@ -18649,9 +18828,9 @@ class AddressPrefix(): :attr bool is_default: Indicates whether this is the default prefix for this zone in this VPC. If a default prefix was automatically created when the VPC was created, the prefix is automatically named using a hyphenated list of - randomly-selected words, but may be updated with a user-specified name. - :attr str name: The user-defined name for this address prefix. Names must be - unique within the VPC the address prefix resides in. + randomly-selected words, but may be changed. + :attr str name: The name for this address prefix. The name must not be used by + another address prefix for the VPC. :attr ZoneReference zone: The zone this address prefix resides in. """ @@ -18676,10 +18855,9 @@ def __init__(self, :param bool is_default: Indicates whether this is the default prefix for this zone in this VPC. If a default prefix was automatically created when the VPC was created, the prefix is automatically named using a hyphenated - list of randomly-selected words, but may be updated with a user-specified - name. - :param str name: The user-defined name for this address prefix. Names must - be unique within the VPC the address prefix resides in. + list of randomly-selected words, but may be changed. + :param str name: The name for this address prefix. The name must not be + used by another address prefix for the VPC. :param ZoneReference zone: The zone this address prefix resides in. """ self.cidr = cidr @@ -18752,7 +18930,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'zone') and self.zone is not None: - _dict['zone'] = self.zone.to_dict() + if isinstance(self.zone, dict): + _dict['zone'] = self.zone + else: + _dict['zone'] = self.zone.to_dict() return _dict def _to_dict(self): @@ -18819,7 +19000,7 @@ def from_dict(cls, _dict: Dict) -> 'AddressPrefixCollection': """Initialize a AddressPrefixCollection object from a json dictionary.""" args = {} if 'address_prefixes' in _dict: - args['address_prefixes'] = [AddressPrefix.from_dict(x) for x in _dict.get('address_prefixes')] + args['address_prefixes'] = [AddressPrefix.from_dict(v) for v in _dict.get('address_prefixes')] else: raise ValueError('Required property \'address_prefixes\' not present in AddressPrefixCollection JSON') if 'first' in _dict: @@ -18847,13 +19028,25 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'address_prefixes') and self.address_prefixes is not None: - _dict['address_prefixes'] = [x.to_dict() for x in self.address_prefixes] + address_prefixes_list = [] + for v in self.address_prefixes: + if isinstance(v, dict): + address_prefixes_list.append(v) + else: + address_prefixes_list.append(v.to_dict()) + _dict['address_prefixes'] = address_prefixes_list if hasattr(self, 'first') and self.first is not None: - _dict['first'] = self.first.to_dict() + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit if hasattr(self, 'next') and self.next is not None: - _dict['next'] = self.next.to_dict() + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() if hasattr(self, 'total_count') and self.total_count is not None: _dict['total_count'] = self.total_count return _dict @@ -18998,8 +19191,8 @@ class AddressPrefixPatch(): for this zone in this VPC, provided the VPC currently has no default address prefix for this zone. Updating to false removes the default prefix for this zone in this VPC. - :attr str name: (optional) The user-defined name for this address prefix. Names - must be unique within the VPC the address prefix resides in. + :attr str name: (optional) The name for this address prefix. The name must not + be used by another address prefix for the VPC. """ def __init__(self, @@ -19014,8 +19207,8 @@ def __init__(self, default prefix for this zone in this VPC, provided the VPC currently has no default address prefix for this zone. Updating to false removes the default prefix for this zone in this VPC. - :param str name: (optional) The user-defined name for this address prefix. - Names must be unique within the VPC the address prefix resides in. + :param str name: (optional) The name for this address prefix. The name must + not be used by another address prefix for the VPC. """ self.is_default = is_default self.name = name @@ -19084,7 +19277,8 @@ class BackupPolicy(): :attr List[str] match_user_tags: The user tags this backup policy applies to. Resources that have both a matching user tag and a matching type will be subject to the backup policy. - :attr str name: The unique user-defined name for this backup policy. + :attr str name: The name for this backup policy. The name is unique across all + backup policies in the region. :attr List[BackupPolicyPlanReference] plans: The plans for the backup policy. :attr ResourceGroupReference resource_group: The resource group for this backup policy. @@ -19124,7 +19318,8 @@ def __init__(self, :param List[str] match_user_tags: The user tags this backup policy applies to. Resources that have both a matching user tag and a matching type will be subject to the backup policy. - :param str name: The unique user-defined name for this backup policy. + :param str name: The name for this backup policy. The name is unique across + all backup policies in the region. :param List[BackupPolicyPlanReference] plans: The plans for the backup policy. :param ResourceGroupReference resource_group: The resource group for this @@ -19186,7 +19381,7 @@ def from_dict(cls, _dict: Dict) -> 'BackupPolicy': else: raise ValueError('Required property \'name\' not present in BackupPolicy JSON') if 'plans' in _dict: - args['plans'] = [BackupPolicyPlanReference.from_dict(x) for x in _dict.get('plans')] + args['plans'] = [BackupPolicyPlanReference.from_dict(v) for v in _dict.get('plans')] else: raise ValueError('Required property \'plans\' not present in BackupPolicy JSON') if 'resource_group' in _dict: @@ -19226,9 +19421,18 @@ def to_dict(self) -> Dict: if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'plans') and self.plans is not None: - _dict['plans'] = [x.to_dict() for x in self.plans] + plans_list = [] + for v in self.plans: + if isinstance(v, dict): + plans_list.append(v) + else: + plans_list.append(v.to_dict()) + _dict['plans'] = plans_list if hasattr(self, 'resource_group') and self.resource_group is not None: - _dict['resource_group'] = self.resource_group.to_dict() + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() if hasattr(self, 'resource_type') and self.resource_type is not None: _dict['resource_type'] = self.resource_type return _dict @@ -19323,7 +19527,7 @@ def from_dict(cls, _dict: Dict) -> 'BackupPolicyCollection': """Initialize a BackupPolicyCollection object from a json dictionary.""" args = {} if 'backup_policies' in _dict: - args['backup_policies'] = [BackupPolicy.from_dict(x) for x in _dict.get('backup_policies')] + args['backup_policies'] = [BackupPolicy.from_dict(v) for v in _dict.get('backup_policies')] else: raise ValueError('Required property \'backup_policies\' not present in BackupPolicyCollection JSON') if 'first' in _dict: @@ -19351,13 +19555,25 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'backup_policies') and self.backup_policies is not None: - _dict['backup_policies'] = [x.to_dict() for x in self.backup_policies] + backup_policies_list = [] + for v in self.backup_policies: + if isinstance(v, dict): + backup_policies_list.append(v) + else: + backup_policies_list.append(v.to_dict()) + _dict['backup_policies'] = backup_policies_list if hasattr(self, 'first') and self.first is not None: - _dict['first'] = self.first.to_dict() + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit if hasattr(self, 'next') and self.next is not None: - _dict['next'] = self.next.to_dict() + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() if hasattr(self, 'total_count') and self.total_count is not None: _dict['total_count'] = self.total_count return _dict @@ -19493,6 +19709,634 @@ def __ne__(self, other: 'BackupPolicyCollectionNext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other +class BackupPolicyJob(): + """ + BackupPolicyJob. + + :attr bool auto_delete: Indicates whether this backup policy job will be + automatically deleted after it completes. At present, this is always `true`, but + may be modifiable in the future. + :attr int auto_delete_after: If `auto_delete` is `true`, the days after + completion that this backup policy job will be deleted. This value may be + modifiable in the future. + :attr BackupPolicyPlanReference backup_policy_plan: The backup policy plan + operated this backup policy job (may be + [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). + :attr datetime completed_at: (optional) The date and time that the backup policy + job was completed. + If absent, the backup policy job has not yet completed. + :attr datetime created_at: The date and time that the backup policy job was + created. + :attr str href: The URL for this backup policy job. + :attr str id: The unique identifier for this backup policy job. + :attr str job_type: The type of backup policy job. + 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 backup policy job on which the + unexpected property value was encountered. + :attr str resource_type: The resource type. + :attr BackupPolicyJobSource source: The source this backup was created from (may + be + [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). + :attr str status: The status of the backup policy job. + 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 backup policy job on which the + unexpected property value was encountered. + :attr List[BackupPolicyJobStatusReason] status_reasons: The reasons for the + current status (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 List[SnapshotReference] target_snapshots: The snapshots operated on by + this backup policy job (may be + [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). + """ + + def __init__(self, + auto_delete: bool, + auto_delete_after: int, + backup_policy_plan: 'BackupPolicyPlanReference', + created_at: datetime, + href: str, + id: str, + job_type: str, + resource_type: str, + source: 'BackupPolicyJobSource', + status: str, + status_reasons: List['BackupPolicyJobStatusReason'], + target_snapshots: List['SnapshotReference'], + *, + completed_at: datetime = None) -> None: + """ + Initialize a BackupPolicyJob object. + + :param bool auto_delete: Indicates whether this backup policy job will be + automatically deleted after it completes. At present, this is always + `true`, but may be modifiable in the future. + :param int auto_delete_after: If `auto_delete` is `true`, the days after + completion that this backup policy job will be deleted. This value may be + modifiable in the future. + :param BackupPolicyPlanReference backup_policy_plan: The backup policy plan + operated this backup policy job (may be + [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). + :param datetime created_at: The date and time that the backup policy job + was created. + :param str href: The URL for this backup policy job. + :param str id: The unique identifier for this backup policy job. + :param str job_type: The type of backup policy job. + The enumerated values for this property 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 backup policy job on which + the unexpected property value was encountered. + :param str resource_type: The resource type. + :param BackupPolicyJobSource source: The source this backup was created + from (may be + [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). + :param str status: The status of the backup policy job. + The enumerated values for this property 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 backup policy job on which + the unexpected property value was encountered. + :param List[BackupPolicyJobStatusReason] status_reasons: The reasons for + the current status (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 List[SnapshotReference] target_snapshots: The snapshots operated on + by this backup policy job (may be + [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). + :param datetime completed_at: (optional) The date and time that the backup + policy job was completed. + If absent, the backup policy job has not yet completed. + """ + self.auto_delete = auto_delete + self.auto_delete_after = auto_delete_after + self.backup_policy_plan = backup_policy_plan + self.completed_at = completed_at + self.created_at = created_at + self.href = href + self.id = id + self.job_type = job_type + self.resource_type = resource_type + self.source = source + self.status = status + self.status_reasons = status_reasons + self.target_snapshots = target_snapshots + + @classmethod + def from_dict(cls, _dict: Dict) -> 'BackupPolicyJob': + """Initialize a BackupPolicyJob object from a json dictionary.""" + args = {} + if 'auto_delete' in _dict: + args['auto_delete'] = _dict.get('auto_delete') + else: + raise ValueError('Required property \'auto_delete\' not present in BackupPolicyJob JSON') + if 'auto_delete_after' in _dict: + args['auto_delete_after'] = _dict.get('auto_delete_after') + else: + raise ValueError('Required property \'auto_delete_after\' not present in BackupPolicyJob JSON') + if 'backup_policy_plan' in _dict: + args['backup_policy_plan'] = BackupPolicyPlanReference.from_dict(_dict.get('backup_policy_plan')) + else: + raise ValueError('Required property \'backup_policy_plan\' not present in BackupPolicyJob JSON') + if 'completed_at' in _dict: + args['completed_at'] = string_to_datetime(_dict.get('completed_at')) + 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 BackupPolicyJob JSON') + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in BackupPolicyJob JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in BackupPolicyJob JSON') + if 'job_type' in _dict: + args['job_type'] = _dict.get('job_type') + else: + raise ValueError('Required property \'job_type\' not present in BackupPolicyJob JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in BackupPolicyJob JSON') + if 'source' in _dict: + args['source'] = _dict.get('source') + else: + raise ValueError('Required property \'source\' not present in BackupPolicyJob JSON') + if 'status' in _dict: + args['status'] = _dict.get('status') + else: + raise ValueError('Required property \'status\' not present in BackupPolicyJob JSON') + if 'status_reasons' in _dict: + args['status_reasons'] = [BackupPolicyJobStatusReason.from_dict(v) for v in _dict.get('status_reasons')] + else: + raise ValueError('Required property \'status_reasons\' not present in BackupPolicyJob JSON') + if 'target_snapshots' in _dict: + args['target_snapshots'] = [SnapshotReference.from_dict(v) for v in _dict.get('target_snapshots')] + else: + raise ValueError('Required property \'target_snapshots\' not present in BackupPolicyJob JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a BackupPolicyJob object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'auto_delete') and self.auto_delete is not None: + _dict['auto_delete'] = self.auto_delete + if hasattr(self, 'auto_delete_after') and self.auto_delete_after is not None: + _dict['auto_delete_after'] = self.auto_delete_after + if hasattr(self, 'backup_policy_plan') and self.backup_policy_plan is not None: + if isinstance(self.backup_policy_plan, dict): + _dict['backup_policy_plan'] = self.backup_policy_plan + else: + _dict['backup_policy_plan'] = self.backup_policy_plan.to_dict() + if hasattr(self, 'completed_at') and self.completed_at is not None: + _dict['completed_at'] = datetime_to_string(self.completed_at) + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'job_type') and self.job_type is not None: + _dict['job_type'] = self.job_type + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type + if hasattr(self, 'source') and self.source is not None: + if isinstance(self.source, dict): + _dict['source'] = self.source + else: + _dict['source'] = self.source.to_dict() + if hasattr(self, 'status') and self.status is not None: + _dict['status'] = self.status + if hasattr(self, 'status_reasons') and self.status_reasons is not None: + status_reasons_list = [] + for v in self.status_reasons: + if isinstance(v, dict): + status_reasons_list.append(v) + else: + status_reasons_list.append(v.to_dict()) + _dict['status_reasons'] = status_reasons_list + if hasattr(self, 'target_snapshots') and self.target_snapshots is not None: + target_snapshots_list = [] + for v in self.target_snapshots: + if isinstance(v, dict): + target_snapshots_list.append(v) + else: + target_snapshots_list.append(v.to_dict()) + _dict['target_snapshots'] = target_snapshots_list + return _dict + + 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 BackupPolicyJob object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'BackupPolicyJob') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'BackupPolicyJob') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class JobTypeEnum(str, Enum): + """ + The type of backup policy job. + 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 backup policy job on which the unexpected + property value was encountered. + """ + CREATION = 'creation' + DELETION = 'deletion' + + + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + BACKUP_POLICY_JOB = 'backup_policy_job' + + + class StatusEnum(str, Enum): + """ + The status of the backup policy job. + 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 backup policy job on which the unexpected + property value was encountered. + """ + FAILED = 'failed' + RUNNING = 'running' + SUCCEEDED = 'succeeded' + + +class BackupPolicyJobCollection(): + """ + BackupPolicyJobCollection. + + :attr BackupPolicyJobCollectionFirst first: A link to the first page of + resources. + :attr List[BackupPolicyJob] jobs: Collection of backup policy jobs. + :attr int limit: The maximum number of resources that can be returned by the + request. + :attr BackupPolicyJobCollectionNext next: (optional) A link to the next page of + resources. This property is present for all pages + except the last page. + :attr int total_count: The total number of resources across all pages. + """ + + def __init__(self, + first: 'BackupPolicyJobCollectionFirst', + jobs: List['BackupPolicyJob'], + limit: int, + total_count: int, + *, + next: 'BackupPolicyJobCollectionNext' = None) -> None: + """ + Initialize a BackupPolicyJobCollection object. + + :param BackupPolicyJobCollectionFirst first: A link to the first page of + resources. + :param List[BackupPolicyJob] jobs: Collection of backup policy jobs. + :param int limit: The maximum number of resources that can be returned by + the request. + :param int total_count: The total number of resources across all pages. + :param BackupPolicyJobCollectionNext next: (optional) A link to the next + page of resources. This property is present for all pages + except the last page. + """ + self.first = first + self.jobs = jobs + self.limit = limit + self.next = next + self.total_count = total_count + + @classmethod + def from_dict(cls, _dict: Dict) -> 'BackupPolicyJobCollection': + """Initialize a BackupPolicyJobCollection object from a json dictionary.""" + args = {} + if 'first' in _dict: + args['first'] = BackupPolicyJobCollectionFirst.from_dict(_dict.get('first')) + else: + raise ValueError('Required property \'first\' not present in BackupPolicyJobCollection JSON') + if 'jobs' in _dict: + args['jobs'] = [BackupPolicyJob.from_dict(v) for v in _dict.get('jobs')] + else: + raise ValueError('Required property \'jobs\' not present in BackupPolicyJobCollection JSON') + if 'limit' in _dict: + args['limit'] = _dict.get('limit') + else: + raise ValueError('Required property \'limit\' not present in BackupPolicyJobCollection JSON') + if 'next' in _dict: + args['next'] = BackupPolicyJobCollectionNext.from_dict(_dict.get('next')) + if 'total_count' in _dict: + args['total_count'] = _dict.get('total_count') + else: + raise ValueError('Required property \'total_count\' not present in BackupPolicyJobCollection JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a BackupPolicyJobCollection object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'first') and self.first is not None: + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() + if hasattr(self, 'jobs') and self.jobs is not None: + jobs_list = [] + for v in self.jobs: + if isinstance(v, dict): + jobs_list.append(v) + else: + jobs_list.append(v.to_dict()) + _dict['jobs'] = jobs_list + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'next') and self.next is not None: + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() + if hasattr(self, 'total_count') and self.total_count is not None: + _dict['total_count'] = self.total_count + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this BackupPolicyJobCollection object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'BackupPolicyJobCollection') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'BackupPolicyJobCollection') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + +class BackupPolicyJobCollectionFirst(): + """ + A link to the first page of resources. + + :attr str href: The URL for a page of resources. + """ + + def __init__(self, + href: str) -> None: + """ + Initialize a BackupPolicyJobCollectionFirst object. + + :param str href: The URL for a page of resources. + """ + self.href = href + + @classmethod + def from_dict(cls, _dict: Dict) -> 'BackupPolicyJobCollectionFirst': + """Initialize a BackupPolicyJobCollectionFirst object from a json dictionary.""" + args = {} + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in BackupPolicyJobCollectionFirst JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a BackupPolicyJobCollectionFirst object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this BackupPolicyJobCollectionFirst object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'BackupPolicyJobCollectionFirst') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'BackupPolicyJobCollectionFirst') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + +class BackupPolicyJobCollectionNext(): + """ + A link to the next page of resources. This property is present for all pages except + the last page. + + :attr str href: The URL for a page of resources. + """ + + def __init__(self, + href: str) -> None: + """ + Initialize a BackupPolicyJobCollectionNext object. + + :param str href: The URL for a page of resources. + """ + self.href = href + + @classmethod + def from_dict(cls, _dict: Dict) -> 'BackupPolicyJobCollectionNext': + """Initialize a BackupPolicyJobCollectionNext object from a json dictionary.""" + args = {} + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in BackupPolicyJobCollectionNext JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a BackupPolicyJobCollectionNext object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this BackupPolicyJobCollectionNext object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'BackupPolicyJobCollectionNext') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'BackupPolicyJobCollectionNext') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + +class BackupPolicyJobSource(): + """ + The source this backup was created from (may be + [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). + + """ + + def __init__(self) -> None: + """ + Initialize a BackupPolicyJobSource object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['BackupPolicyJobSourceVolumeReference'])) + raise Exception(msg) + +class BackupPolicyJobStatusReason(): + """ + BackupPolicyJobStatusReason. + + :attr str code: A snake case string succinctly identifying the status reason: + - `internal_error`: Internal error (contact IBM support) + - `snapshot_pending`: Cannot delete backup (snapshot) in the `pending` lifecycle + state + - `snapshot_volume_limit`: The snapshot limit for the source volume has been + reached + - `source_volume_busy`: The source volume has `busy` set (after multiple + retries). + :attr str message: An explanation of the status reason. + :attr str more_info: (optional) Link to documentation about this status reason. + """ + + def __init__(self, + code: str, + message: str, + *, + more_info: str = None) -> None: + """ + Initialize a BackupPolicyJobStatusReason object. + + :param str code: A snake case string succinctly identifying the status + reason: + - `internal_error`: Internal error (contact IBM support) + - `snapshot_pending`: Cannot delete backup (snapshot) in the `pending` + lifecycle state + - `snapshot_volume_limit`: The snapshot limit for the source volume has + been reached + - `source_volume_busy`: The source volume has `busy` set (after multiple + retries). + :param str message: An explanation of the status reason. + :param str more_info: (optional) Link to documentation about this status + reason. + """ + self.code = code + self.message = message + self.more_info = more_info + + @classmethod + def from_dict(cls, _dict: Dict) -> 'BackupPolicyJobStatusReason': + """Initialize a BackupPolicyJobStatusReason object from a json dictionary.""" + args = {} + if 'code' in _dict: + args['code'] = _dict.get('code') + else: + raise ValueError('Required property \'code\' not present in BackupPolicyJobStatusReason JSON') + if 'message' in _dict: + args['message'] = _dict.get('message') + else: + raise ValueError('Required property \'message\' not present in BackupPolicyJobStatusReason JSON') + if 'more_info' in _dict: + args['more_info'] = _dict.get('more_info') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a BackupPolicyJobStatusReason object from 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 BackupPolicyJobStatusReason object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'BackupPolicyJobStatusReason') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'BackupPolicyJobStatusReason') -> 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 status reason: + - `internal_error`: Internal error (contact IBM support) + - `snapshot_pending`: Cannot delete backup (snapshot) in the `pending` lifecycle + state + - `snapshot_volume_limit`: The snapshot limit for the source volume has been + reached + - `source_volume_busy`: The source volume has `busy` set (after multiple retries). + """ + INTERNAL_ERROR = 'internal_error' + SNAPSHOT_PENDING = 'snapshot_pending' + SNAPSHOT_VOLUME_LIMIT = 'snapshot_volume_limit' + SOURCE_VOLUME_BUSY = 'source_volume_busy' + + class BackupPolicyPatch(): """ BackupPolicyPatch. @@ -19500,8 +20344,8 @@ class BackupPolicyPatch(): :attr List[str] match_user_tags: (optional) The user tags this backup policy applies to (replacing any existing tags). Resources that have both a matching user tag and a matching type will be subject to the backup policy. - :attr str name: (optional) The user-defined name for this backup policy. Names - must be unique within the region this backup policy resides in. + :attr str name: (optional) The name for this backup policy. The name must not be + used by another backup policy in the region. """ def __init__(self, @@ -19514,8 +20358,8 @@ def __init__(self, :param List[str] match_user_tags: (optional) The user tags this backup policy applies to (replacing any existing tags). Resources that have both a matching user tag and a matching type will be subject to the backup policy. - :param str name: (optional) The user-defined name for this backup policy. - Names must be unique within the region this backup policy resides in. + :param str name: (optional) The name for this backup policy. The name must + not be used by another backup policy in the region. """ self.match_user_tags = match_user_tags self.name = name @@ -19583,7 +20427,8 @@ class BackupPolicyPlan(): :attr str href: The URL for this backup policy plan. :attr str id: The unique identifier for this backup policy plan. :attr str lifecycle_state: The lifecycle state of this backup policy plan. - :attr str name: The unique user-defined name for this backup policy plan. + :attr str name: The name for this backup policy plan. The name is unique across + all plans in the backup policy. :attr str resource_type: The resource type. """ @@ -19619,7 +20464,8 @@ def __init__(self, :param str href: The URL for this backup policy plan. :param str id: The unique identifier for this backup policy plan. :param str lifecycle_state: The lifecycle state of this backup policy plan. - :param str name: The unique user-defined name for this backup policy plan. + :param str name: The name for this backup policy plan. The name is unique + across all plans in the backup policy. :param str resource_type: The resource type. """ self.active = active @@ -19703,7 +20549,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'cron_spec') and self.cron_spec is not None: _dict['cron_spec'] = self.cron_spec if hasattr(self, 'deletion_trigger') and self.deletion_trigger is not None: - _dict['deletion_trigger'] = self.deletion_trigger.to_dict() + if isinstance(self.deletion_trigger, dict): + _dict['deletion_trigger'] = self.deletion_trigger + else: + _dict['deletion_trigger'] = self.deletion_trigger.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -19775,7 +20624,7 @@ def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanCollection': """Initialize a BackupPolicyPlanCollection object from a json dictionary.""" args = {} if 'plans' in _dict: - args['plans'] = [BackupPolicyPlan.from_dict(x) for x in _dict.get('plans')] + args['plans'] = [BackupPolicyPlan.from_dict(v) for v in _dict.get('plans')] else: raise ValueError('Required property \'plans\' not present in BackupPolicyPlanCollection JSON') return cls(**args) @@ -19789,7 +20638,13 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'plans') and self.plans is not None: - _dict['plans'] = [x.to_dict() for x in self.plans] + plans_list = [] + for v in self.plans: + if isinstance(v, dict): + plans_list.append(v) + else: + plans_list.append(v.to_dict()) + _dict['plans'] = plans_list return _dict def _to_dict(self): @@ -20030,8 +20885,8 @@ class BackupPolicyPlanPatch(): All backup schedules for plans in the same policy must be at least an hour apart. :attr BackupPolicyPlanDeletionTriggerPatch deletion_trigger: (optional) - :attr str name: (optional) The user-defined name for this backup policy plan. - Names must be unique within the backup policy this plan resides in. + :attr str name: (optional) The name for this backup policy plan. The name must + not be used by another plan for the backup policy. """ def __init__(self, @@ -20059,8 +20914,8 @@ def __init__(self, All backup schedules for plans in the same policy must be at least an hour apart. :param BackupPolicyPlanDeletionTriggerPatch deletion_trigger: (optional) - :param str name: (optional) The user-defined name for this backup policy - plan. Names must be unique within the backup policy this plan resides in. + :param str name: (optional) The name for this backup policy plan. The name + must not be used by another plan for the backup policy. """ self.active = active self.attach_user_tags = attach_user_tags @@ -20104,7 +20959,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'cron_spec') and self.cron_spec is not None: _dict['cron_spec'] = self.cron_spec if hasattr(self, 'deletion_trigger') and self.deletion_trigger is not None: - _dict['deletion_trigger'] = self.deletion_trigger.to_dict() + if isinstance(self.deletion_trigger, dict): + _dict['deletion_trigger'] = self.deletion_trigger + else: + _dict['deletion_trigger'] = self.deletion_trigger.to_dict() if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name return _dict @@ -20143,9 +21001,9 @@ class BackupPolicyPlanPrototype(): All backup schedules for plans in the same policy must be at least an hour apart. :attr BackupPolicyPlanDeletionTriggerPrototype deletion_trigger: (optional) - :attr str name: (optional) The user-defined name for this backup policy plan. - Names must be unique within the backup policy this plan resides in. If - unspecified, the name will be a hyphenated list of randomly-selected words. + :attr str name: (optional) The name for this backup policy plan. The name must + not be used by another plan for the backup policy. If unspecified, the name will + be a hyphenated list of randomly-selected words. """ def __init__(self, @@ -20173,10 +21031,9 @@ def __init__(self, source's user tags to the created backups (snapshots). :param BackupPolicyPlanDeletionTriggerPrototype deletion_trigger: (optional) - :param str name: (optional) The user-defined name for this backup policy - plan. Names must be unique within the backup policy this plan resides in. - If unspecified, the name will be a hyphenated list of randomly-selected - words. + :param str name: (optional) The name for this backup policy plan. The name + must not be used by another plan for the backup policy. If unspecified, the + name will be a hyphenated list of randomly-selected words. """ self.active = active self.attach_user_tags = attach_user_tags @@ -20222,7 +21079,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'cron_spec') and self.cron_spec is not None: _dict['cron_spec'] = self.cron_spec if hasattr(self, 'deletion_trigger') and self.deletion_trigger is not None: - _dict['deletion_trigger'] = self.deletion_trigger.to_dict() + if isinstance(self.deletion_trigger, dict): + _dict['deletion_trigger'] = self.deletion_trigger + else: + _dict['deletion_trigger'] = self.deletion_trigger.to_dict() if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name return _dict @@ -20254,7 +21114,8 @@ class BackupPolicyPlanReference(): some supplementary information. :attr str href: The URL for this backup policy plan. :attr str id: The unique identifier for this backup policy plan. - :attr str name: The unique user-defined name for this backup policy plan. + :attr str name: The name for this backup policy plan. The name is unique across + all plans in the backup policy. :attr str resource_type: The resource type. """ @@ -20270,7 +21131,8 @@ def __init__(self, :param str href: The URL for this backup policy plan. :param str id: The unique identifier for this backup policy plan. - :param str name: The unique user-defined name for this backup policy plan. + :param str name: The name for this backup policy plan. The name is unique + across all plans in the backup policy. :param str resource_type: The resource type. :param BackupPolicyPlanReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and @@ -20316,7 +21178,10 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -20429,8 +21294,8 @@ class BareMetalServer(): :attr str href: The URL for this bare metal server. :attr str id: The unique identifier for this bare metal server. :attr int memory: The amount of memory, truncated to whole gibibytes. - :attr str name: The user-defined name for this bare metal server (and default - system hostname). + :attr str name: The name for this bare metal server. The name is unique across + all bare metal servers in the region. :attr List[NetworkInterfaceBareMetalServerContextReference] network_interfaces: The network interfaces for this bare metal server, including the primary network interface. @@ -20496,8 +21361,8 @@ def __init__(self, :param str href: The URL for this bare metal server. :param str id: The unique identifier for this bare metal server. :param int memory: The amount of memory, truncated to whole gibibytes. - :param str name: The user-defined name for this bare metal server (and - default system hostname). + :param str name: The name for this bare metal server. The name is unique + across all bare metal servers in the region. :param List[NetworkInterfaceBareMetalServerContextReference] network_interfaces: The network interfaces for this bare metal server, including the primary network interface. @@ -20567,7 +21432,7 @@ def from_dict(cls, _dict: Dict) -> 'BareMetalServer': else: raise ValueError('Required property \'crn\' not present in BareMetalServer JSON') if 'disks' in _dict: - args['disks'] = [BareMetalServerDisk.from_dict(x) for x in _dict.get('disks')] + args['disks'] = [BareMetalServerDisk.from_dict(v) for v in _dict.get('disks')] else: raise ValueError('Required property \'disks\' not present in BareMetalServer JSON') if 'enable_secure_boot' in _dict: @@ -20591,7 +21456,7 @@ def from_dict(cls, _dict: Dict) -> 'BareMetalServer': else: raise ValueError('Required property \'name\' not present in BareMetalServer JSON') if 'network_interfaces' in _dict: - args['network_interfaces'] = [NetworkInterfaceBareMetalServerContextReference.from_dict(x) for x in _dict.get('network_interfaces')] + args['network_interfaces'] = [NetworkInterfaceBareMetalServerContextReference.from_dict(v) for v in _dict.get('network_interfaces')] else: raise ValueError('Required property \'network_interfaces\' not present in BareMetalServer JSON') if 'primary_network_interface' in _dict: @@ -20615,7 +21480,7 @@ def from_dict(cls, _dict: Dict) -> 'BareMetalServer': else: raise ValueError('Required property \'status\' not present in BareMetalServer JSON') if 'status_reasons' in _dict: - args['status_reasons'] = [BareMetalServerStatusReason.from_dict(x) for x in _dict.get('status_reasons')] + args['status_reasons'] = [BareMetalServerStatusReason.from_dict(v) for v in _dict.get('status_reasons')] else: raise ValueError('Required property \'status_reasons\' not present in BareMetalServer JSON') if 'trusted_platform_module' in _dict: @@ -20648,13 +21513,22 @@ def to_dict(self) -> Dict: else: _dict['boot_target'] = self.boot_target.to_dict() if hasattr(self, 'cpu') and self.cpu is not None: - _dict['cpu'] = self.cpu.to_dict() + if isinstance(self.cpu, dict): + _dict['cpu'] = self.cpu + else: + _dict['cpu'] = self.cpu.to_dict() if hasattr(self, 'created_at') and self.created_at is not None: _dict['created_at'] = datetime_to_string(self.created_at) if hasattr(self, 'crn') and self.crn is not None: _dict['crn'] = self.crn if hasattr(self, 'disks') and self.disks is not None: - _dict['disks'] = [x.to_dict() for x in self.disks] + disks_list = [] + for v in self.disks: + if isinstance(v, dict): + disks_list.append(v) + else: + disks_list.append(v.to_dict()) + _dict['disks'] = disks_list if hasattr(self, 'enable_secure_boot') and self.enable_secure_boot is not None: _dict['enable_secure_boot'] = self.enable_secure_boot if hasattr(self, 'href') and self.href is not None: @@ -20666,25 +21540,55 @@ def to_dict(self) -> 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] + network_interfaces_list = [] + for v in self.network_interfaces: + if isinstance(v, dict): + network_interfaces_list.append(v) + else: + network_interfaces_list.append(v.to_dict()) + _dict['network_interfaces'] = network_interfaces_list if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None: - _dict['primary_network_interface'] = self.primary_network_interface.to_dict() + if isinstance(self.primary_network_interface, dict): + _dict['primary_network_interface'] = self.primary_network_interface + else: + _dict['primary_network_interface'] = self.primary_network_interface.to_dict() if hasattr(self, 'profile') and self.profile is not None: - _dict['profile'] = self.profile.to_dict() + 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 isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() if hasattr(self, 'resource_type') and self.resource_type is not None: _dict['resource_type'] = self.resource_type if hasattr(self, 'status') and self.status is not None: _dict['status'] = self.status if hasattr(self, 'status_reasons') and self.status_reasons is not None: - _dict['status_reasons'] = [x.to_dict() for x in self.status_reasons] + status_reasons_list = [] + for v in self.status_reasons: + if isinstance(v, dict): + status_reasons_list.append(v) + else: + status_reasons_list.append(v.to_dict()) + _dict['status_reasons'] = status_reasons_list if hasattr(self, 'trusted_platform_module') and self.trusted_platform_module is not None: - _dict['trusted_platform_module'] = self.trusted_platform_module.to_dict() + if isinstance(self.trusted_platform_module, dict): + _dict['trusted_platform_module'] = self.trusted_platform_module + else: + _dict['trusted_platform_module'] = self.trusted_platform_module.to_dict() if hasattr(self, 'vpc') and self.vpc is not None: - _dict['vpc'] = self.vpc.to_dict() + if isinstance(self.vpc, dict): + _dict['vpc'] = self.vpc + else: + _dict['vpc'] = self.vpc.to_dict() if hasattr(self, 'zone') and self.zone is not None: - _dict['zone'] = self.zone.to_dict() + if isinstance(self.zone, dict): + _dict['zone'] = self.zone + else: + _dict['zone'] = self.zone.to_dict() return _dict def _to_dict(self): @@ -20875,7 +21779,7 @@ def from_dict(cls, _dict: Dict) -> 'BareMetalServerCollection': """Initialize a BareMetalServerCollection object from a json dictionary.""" args = {} if 'bare_metal_servers' in _dict: - args['bare_metal_servers'] = [BareMetalServer.from_dict(x) for x in _dict.get('bare_metal_servers')] + args['bare_metal_servers'] = [BareMetalServer.from_dict(v) for v in _dict.get('bare_metal_servers')] else: raise ValueError('Required property \'bare_metal_servers\' not present in BareMetalServerCollection JSON') if 'first' in _dict: @@ -20903,13 +21807,25 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'bare_metal_servers') and self.bare_metal_servers is not None: - _dict['bare_metal_servers'] = [x.to_dict() for x in self.bare_metal_servers] + bare_metal_servers_list = [] + for v in self.bare_metal_servers: + if isinstance(v, dict): + bare_metal_servers_list.append(v) + else: + bare_metal_servers_list.append(v.to_dict()) + _dict['bare_metal_servers'] = bare_metal_servers_list if hasattr(self, 'first') and self.first is not None: - _dict['first'] = self.first.to_dict() + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit if hasattr(self, 'next') and self.next is not None: - _dict['next'] = self.next.to_dict() + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() if hasattr(self, 'total_count') and self.total_count is not None: _dict['total_count'] = self.total_count return _dict @@ -21184,7 +22100,8 @@ class BareMetalServerDisk(): 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 name: The user-defined name for this disk. + :attr str name: The name for this bare metal server disk. The name is unique + across all disks on the bare metal server. :attr str resource_type: The resource type. :attr int size: The size of the disk in GB (gigabytes). """ @@ -21211,7 +22128,8 @@ def __init__(self, future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected property value was encountered. - :param str name: The user-defined name for this disk. + :param str name: The name for this bare metal server disk. The name is + unique across all disks on the bare metal server. :param str resource_type: The resource type. :param int size: The size of the disk in GB (gigabytes). """ @@ -21345,7 +22263,7 @@ def from_dict(cls, _dict: Dict) -> 'BareMetalServerDiskCollection': """Initialize a BareMetalServerDiskCollection object from a json dictionary.""" args = {} if 'disks' in _dict: - args['disks'] = [BareMetalServerDisk.from_dict(x) for x in _dict.get('disks')] + args['disks'] = [BareMetalServerDisk.from_dict(v) for v in _dict.get('disks')] else: raise ValueError('Required property \'disks\' not present in BareMetalServerDiskCollection JSON') return cls(**args) @@ -21359,7 +22277,13 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'disks') and self.disks is not None: - _dict['disks'] = [x.to_dict() for x in self.disks] + disks_list = [] + for v in self.disks: + if isinstance(v, dict): + disks_list.append(v) + else: + disks_list.append(v.to_dict()) + _dict['disks'] = disks_list return _dict def _to_dict(self): @@ -21384,7 +22308,8 @@ class BareMetalServerDiskPatch(): """ BareMetalServerDiskPatch. - :attr str name: (optional) The user-defined name for this disk. + :attr str name: (optional) The name for this bare metal server disk. The name + must not be used by another disk on the bare metal server. """ def __init__(self, @@ -21393,7 +22318,8 @@ def __init__(self, """ Initialize a BareMetalServerDiskPatch object. - :param str name: (optional) The user-defined name for this disk. + :param str name: (optional) The name for this bare metal server disk. The + name must not be used by another disk on the bare metal server. """ self.name = name @@ -21531,7 +22457,7 @@ def from_dict(cls, _dict: Dict) -> 'BareMetalServerInitialization': else: raise ValueError('Required property \'image\' not present in BareMetalServerInitialization JSON') if 'keys' in _dict: - args['keys'] = [KeyReference.from_dict(x) for x in _dict.get('keys')] + args['keys'] = [KeyReference.from_dict(v) for v in _dict.get('keys')] else: raise ValueError('Required property \'keys\' not present in BareMetalServerInitialization JSON') if 'user_accounts' in _dict: @@ -21549,16 +22475,25 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'image') and self.image is not None: - _dict['image'] = self.image.to_dict() + if isinstance(self.image, dict): + _dict['image'] = self.image + else: + _dict['image'] = self.image.to_dict() if hasattr(self, 'keys') and self.keys is not None: - _dict['keys'] = [x.to_dict() for x in self.keys] + keys_list = [] + for v in self.keys: + if isinstance(v, dict): + keys_list.append(v) + else: + keys_list.append(v.to_dict()) + _dict['keys'] = keys_list if hasattr(self, 'user_accounts') and self.user_accounts is not None: user_accounts_list = [] - for x in self.user_accounts: - if isinstance(x, dict): - user_accounts_list.append(x) + for v in self.user_accounts: + if isinstance(v, dict): + user_accounts_list.append(v) else: - user_accounts_list.append(x.to_dict()) + user_accounts_list.append(v.to_dict()) _dict['user_accounts'] = user_accounts_list return _dict @@ -21654,11 +22589,11 @@ def to_dict(self) -> Dict: _dict['image'] = self.image.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) + for v in self.keys: + if isinstance(v, dict): + keys_list.append(v) else: - keys_list.append(x.to_dict()) + keys_list.append(v.to_dict()) _dict['keys'] = keys_list if hasattr(self, 'user_data') and self.user_data is not None: _dict['user_data'] = self.user_data @@ -21743,7 +22678,7 @@ class BareMetalServerNetworkInterface(): 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. + :attr str name: The 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. @@ -21815,7 +22750,7 @@ def __init__(self, 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. + :param str name: The 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. @@ -21975,7 +22910,7 @@ def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfaceCollection': else: raise ValueError('Required property \'limit\' not present in BareMetalServerNetworkInterfaceCollection JSON') if 'network_interfaces' in _dict: - args['network_interfaces'] = [BareMetalServerNetworkInterface.from_dict(x) for x in _dict.get('network_interfaces')] + args['network_interfaces'] = [BareMetalServerNetworkInterface.from_dict(v) for v in _dict.get('network_interfaces')] else: raise ValueError('Required property \'network_interfaces\' not present in BareMetalServerNetworkInterfaceCollection JSON') if 'next' in _dict: @@ -21995,13 +22930,25 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'first') and self.first is not None: - _dict['first'] = self.first.to_dict() + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit if hasattr(self, 'network_interfaces') and self.network_interfaces is not None: - _dict['network_interfaces'] = [x.to_dict() for x in self.network_interfaces] + network_interfaces_list = [] + for v in self.network_interfaces: + if isinstance(v, dict): + network_interfaces_list.append(v) + else: + network_interfaces_list.append(v.to_dict()) + _dict['network_interfaces'] = network_interfaces_list if hasattr(self, 'next') and self.next is not None: - _dict['next'] = self.next.to_dict() + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() if hasattr(self, 'total_count') and self.total_count is not None: _dict['total_count'] = self.total_count return _dict @@ -22155,8 +23102,8 @@ class BareMetalServerNetworkInterfacePatch(): - 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. + :attr str name: (optional) The name for this network interface. The name must + not be used by another network interface on the bare metal server. """ def __init__(self, @@ -22183,8 +23130,8 @@ def __init__(self, - 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. + :param str name: (optional) The name for this network interface. The name + must not be used by another network interface on the bare metal server. """ self.allow_ip_spoofing = allow_ip_spoofing self.allowed_vlans = allowed_vlans @@ -22278,8 +23225,8 @@ class BareMetalServerNetworkInterfacePrototype(): 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 + :attr str name: (optional) The name for this network interface. The name must + not be used by another network interface on the bare metal server. If unspecified, the name will be a hyphenated list of randomly-selected words. :attr NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP address to bind to the network interface. This can be specified using @@ -22345,10 +23292,9 @@ def __init__(self, - 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 str name: (optional) The name for this network interface. The name + must not be used by another network interface on the bare metal server. If + unspecified, the name will be a hyphenated list of randomly-selected words. :param NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP address to bind to the network interface. This can be specified using an existing reserved IP, or a prototype object for a new reserved IP. @@ -22431,8 +23377,9 @@ class BareMetalServerPatch(): """ BareMetalServerPatch. - :attr str name: (optional) The user-defined name for this bare metal server (and - default system hostname). + :attr str name: (optional) The name for this bare metal server. The name must + not be used by another bare metal server in the region. Changing the name will + not affect the system hostname. """ def __init__(self, @@ -22441,8 +23388,9 @@ def __init__(self, """ Initialize a BareMetalServerPatch object. - :param str name: (optional) The user-defined name for this bare metal - server (and default system hostname). + :param str name: (optional) The name for this bare metal server. The name + must not be used by another bare metal server in the region. Changing the + name will not affect the system hostname. """ self.name = name @@ -22515,8 +23463,8 @@ class BareMetalServerPrimaryNetworkInterfacePrototype(): 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 + :attr str name: (optional) The name for this network interface. The name must + not be used by another network interface on the bare metal server. If unspecified, the name will be a hyphenated list of randomly-selected words. :attr NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP address to bind to the network interface. This can be specified using @@ -22576,10 +23524,9 @@ def __init__(self, - 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 - words. + :param str name: (optional) The name for this network interface. The name + must not be used by another network interface on the bare metal server. If + unspecified, the name will be a hyphenated list of randomly-selected words. :param NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP address to bind to the network interface. This can be specified using an existing reserved IP, or a prototype object for a new reserved IP. @@ -22650,11 +23597,11 @@ def to_dict(self) -> Dict: _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) + for v in self.security_groups: + if isinstance(v, dict): + security_groups_list.append(v) else: - security_groups_list.append(x.to_dict()) + security_groups_list.append(v.to_dict()) _dict['security_groups'] = security_groups_list if hasattr(self, 'subnet') and self.subnet is not None: if isinstance(self.subnet, dict): @@ -22719,7 +23666,7 @@ class BareMetalServerProfile(): :attr str resource_type: The resource type. :attr BareMetalServerProfileSupportedTrustedPlatformModuleModes supported_trusted_platform_module_modes: The supported trusted platform module - (TPM) modes for this bare metal server profile. + modes for this bare metal server profile. """ def __init__(self, @@ -22753,7 +23700,7 @@ def __init__(self, :param str resource_type: The resource type. :param BareMetalServerProfileSupportedTrustedPlatformModuleModes supported_trusted_platform_module_modes: The supported trusted platform - module (TPM) modes for this bare metal server profile. + module modes for this bare metal server profile. """ self.bandwidth = bandwidth self.cpu_architecture = cpu_architecture @@ -22789,7 +23736,7 @@ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfile': else: raise ValueError('Required property \'cpu_socket_count\' not present in BareMetalServerProfile JSON') if 'disks' in _dict: - args['disks'] = [BareMetalServerProfileDisk.from_dict(x) for x in _dict.get('disks')] + args['disks'] = [BareMetalServerProfileDisk.from_dict(v) for v in _dict.get('disks')] else: raise ValueError('Required property \'disks\' not present in BareMetalServerProfile JSON') if 'family' in _dict: @@ -22836,7 +23783,10 @@ def to_dict(self) -> Dict: else: _dict['bandwidth'] = self.bandwidth.to_dict() if hasattr(self, 'cpu_architecture') and self.cpu_architecture is not None: - _dict['cpu_architecture'] = self.cpu_architecture.to_dict() + if isinstance(self.cpu_architecture, dict): + _dict['cpu_architecture'] = self.cpu_architecture + else: + _dict['cpu_architecture'] = self.cpu_architecture.to_dict() if hasattr(self, 'cpu_core_count') and self.cpu_core_count is not None: if isinstance(self.cpu_core_count, dict): _dict['cpu_core_count'] = self.cpu_core_count @@ -22848,7 +23798,13 @@ def to_dict(self) -> Dict: else: _dict['cpu_socket_count'] = self.cpu_socket_count.to_dict() if hasattr(self, 'disks') and self.disks is not None: - _dict['disks'] = [x.to_dict() for x in self.disks] + disks_list = [] + for v in self.disks: + if isinstance(v, dict): + disks_list.append(v) + else: + disks_list.append(v.to_dict()) + _dict['disks'] = disks_list if hasattr(self, 'family') and self.family is not None: _dict['family'] = self.family if hasattr(self, 'href') and self.href is not None: @@ -22861,11 +23817,17 @@ def to_dict(self) -> Dict: if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'os_architecture') and self.os_architecture is not None: - _dict['os_architecture'] = self.os_architecture.to_dict() + if isinstance(self.os_architecture, dict): + _dict['os_architecture'] = self.os_architecture + else: + _dict['os_architecture'] = self.os_architecture.to_dict() if hasattr(self, 'resource_type') and self.resource_type is not None: _dict['resource_type'] = self.resource_type if hasattr(self, 'supported_trusted_platform_module_modes') and self.supported_trusted_platform_module_modes is not None: - _dict['supported_trusted_platform_module_modes'] = self.supported_trusted_platform_module_modes.to_dict() + if isinstance(self.supported_trusted_platform_module_modes, dict): + _dict['supported_trusted_platform_module_modes'] = self.supported_trusted_platform_module_modes + else: + _dict['supported_trusted_platform_module_modes'] = self.supported_trusted_platform_module_modes.to_dict() return _dict def _to_dict(self): @@ -23081,7 +24043,7 @@ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCollection': if 'next' in _dict: args['next'] = BareMetalServerProfileCollectionNext.from_dict(_dict.get('next')) if 'profiles' in _dict: - args['profiles'] = [BareMetalServerProfile.from_dict(x) for x in _dict.get('profiles')] + args['profiles'] = [BareMetalServerProfile.from_dict(v) for v in _dict.get('profiles')] else: raise ValueError('Required property \'profiles\' not present in BareMetalServerProfileCollection JSON') if 'total_count' in _dict: @@ -23099,13 +24061,25 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'first') and self.first is not None: - _dict['first'] = self.first.to_dict() + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit if hasattr(self, 'next') and self.next is not None: - _dict['next'] = self.next.to_dict() + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() if hasattr(self, 'profiles') and self.profiles is not None: - _dict['profiles'] = [x.to_dict() for x in self.profiles] + profiles_list = [] + for v in self.profiles: + if isinstance(v, dict): + profiles_list.append(v) + else: + profiles_list.append(v.to_dict()) + _dict['profiles'] = profiles_list if hasattr(self, 'total_count') and self.total_count is not None: _dict['total_count'] = self.total_count return _dict @@ -23303,7 +24277,10 @@ def to_dict(self) -> Dict: else: _dict['size'] = self.size.to_dict() if hasattr(self, 'supported_interface_types') and self.supported_interface_types is not None: - _dict['supported_interface_types'] = self.supported_interface_types.to_dict() + if isinstance(self.supported_interface_types, dict): + _dict['supported_interface_types'] = self.supported_interface_types + else: + _dict['supported_interface_types'] = self.supported_interface_types.to_dict() return _dict def _to_dict(self): @@ -23687,10 +24664,10 @@ class ResourceTypeEnum(str, Enum): class BareMetalServerProfileSupportedTrustedPlatformModuleModes(): """ - The supported trusted platform module (TPM) modes for this bare metal server profile. + The supported trusted platform module modes for this bare metal server profile. :attr str type: The type for this profile field. - :attr List[str] values: The supported trusted platform module (TPM) modes. + :attr List[str] values: The supported trusted platform module modes. """ def __init__(self, @@ -23700,7 +24677,7 @@ def __init__(self, Initialize a BareMetalServerProfileSupportedTrustedPlatformModuleModes object. :param str type: The type for this profile field. - :param List[str] values: The supported trusted platform module (TPM) modes. + :param List[str] values: The supported trusted platform module modes. """ self.type = type self.values = values @@ -23760,16 +24737,14 @@ class TypeEnum(str, Enum): class ValuesEnum(str, Enum): """ - The mode for the trusted platform module (TPM): - - `tpm_2`: Standard TPM 2 capabilities - - `tpm_2_with_txt`: Standard TPM 2 with Intel Trusted Execution Technology (TXT) + The trusted platform module (TPM) mode: + - `tpm_2`: TPM 2.0 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. """ TPM_2 = 'tpm_2' - TPM_2_WITH_TXT = 'tpm_2_with_txt' class BareMetalServerStatusReason(): @@ -23881,11 +24856,9 @@ class BareMetalServerTrustedPlatformModule(): """ BareMetalServerTrustedPlatformModule. - :attr bool enabled: Indicates whether the trusted platform module (TPM) is - enabled. If enabled, `mode` will also be set. - :attr str mode: (optional) The mode for the trusted platform module (TPM): - - `tpm_2`: Standard TPM 2 capabilities - - `tpm_2_with_txt`: Standard TPM 2 with Intel Trusted Execution Technology (TXT) + :attr bool enabled: Indicates whether the trusted platform module is enabled. + :attr str mode: (optional) The trusted platform module (TPM) mode: + - `tpm_2`: TPM 2.0 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 @@ -23899,12 +24872,10 @@ def __init__(self, """ Initialize a BareMetalServerTrustedPlatformModule object. - :param bool enabled: Indicates whether the trusted platform module (TPM) is - enabled. If enabled, `mode` will also be set. - :param str mode: (optional) The mode for the trusted platform module (TPM): - - `tpm_2`: Standard TPM 2 capabilities - - `tpm_2_with_txt`: Standard TPM 2 with Intel Trusted Execution Technology - (TXT) + :param bool enabled: Indicates whether the trusted platform module is + enabled. + :param str mode: (optional) The trusted platform module (TPM) mode: + - `tpm_2`: TPM 2.0 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 @@ -23959,16 +24930,14 @@ def __ne__(self, other: 'BareMetalServerTrustedPlatformModule') -> bool: class ModeEnum(str, Enum): """ - The mode for the trusted platform module (TPM): - - `tpm_2`: Standard TPM 2 capabilities - - `tpm_2_with_txt`: Standard TPM 2 with Intel Trusted Execution Technology (TXT) + The trusted platform module (TPM) mode: + - `tpm_2`: TPM 2.0 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. """ TPM_2 = 'tpm_2' - TPM_2_WITH_TXT = 'tpm_2_with_txt' class CatalogOfferingIdentity(): @@ -24157,7 +25126,8 @@ class DedicatedHost(): this dedicated host. :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 str name: The name for this dedicated host. The name is unique across all + dedicated hosts in the region. :attr DedicatedHostProfileReference profile: The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) for this dedicated host. @@ -24222,7 +25192,8 @@ def __init__(self, to this dedicated host. :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 str name: The name for this dedicated host. The name is unique + across all dedicated hosts in the region. :param DedicatedHostProfileReference profile: The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) for this dedicated host. @@ -24286,7 +25257,7 @@ def from_dict(cls, _dict: Dict) -> 'DedicatedHost': else: raise ValueError('Required property \'crn\' not present in DedicatedHost JSON') if 'disks' in _dict: - args['disks'] = [DedicatedHostDisk.from_dict(x) for x in _dict.get('disks')] + args['disks'] = [DedicatedHostDisk.from_dict(v) for v in _dict.get('disks')] else: raise ValueError('Required property \'disks\' not present in DedicatedHost JSON') if 'group' in _dict: @@ -24306,7 +25277,7 @@ def from_dict(cls, _dict: Dict) -> 'DedicatedHost': else: raise ValueError('Required property \'instance_placement_enabled\' not present in DedicatedHost JSON') if 'instances' in _dict: - args['instances'] = [InstanceReference.from_dict(x) for x in _dict.get('instances')] + args['instances'] = [InstanceReference.from_dict(v) for v in _dict.get('instances')] else: raise ValueError('Required property \'instances\' not present in DedicatedHost JSON') if 'lifecycle_state' in _dict: @@ -24346,7 +25317,7 @@ def from_dict(cls, _dict: Dict) -> 'DedicatedHost': else: raise ValueError('Required property \'state\' not present in DedicatedHost JSON') if 'supported_instance_profiles' in _dict: - args['supported_instance_profiles'] = [InstanceProfileReference.from_dict(x) for x in _dict.get('supported_instance_profiles')] + args['supported_instance_profiles'] = [InstanceProfileReference.from_dict(v) for v in _dict.get('supported_instance_profiles')] else: raise ValueError('Required property \'supported_instance_profiles\' not present in DedicatedHost JSON') if 'vcpu' in _dict: @@ -24370,15 +25341,27 @@ def to_dict(self) -> Dict: if hasattr(self, 'available_memory') and self.available_memory is not None: _dict['available_memory'] = self.available_memory if hasattr(self, 'available_vcpu') and self.available_vcpu is not None: - _dict['available_vcpu'] = self.available_vcpu.to_dict() + if isinstance(self.available_vcpu, dict): + _dict['available_vcpu'] = self.available_vcpu + else: + _dict['available_vcpu'] = self.available_vcpu.to_dict() if hasattr(self, 'created_at') and self.created_at is not None: _dict['created_at'] = datetime_to_string(self.created_at) if hasattr(self, 'crn') and self.crn is not None: _dict['crn'] = self.crn if hasattr(self, 'disks') and self.disks is not None: - _dict['disks'] = [x.to_dict() for x in self.disks] + disks_list = [] + for v in self.disks: + if isinstance(v, dict): + disks_list.append(v) + else: + disks_list.append(v.to_dict()) + _dict['disks'] = disks_list if hasattr(self, 'group') and self.group is not None: - _dict['group'] = self.group.to_dict() + if isinstance(self.group, dict): + _dict['group'] = self.group + else: + _dict['group'] = self.group.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: @@ -24386,7 +25369,13 @@ def to_dict(self) -> Dict: if hasattr(self, 'instance_placement_enabled') and self.instance_placement_enabled is not None: _dict['instance_placement_enabled'] = self.instance_placement_enabled if hasattr(self, 'instances') and self.instances is not None: - _dict['instances'] = [x.to_dict() for x in self.instances] + instances_list = [] + for v in self.instances: + if isinstance(v, dict): + instances_list.append(v) + else: + instances_list.append(v.to_dict()) + _dict['instances'] = instances_list if hasattr(self, '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: @@ -24394,11 +25383,17 @@ def to_dict(self) -> Dict: if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'profile') and self.profile is not None: - _dict['profile'] = self.profile.to_dict() + if isinstance(self.profile, dict): + _dict['profile'] = self.profile + else: + _dict['profile'] = self.profile.to_dict() if hasattr(self, 'provisionable') and self.provisionable is not None: _dict['provisionable'] = self.provisionable if hasattr(self, 'resource_group') and self.resource_group is not None: - _dict['resource_group'] = self.resource_group.to_dict() + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() if hasattr(self, 'resource_type') and self.resource_type is not None: _dict['resource_type'] = self.resource_type if hasattr(self, 'socket_count') and self.socket_count is not None: @@ -24406,11 +25401,23 @@ def to_dict(self) -> Dict: if hasattr(self, 'state') and self.state is not None: _dict['state'] = self.state if hasattr(self, 'supported_instance_profiles') and self.supported_instance_profiles is not None: - _dict['supported_instance_profiles'] = [x.to_dict() for x in self.supported_instance_profiles] + supported_instance_profiles_list = [] + for v in self.supported_instance_profiles: + if isinstance(v, dict): + supported_instance_profiles_list.append(v) + else: + supported_instance_profiles_list.append(v.to_dict()) + _dict['supported_instance_profiles'] = supported_instance_profiles_list if hasattr(self, 'vcpu') and self.vcpu is not None: - _dict['vcpu'] = self.vcpu.to_dict() + if isinstance(self.vcpu, dict): + _dict['vcpu'] = self.vcpu + else: + _dict['vcpu'] = self.vcpu.to_dict() if hasattr(self, 'zone') and self.zone is not None: - _dict['zone'] = self.zone.to_dict() + if isinstance(self.zone, dict): + _dict['zone'] = self.zone + else: + _dict['zone'] = self.zone.to_dict() return _dict def _to_dict(self): @@ -24510,7 +25517,7 @@ def from_dict(cls, _dict: Dict) -> 'DedicatedHostCollection': """Initialize a DedicatedHostCollection object from a json dictionary.""" args = {} if 'dedicated_hosts' in _dict: - args['dedicated_hosts'] = [DedicatedHost.from_dict(x) for x in _dict.get('dedicated_hosts')] + args['dedicated_hosts'] = [DedicatedHost.from_dict(v) for v in _dict.get('dedicated_hosts')] else: raise ValueError('Required property \'dedicated_hosts\' not present in DedicatedHostCollection JSON') if 'first' in _dict: @@ -24538,13 +25545,25 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'dedicated_hosts') and self.dedicated_hosts is not None: - _dict['dedicated_hosts'] = [x.to_dict() for x in self.dedicated_hosts] + dedicated_hosts_list = [] + for v in self.dedicated_hosts: + if isinstance(v, dict): + dedicated_hosts_list.append(v) + else: + dedicated_hosts_list.append(v.to_dict()) + _dict['dedicated_hosts'] = dedicated_hosts_list if hasattr(self, 'first') and self.first is not None: - _dict['first'] = self.first.to_dict() + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit if hasattr(self, 'next') and self.next is not None: - _dict['next'] = self.next.to_dict() + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() if hasattr(self, 'total_count') and self.total_count is not None: _dict['total_count'] = self.total_count return _dict @@ -24698,7 +25717,8 @@ class DedicatedHostDisk(): property value was encountered. :attr str lifecycle_state: (optional) The lifecycle state of this dedicated host disk. - :attr str name: The user-defined or system-provided name for this disk. + :attr str name: The name for this dedicated host disk. The name is unique across + all disks on the dedicated host. :attr bool provisionable: Indicates whether this dedicated host disk is available for instance disk creation. :attr str resource_type: The resource type. @@ -24736,7 +25756,8 @@ def __init__(self, future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected property value was encountered. - :param str name: The user-defined or system-provided name for this disk. + :param str name: The name for this dedicated host disk. The name is unique + across all disks on the dedicated host. :param bool provisionable: Indicates whether this dedicated host disk is available for instance disk creation. :param str resource_type: The resource type. @@ -24780,7 +25801,7 @@ def from_dict(cls, _dict: Dict) -> 'DedicatedHostDisk': else: raise ValueError('Required property \'id\' not present in DedicatedHostDisk JSON') if 'instance_disks' in _dict: - args['instance_disks'] = [InstanceDiskReference.from_dict(x) for x in _dict.get('instance_disks')] + args['instance_disks'] = [InstanceDiskReference.from_dict(v) for v in _dict.get('instance_disks')] else: raise ValueError('Required property \'instance_disks\' not present in DedicatedHostDisk JSON') if 'interface_type' in _dict: @@ -24828,7 +25849,13 @@ def to_dict(self) -> Dict: if hasattr(self, 'id') and self.id is not None: _dict['id'] = self.id if hasattr(self, 'instance_disks') and self.instance_disks is not None: - _dict['instance_disks'] = [x.to_dict() for x in self.instance_disks] + instance_disks_list = [] + for v in self.instance_disks: + if isinstance(v, dict): + instance_disks_list.append(v) + else: + instance_disks_list.append(v.to_dict()) + _dict['instance_disks'] = instance_disks_list if hasattr(self, 'interface_type') and self.interface_type is not None: _dict['interface_type'] = self.interface_type if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None: @@ -24928,7 +25955,7 @@ def from_dict(cls, _dict: Dict) -> 'DedicatedHostDiskCollection': """Initialize a DedicatedHostDiskCollection object from a json dictionary.""" args = {} if 'disks' in _dict: - args['disks'] = [DedicatedHostDisk.from_dict(x) for x in _dict.get('disks')] + args['disks'] = [DedicatedHostDisk.from_dict(v) for v in _dict.get('disks')] else: raise ValueError('Required property \'disks\' not present in DedicatedHostDiskCollection JSON') return cls(**args) @@ -24942,7 +25969,13 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'disks') and self.disks is not None: - _dict['disks'] = [x.to_dict() for x in self.disks] + disks_list = [] + for v in self.disks: + if isinstance(v, dict): + disks_list.append(v) + else: + disks_list.append(v.to_dict()) + _dict['disks'] = disks_list return _dict def _to_dict(self): @@ -24967,7 +26000,8 @@ class DedicatedHostDiskPatch(): """ DedicatedHostDiskPatch. - :attr str name: (optional) The user-defined name for this disk. + :attr str name: (optional) The name for this dedicated host disk. The name must + not be used by another disk on the dedicated host. """ def __init__(self, @@ -24976,7 +26010,8 @@ def __init__(self, """ Initialize a DedicatedHostDiskPatch object. - :param str name: (optional) The user-defined name for this disk. + :param str name: (optional) The name for this dedicated host disk. The name + must not be used by another disk on the dedicated host. """ self.name = name @@ -25031,7 +26066,8 @@ class DedicatedHostGroup(): :attr str family: The dedicated host profile family for hosts in this group. :attr str href: The URL for this dedicated host group. :attr str id: The unique identifier for this dedicated host group. - :attr str name: The unique user-defined name for this dedicated host group. + :attr str name: The name for this dedicated host group. The name is unique + across all dedicated host groups in the region. :attr ResourceGroupReference resource_group: The resource group for this dedicated host group. :attr str resource_type: The resource type. @@ -25067,8 +26103,8 @@ def __init__(self, group. :param str href: The URL for this dedicated host group. :param str id: The unique identifier for this dedicated host group. - :param str name: The unique user-defined name for this dedicated host - group. + :param str name: The name for this dedicated host group. The name is unique + across all dedicated host groups in the region. :param ResourceGroupReference resource_group: The resource group for this dedicated host group. :param str resource_type: The resource type. @@ -25106,7 +26142,7 @@ def from_dict(cls, _dict: Dict) -> 'DedicatedHostGroup': else: raise ValueError('Required property \'crn\' not present in DedicatedHostGroup JSON') if 'dedicated_hosts' in _dict: - args['dedicated_hosts'] = [DedicatedHostReference.from_dict(x) for x in _dict.get('dedicated_hosts')] + args['dedicated_hosts'] = [DedicatedHostReference.from_dict(v) for v in _dict.get('dedicated_hosts')] else: raise ValueError('Required property \'dedicated_hosts\' not present in DedicatedHostGroup JSON') if 'family' in _dict: @@ -25134,7 +26170,7 @@ def from_dict(cls, _dict: Dict) -> 'DedicatedHostGroup': else: raise ValueError('Required property \'resource_type\' not present in DedicatedHostGroup JSON') if 'supported_instance_profiles' in _dict: - args['supported_instance_profiles'] = [InstanceProfileReference.from_dict(x) for x in _dict.get('supported_instance_profiles')] + args['supported_instance_profiles'] = [InstanceProfileReference.from_dict(v) for v in _dict.get('supported_instance_profiles')] else: raise ValueError('Required property \'supported_instance_profiles\' not present in DedicatedHostGroup JSON') if 'zone' in _dict: @@ -25158,7 +26194,13 @@ def to_dict(self) -> Dict: if hasattr(self, 'crn') and self.crn is not None: _dict['crn'] = self.crn if hasattr(self, 'dedicated_hosts') and self.dedicated_hosts is not None: - _dict['dedicated_hosts'] = [x.to_dict() for x in self.dedicated_hosts] + dedicated_hosts_list = [] + for v in self.dedicated_hosts: + if isinstance(v, dict): + dedicated_hosts_list.append(v) + else: + dedicated_hosts_list.append(v.to_dict()) + _dict['dedicated_hosts'] = dedicated_hosts_list if hasattr(self, 'family') and self.family is not None: _dict['family'] = self.family if hasattr(self, 'href') and self.href is not None: @@ -25168,13 +26210,25 @@ def to_dict(self) -> Dict: if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'resource_group') and self.resource_group is not None: - _dict['resource_group'] = self.resource_group.to_dict() + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() if hasattr(self, 'resource_type') and self.resource_type is not None: _dict['resource_type'] = self.resource_type if hasattr(self, 'supported_instance_profiles') and self.supported_instance_profiles is not None: - _dict['supported_instance_profiles'] = [x.to_dict() for x in self.supported_instance_profiles] + supported_instance_profiles_list = [] + for v in self.supported_instance_profiles: + if isinstance(v, dict): + supported_instance_profiles_list.append(v) + else: + supported_instance_profiles_list.append(v.to_dict()) + _dict['supported_instance_profiles'] = supported_instance_profiles_list if hasattr(self, 'zone') and self.zone is not None: - _dict['zone'] = self.zone.to_dict() + if isinstance(self.zone, dict): + _dict['zone'] = self.zone + else: + _dict['zone'] = self.zone.to_dict() return _dict def _to_dict(self): @@ -25262,7 +26316,7 @@ def from_dict(cls, _dict: Dict) -> 'DedicatedHostGroupCollection': else: raise ValueError('Required property \'first\' not present in DedicatedHostGroupCollection JSON') if 'groups' in _dict: - args['groups'] = [DedicatedHostGroup.from_dict(x) for x in _dict.get('groups')] + args['groups'] = [DedicatedHostGroup.from_dict(v) for v in _dict.get('groups')] else: raise ValueError('Required property \'groups\' not present in DedicatedHostGroupCollection JSON') if 'limit' in _dict: @@ -25286,13 +26340,25 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'first') and self.first is not None: - _dict['first'] = self.first.to_dict() + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() if hasattr(self, 'groups') and self.groups is not None: - _dict['groups'] = [x.to_dict() for x in self.groups] + groups_list = [] + for v in self.groups: + if isinstance(v, dict): + groups_list.append(v) + else: + groups_list.append(v.to_dict()) + _dict['groups'] = groups_list if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit if hasattr(self, 'next') and self.next is not None: - _dict['next'] = self.next.to_dict() + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() if hasattr(self, 'total_count') and self.total_count is not None: _dict['total_count'] = self.total_count return _dict @@ -25447,8 +26513,8 @@ class DedicatedHostGroupPatch(): """ DedicatedHostGroupPatch. - :attr str name: (optional) The unique user-defined name for this dedicated host - group. + :attr str name: (optional) The name for this dedicated host group. The name must + not be used by another dedicated host group in the region. """ def __init__(self, @@ -25457,8 +26523,8 @@ def __init__(self, """ Initialize a DedicatedHostGroupPatch object. - :param str name: (optional) The unique user-defined name for this dedicated - host group. + :param str name: (optional) The name for this dedicated host group. The + name must not be used by another dedicated host group in the region. """ self.name = name @@ -25504,8 +26570,9 @@ class DedicatedHostGroupPrototypeDedicatedHostByZoneContext(): """ DedicatedHostGroupPrototypeDedicatedHostByZoneContext. - :attr str name: (optional) The unique user-defined name for this dedicated host - group. + :attr str name: (optional) The name for this dedicated host group. The name must + not be used by another dedicated host group in the region. If unspecified, the + name will be a hyphenated list of randomly-selected words. :attr ResourceGroupIdentity resource_group: (optional) The resource group to use. If unspecified, the host's resource group is used. """ @@ -25517,8 +26584,9 @@ def __init__(self, """ Initialize a DedicatedHostGroupPrototypeDedicatedHostByZoneContext object. - :param str name: (optional) The unique user-defined name for this dedicated - host group. + :param str name: (optional) The name for this dedicated host group. The + name must not be used by another dedicated host group in the region. If + unspecified, the name will be a hyphenated list of randomly-selected words. :param ResourceGroupIdentity resource_group: (optional) The resource group to use. If unspecified, the host's resource group is used. """ @@ -25580,7 +26648,8 @@ class DedicatedHostGroupReference(): some supplementary information. :attr str href: The URL for this dedicated host group. :attr str id: The unique identifier for this dedicated host group. - :attr str name: The unique user-defined name for this dedicated host group. + :attr str name: The name for this dedicated host group. The name is unique + across all dedicated host groups in the region. :attr str resource_type: The resource type. """ @@ -25598,8 +26667,8 @@ def __init__(self, :param str crn: The CRN for this dedicated host group. :param str href: The URL for this dedicated host group. :param str id: The unique identifier for this dedicated host group. - :param str name: The unique user-defined name for this dedicated host - group. + :param str name: The name for this dedicated host group. The name is unique + across all dedicated host groups in the region. :param str resource_type: The resource type. :param DedicatedHostGroupReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and @@ -25652,7 +26721,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'crn') and self.crn is not None: _dict['crn'] = self.crn if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -25751,7 +26823,8 @@ class DedicatedHostPatch(): :attr bool instance_placement_enabled: (optional) If set to true, instances can be placed on this dedicated host. - :attr str name: (optional) The unique user-defined name for this dedicated host. + :attr str name: (optional) The name for this dedicated host. The name must not + be used by another dedicated host in the region. """ def __init__(self, @@ -25763,8 +26836,8 @@ def __init__(self, :param bool instance_placement_enabled: (optional) If set to true, instances can be placed on this dedicated host. - :param str name: (optional) The unique user-defined name for this dedicated - host. + :param str name: (optional) The name for this dedicated host. The name must + not be used by another dedicated host in the region. """ self.instance_placement_enabled = instance_placement_enabled self.name = name @@ -25887,7 +26960,7 @@ def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfile': else: raise ValueError('Required property \'class\' not present in DedicatedHostProfile JSON') if 'disks' in _dict: - args['disks'] = [DedicatedHostProfileDisk.from_dict(x) for x in _dict.get('disks')] + args['disks'] = [DedicatedHostProfileDisk.from_dict(v) for v in _dict.get('disks')] else: raise ValueError('Required property \'disks\' not present in DedicatedHostProfile JSON') if 'family' in _dict: @@ -25911,7 +26984,7 @@ def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfile': else: raise ValueError('Required property \'socket_count\' not present in DedicatedHostProfile JSON') if 'supported_instance_profiles' in _dict: - args['supported_instance_profiles'] = [InstanceProfileReference.from_dict(x) for x in _dict.get('supported_instance_profiles')] + args['supported_instance_profiles'] = [InstanceProfileReference.from_dict(v) for v in _dict.get('supported_instance_profiles')] else: raise ValueError('Required property \'supported_instance_profiles\' not present in DedicatedHostProfile JSON') if 'vcpu_architecture' in _dict: @@ -25935,7 +27008,13 @@ def to_dict(self) -> Dict: if hasattr(self, 'class_') and self.class_ is not None: _dict['class'] = self.class_ if hasattr(self, 'disks') and self.disks is not None: - _dict['disks'] = [x.to_dict() for x in self.disks] + disks_list = [] + for v in self.disks: + if isinstance(v, dict): + disks_list.append(v) + else: + disks_list.append(v.to_dict()) + _dict['disks'] = disks_list if hasattr(self, 'family') and self.family is not None: _dict['family'] = self.family if hasattr(self, 'href') and self.href is not None: @@ -25953,9 +27032,18 @@ def to_dict(self) -> Dict: else: _dict['socket_count'] = self.socket_count.to_dict() if hasattr(self, 'supported_instance_profiles') and self.supported_instance_profiles is not None: - _dict['supported_instance_profiles'] = [x.to_dict() for x in self.supported_instance_profiles] + supported_instance_profiles_list = [] + for v in self.supported_instance_profiles: + if isinstance(v, dict): + supported_instance_profiles_list.append(v) + else: + supported_instance_profiles_list.append(v.to_dict()) + _dict['supported_instance_profiles'] = supported_instance_profiles_list if hasattr(self, 'vcpu_architecture') and self.vcpu_architecture is not None: - _dict['vcpu_architecture'] = self.vcpu_architecture.to_dict() + if isinstance(self.vcpu_architecture, dict): + _dict['vcpu_architecture'] = self.vcpu_architecture + else: + _dict['vcpu_architecture'] = self.vcpu_architecture.to_dict() if hasattr(self, 'vcpu_count') and self.vcpu_count is not None: if isinstance(self.vcpu_count, dict): _dict['vcpu_count'] = self.vcpu_count @@ -26052,7 +27140,7 @@ def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileCollection': if 'next' in _dict: args['next'] = DedicatedHostProfileCollectionNext.from_dict(_dict.get('next')) if 'profiles' in _dict: - args['profiles'] = [DedicatedHostProfile.from_dict(x) for x in _dict.get('profiles')] + args['profiles'] = [DedicatedHostProfile.from_dict(v) for v in _dict.get('profiles')] else: raise ValueError('Required property \'profiles\' not present in DedicatedHostProfileCollection JSON') if 'total_count' in _dict: @@ -26070,13 +27158,25 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'first') and self.first is not None: - _dict['first'] = self.first.to_dict() + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit if hasattr(self, 'next') and self.next is not None: - _dict['next'] = self.next.to_dict() + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() if hasattr(self, 'profiles') and self.profiles is not None: - _dict['profiles'] = [x.to_dict() for x in self.profiles] + profiles_list = [] + for v in self.profiles: + if isinstance(v, dict): + profiles_list.append(v) + else: + profiles_list.append(v.to_dict()) + _dict['profiles'] = profiles_list if hasattr(self, 'total_count') and self.total_count is not None: _dict['total_count'] = self.total_count return _dict @@ -26276,13 +27376,25 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'interface_type') and self.interface_type is not None: - _dict['interface_type'] = self.interface_type.to_dict() + if isinstance(self.interface_type, dict): + _dict['interface_type'] = self.interface_type + else: + _dict['interface_type'] = self.interface_type.to_dict() if hasattr(self, 'quantity') and self.quantity is not None: - _dict['quantity'] = self.quantity.to_dict() + if isinstance(self.quantity, dict): + _dict['quantity'] = self.quantity + else: + _dict['quantity'] = self.quantity.to_dict() if hasattr(self, 'size') and self.size is not None: - _dict['size'] = self.size.to_dict() + if isinstance(self.size, dict): + _dict['size'] = self.size + else: + _dict['size'] = self.size.to_dict() if hasattr(self, 'supported_instance_interface_types') and self.supported_instance_interface_types is not None: - _dict['supported_instance_interface_types'] = self.supported_instance_interface_types.to_dict() + if isinstance(self.supported_instance_interface_types, dict): + _dict['supported_instance_interface_types'] = self.supported_instance_interface_types + else: + _dict['supported_instance_interface_types'] = self.supported_instance_interface_types.to_dict() return _dict def _to_dict(self): @@ -26836,8 +27948,9 @@ class DedicatedHostPrototype(): :attr bool instance_placement_enabled: (optional) If set to true, instances can 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 str name: (optional) The name for this dedicated host. The name must not + be used by another dedicated host in the region. If unspecified, the name will + be a hyphenated list of randomly-selected words. :attr DedicatedHostProfileIdentity profile: The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) to use for this dedicated host. @@ -26861,9 +27974,9 @@ def __init__(self, dedicated host. :param bool instance_placement_enabled: (optional) If set to true, instances can be placed on this dedicated host. - :param 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. + :param str name: (optional) The name for this dedicated host. The name must + not be used by another dedicated host in the region. If unspecified, the + name will be a hyphenated list of randomly-selected words. :param ResourceGroupIdentity resource_group: (optional) The resource group to use. If unspecified, the account's [default resource group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is @@ -26883,7 +27996,8 @@ class DedicatedHostReference(): some supplementary information. :attr str href: The URL for this dedicated host. :attr str id: The unique identifier for this dedicated host. - :attr str name: The unique user-defined name for this dedicated host. + :attr str name: The name for this dedicated host. The name is unique across all + dedicated hosts in the region. :attr str resource_type: The resource type. """ @@ -26901,7 +28015,8 @@ def __init__(self, :param str crn: The CRN for this dedicated host. :param str href: The URL for this dedicated host. :param str id: The unique identifier for this dedicated host. - :param str name: The unique user-defined name for this dedicated host. + :param str name: The name for this dedicated host. The name is unique + across all dedicated hosts in the region. :param str resource_type: The resource type. :param DedicatedHostReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and provides @@ -26953,7 +28068,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'crn') and self.crn is not None: _dict['crn'] = self.crn if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -27056,7 +28174,7 @@ class DefaultNetworkACL(): :attr str id: The unique identifier for this network ACL. :attr str name: The name of the default network ACL created for a VPC. The name will be a hyphenated list of randomly-selected words at creation, but may be - user-specified with a subsequent request. + changed. :attr ResourceGroupReference resource_group: The resource group for the default network ACL for a VPC. Set to the VPC's resource group at creation. @@ -27089,7 +28207,7 @@ def __init__(self, :param str id: The unique identifier for this network ACL. :param str name: The name of the default network ACL created for a VPC. The name will be a hyphenated list of randomly-selected words at creation, but - may be user-specified with a subsequent request. + may be changed. :param ResourceGroupReference resource_group: The resource group for the default network ACL for a VPC. Set to the VPC's resource group at creation. @@ -27140,11 +28258,11 @@ def from_dict(cls, _dict: Dict) -> 'DefaultNetworkACL': else: raise ValueError('Required property \'resource_group\' not present in DefaultNetworkACL JSON') if 'rules' in _dict: - args['rules'] = [NetworkACLRuleItem.from_dict(x) for x in _dict.get('rules')] + args['rules'] = [NetworkACLRuleItem.from_dict(v) for v in _dict.get('rules')] else: raise ValueError('Required property \'rules\' not present in DefaultNetworkACL JSON') if 'subnets' in _dict: - args['subnets'] = [SubnetReference.from_dict(x) for x in _dict.get('subnets')] + args['subnets'] = [SubnetReference.from_dict(v) for v in _dict.get('subnets')] else: raise ValueError('Required property \'subnets\' not present in DefaultNetworkACL JSON') if 'vpc' in _dict: @@ -27172,13 +28290,31 @@ def to_dict(self) -> Dict: if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'resource_group') and self.resource_group is not None: - _dict['resource_group'] = self.resource_group.to_dict() + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() if hasattr(self, 'rules') and self.rules is not None: - _dict['rules'] = [x.to_dict() for x in self.rules] + rules_list = [] + for v in self.rules: + if isinstance(v, dict): + rules_list.append(v) + else: + rules_list.append(v.to_dict()) + _dict['rules'] = rules_list if hasattr(self, 'subnets') and self.subnets is not None: - _dict['subnets'] = [x.to_dict() for x in self.subnets] + subnets_list = [] + for v in self.subnets: + if isinstance(v, dict): + subnets_list.append(v) + else: + subnets_list.append(v.to_dict()) + _dict['subnets'] = subnets_list if hasattr(self, 'vpc') and self.vpc is not None: - _dict['vpc'] = self.vpc.to_dict() + if isinstance(self.vpc, dict): + _dict['vpc'] = self.vpc + else: + _dict['vpc'] = self.vpc.to_dict() return _dict def _to_dict(self): @@ -27217,7 +28353,7 @@ class DefaultRoutingTable(): :attr str lifecycle_state: The lifecycle state of the routing table. :attr str name: The name of the default routing table created for this VPC. The name will be a hyphenated list of randomly-selected words at creation, but may - be user-specified with a subsequent request. + be changed. :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 @@ -27296,7 +28432,7 @@ def __init__(self, :param str lifecycle_state: The lifecycle state of the routing table. :param str name: The name of the default routing table created for this VPC. The name will be a hyphenated list of randomly-selected words at - creation, but may be user-specified with a subsequent request. + creation, but may be changed. :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 @@ -27365,7 +28501,7 @@ def from_dict(cls, _dict: Dict) -> 'DefaultRoutingTable': """Initialize a DefaultRoutingTable object from a json dictionary.""" args = {} if 'accept_routes_from' in _dict: - args['accept_routes_from'] = [ResourceFilter.from_dict(x) for x in _dict.get('accept_routes_from')] + args['accept_routes_from'] = [ResourceFilter.from_dict(v) for v in _dict.get('accept_routes_from')] else: raise ValueError('Required property \'accept_routes_from\' not present in DefaultRoutingTable JSON') if 'created_at' in _dict: @@ -27413,11 +28549,11 @@ def from_dict(cls, _dict: Dict) -> 'DefaultRoutingTable': else: raise ValueError('Required property \'route_vpc_zone_ingress\' not present in DefaultRoutingTable JSON') if 'routes' in _dict: - args['routes'] = [RouteReference.from_dict(x) for x in _dict.get('routes')] + args['routes'] = [RouteReference.from_dict(v) for v in _dict.get('routes')] else: raise ValueError('Required property \'routes\' not present in DefaultRoutingTable JSON') if 'subnets' in _dict: - args['subnets'] = [SubnetReference.from_dict(x) for x in _dict.get('subnets')] + args['subnets'] = [SubnetReference.from_dict(v) for v in _dict.get('subnets')] else: raise ValueError('Required property \'subnets\' not present in DefaultRoutingTable JSON') return cls(**args) @@ -27431,7 +28567,13 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'accept_routes_from') and self.accept_routes_from is not None: - _dict['accept_routes_from'] = [x.to_dict() for x in self.accept_routes_from] + accept_routes_from_list = [] + for v in self.accept_routes_from: + if isinstance(v, dict): + accept_routes_from_list.append(v) + else: + accept_routes_from_list.append(v.to_dict()) + _dict['accept_routes_from'] = accept_routes_from_list if hasattr(self, 'created_at') and self.created_at is not None: _dict['created_at'] = datetime_to_string(self.created_at) if hasattr(self, 'href') and self.href is not None: @@ -27455,9 +28597,21 @@ def to_dict(self) -> Dict: if hasattr(self, 'route_vpc_zone_ingress') and self.route_vpc_zone_ingress is not None: _dict['route_vpc_zone_ingress'] = self.route_vpc_zone_ingress if hasattr(self, 'routes') and self.routes is not None: - _dict['routes'] = [x.to_dict() for x in self.routes] + routes_list = [] + for v in self.routes: + if isinstance(v, dict): + routes_list.append(v) + else: + routes_list.append(v.to_dict()) + _dict['routes'] = routes_list if hasattr(self, 'subnets') and self.subnets is not None: - _dict['subnets'] = [x.to_dict() for x in self.subnets] + subnets_list = [] + for v in self.subnets: + if isinstance(v, dict): + subnets_list.append(v) + else: + subnets_list.append(v.to_dict()) + _dict['subnets'] = subnets_list return _dict def _to_dict(self): @@ -27507,9 +28661,8 @@ class DefaultSecurityGroup(): :attr str crn: The security group's CRN. :attr str href: The security group's canonical URL. :attr str id: The unique identifier for this security group. - :attr str name: The name of the default security group created for a VPC. The - name will be a hyphenated list of randomly-selected words at creation, but may - be user-specified with a subsequent request. + :attr str name: The name for the default security group for a VPC. The name will + be a hyphenated list of randomly-selected words at creation, but may changed. :attr ResourceGroupReference resource_group: The resource group for this security group. :attr List[SecurityGroupRule] rules: The rules for the default security group @@ -27539,9 +28692,9 @@ def __init__(self, :param str crn: The security group's CRN. :param str href: The security group's canonical URL. :param str id: The unique identifier for this security group. - :param str name: The name of the default security group created for a VPC. - The name will be a hyphenated list of randomly-selected words at creation, - but may be user-specified with a subsequent request. + :param str name: The name for the default security group for a VPC. The + name will be a hyphenated list of randomly-selected words at creation, but + may changed. :param ResourceGroupReference resource_group: The resource group for this security group. :param List[SecurityGroupRule] rules: The rules for the default security @@ -27592,7 +28745,7 @@ def from_dict(cls, _dict: Dict) -> 'DefaultSecurityGroup': else: raise ValueError('Required property \'resource_group\' not present in DefaultSecurityGroup JSON') if 'rules' in _dict: - args['rules'] = [SecurityGroupRule.from_dict(x) for x in _dict.get('rules')] + args['rules'] = [SecurityGroupRule.from_dict(v) for v in _dict.get('rules')] else: raise ValueError('Required property \'rules\' not present in DefaultSecurityGroup JSON') if 'targets' in _dict: @@ -27624,19 +28777,31 @@ def to_dict(self) -> Dict: if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'resource_group') and self.resource_group is not None: - _dict['resource_group'] = self.resource_group.to_dict() + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() if hasattr(self, 'rules') and self.rules is not None: - _dict['rules'] = [x.to_dict() for x in self.rules] + rules_list = [] + for v in self.rules: + if isinstance(v, dict): + rules_list.append(v) + else: + rules_list.append(v.to_dict()) + _dict['rules'] = rules_list if hasattr(self, 'targets') and self.targets is not None: targets_list = [] - for x in self.targets: - if isinstance(x, dict): - targets_list.append(x) + for v in self.targets: + if isinstance(v, dict): + targets_list.append(v) else: - targets_list.append(x.to_dict()) + targets_list.append(v.to_dict()) _dict['targets'] = targets_list if hasattr(self, 'vpc') and self.vpc is not None: - _dict['vpc'] = self.vpc.to_dict() + if isinstance(self.vpc, dict): + _dict['vpc'] = self.vpc + else: + _dict['vpc'] = self.vpc.to_dict() return _dict def _to_dict(self): @@ -27757,14 +28922,15 @@ class EndpointGateway(): :attr List[ReservedIPReference] ips: The reserved IPs bound to this endpoint gateway. :attr str lifecycle_state: The lifecycle state of the endpoint gateway. - :attr str name: The unique user-defined name for this endpoint gateway. + :attr str name: The name for this endpoint gateway. The name is unique across + all endpoint gateways in the VPC. :attr ResourceGroupReference resource_group: The resource group for this endpoint gateway. :attr str resource_type: The resource type. :attr List[SecurityGroupReference] security_groups: The security groups targeting this endpoint gateway. - :attr str service_endpoint: (optional) The fully qualified domain name for the - target service. + :attr str service_endpoint: (optional) Deprecated: The fully qualified domain + name for the target service. :attr List[str] service_endpoints: The fully qualified domain names for the target service. :attr EndpointGatewayTarget target: The target for this endpoint gateway. @@ -27809,7 +28975,8 @@ def __init__(self, :param List[ReservedIPReference] ips: The reserved IPs bound to this endpoint gateway. :param str lifecycle_state: The lifecycle state of the endpoint gateway. - :param str name: The unique user-defined name for this endpoint gateway. + :param str name: The name for this endpoint gateway. The name is unique + across all endpoint gateways in the VPC. :param ResourceGroupReference resource_group: The resource group for this endpoint gateway. :param str resource_type: The resource type. @@ -27819,8 +28986,8 @@ def __init__(self, the target service. :param EndpointGatewayTarget target: The target for this endpoint gateway. :param VPCReference vpc: The VPC this endpoint gateway resides in. - :param str service_endpoint: (optional) The fully qualified domain name for - the target service. + :param str service_endpoint: (optional) Deprecated: The fully qualified + domain name for the target service. """ self.created_at = created_at self.crn = crn @@ -27863,7 +29030,7 @@ def from_dict(cls, _dict: Dict) -> 'EndpointGateway': else: raise ValueError('Required property \'id\' not present in EndpointGateway JSON') if 'ips' in _dict: - args['ips'] = [ReservedIPReference.from_dict(x) for x in _dict.get('ips')] + args['ips'] = [ReservedIPReference.from_dict(v) for v in _dict.get('ips')] else: raise ValueError('Required property \'ips\' not present in EndpointGateway JSON') if 'lifecycle_state' in _dict: @@ -27883,7 +29050,7 @@ def from_dict(cls, _dict: Dict) -> 'EndpointGateway': else: raise ValueError('Required property \'resource_type\' not present in EndpointGateway JSON') if 'security_groups' in _dict: - args['security_groups'] = [SecurityGroupReference.from_dict(x) for x in _dict.get('security_groups')] + args['security_groups'] = [SecurityGroupReference.from_dict(v) for v in _dict.get('security_groups')] else: raise ValueError('Required property \'security_groups\' not present in EndpointGateway JSON') if 'service_endpoint' in _dict: @@ -27921,17 +29088,32 @@ def to_dict(self) -> Dict: if hasattr(self, 'id') and self.id is not None: _dict['id'] = self.id if hasattr(self, 'ips') and self.ips is not None: - _dict['ips'] = [x.to_dict() for x in self.ips] + ips_list = [] + for v in self.ips: + if isinstance(v, dict): + ips_list.append(v) + else: + ips_list.append(v.to_dict()) + _dict['ips'] = ips_list if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None: _dict['lifecycle_state'] = self.lifecycle_state if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'resource_group') and self.resource_group is not None: - _dict['resource_group'] = self.resource_group.to_dict() + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() if hasattr(self, 'resource_type') and self.resource_type is not None: _dict['resource_type'] = self.resource_type if hasattr(self, 'security_groups') and self.security_groups is not None: - _dict['security_groups'] = [x.to_dict() for x in self.security_groups] + security_groups_list = [] + for v in self.security_groups: + if isinstance(v, dict): + security_groups_list.append(v) + else: + security_groups_list.append(v.to_dict()) + _dict['security_groups'] = security_groups_list if hasattr(self, 'service_endpoint') and self.service_endpoint is not None: _dict['service_endpoint'] = self.service_endpoint if hasattr(self, 'service_endpoints') and self.service_endpoints is not None: @@ -27942,7 +29124,10 @@ def to_dict(self) -> Dict: else: _dict['target'] = self.target.to_dict() if hasattr(self, 'vpc') and self.vpc is not None: - _dict['vpc'] = self.vpc.to_dict() + if isinstance(self.vpc, dict): + _dict['vpc'] = self.vpc + else: + _dict['vpc'] = self.vpc.to_dict() return _dict def _to_dict(self): @@ -28047,7 +29232,7 @@ def from_dict(cls, _dict: Dict) -> 'EndpointGatewayCollection': """Initialize a EndpointGatewayCollection object from a json dictionary.""" args = {} if 'endpoint_gateways' in _dict: - args['endpoint_gateways'] = [EndpointGateway.from_dict(x) for x in _dict.get('endpoint_gateways')] + args['endpoint_gateways'] = [EndpointGateway.from_dict(v) for v in _dict.get('endpoint_gateways')] else: raise ValueError('Required property \'endpoint_gateways\' not present in EndpointGatewayCollection JSON') if 'first' in _dict: @@ -28075,13 +29260,25 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'endpoint_gateways') and self.endpoint_gateways is not None: - _dict['endpoint_gateways'] = [x.to_dict() for x in self.endpoint_gateways] + endpoint_gateways_list = [] + for v in self.endpoint_gateways: + if isinstance(v, dict): + endpoint_gateways_list.append(v) + else: + endpoint_gateways_list.append(v.to_dict()) + _dict['endpoint_gateways'] = endpoint_gateways_list if hasattr(self, 'first') and self.first is not None: - _dict['first'] = self.first.to_dict() + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit if hasattr(self, 'next') and self.next is not None: - _dict['next'] = self.next.to_dict() + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() if hasattr(self, 'total_count') and self.total_count is not None: _dict['total_count'] = self.total_count return _dict @@ -28221,8 +29418,8 @@ class EndpointGatewayPatch(): """ EndpointGatewayPatch. - :attr str name: (optional) The user-defined name for this endpoint gateway. - Names must be unique within the VPC this endpoint gateway is serving. + :attr str name: (optional) The name for this endpoint gateway. The name must not + be used by another endpoint gateway in the VPC. """ def __init__(self, @@ -28231,9 +29428,8 @@ def __init__(self, """ Initialize a EndpointGatewayPatch object. - :param str name: (optional) The user-defined name for this endpoint - gateway. Names must be unique within the VPC this endpoint gateway is - serving. + :param str name: (optional) The name for this endpoint gateway. The name + must not be used by another endpoint gateway in the VPC. """ self.name = name @@ -28434,7 +29630,8 @@ class FloatingIP(): :attr str crn: The CRN for this floating IP. :attr str href: The URL for this floating IP. :attr str id: The unique identifier for this floating IP. - :attr str name: The unique user-defined name for this floating IP. + :attr str name: The name for this floating IP. The name is unique across all + floating IPs in the region. :attr ResourceGroupReference resource_group: The resource group for this floating IP. :attr str status: The status of the floating IP. @@ -28463,7 +29660,8 @@ def __init__(self, :param str crn: The CRN for this floating IP. :param str href: The URL for this floating IP. :param str id: The unique identifier for this floating IP. - :param str name: The unique user-defined name for this floating IP. + :param str name: The name for this floating IP. The name is unique across + all floating IPs in the region. :param ResourceGroupReference resource_group: The resource group for this floating IP. :param str status: The status of the floating IP. @@ -28546,7 +29744,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'resource_group') and self.resource_group is not None: - _dict['resource_group'] = self.resource_group.to_dict() + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() if hasattr(self, 'status') and self.status is not None: _dict['status'] = self.status if hasattr(self, 'target') and self.target is not None: @@ -28555,7 +29756,10 @@ def to_dict(self) -> Dict: else: _dict['target'] = self.target.to_dict() if hasattr(self, 'zone') and self.zone is not None: - _dict['zone'] = self.zone.to_dict() + if isinstance(self.zone, dict): + _dict['zone'] = self.zone + else: + _dict['zone'] = self.zone.to_dict() return _dict def _to_dict(self): @@ -28650,7 +29854,7 @@ def from_dict(cls, _dict: Dict) -> 'FloatingIPCollection': else: raise ValueError('Required property \'first\' not present in FloatingIPCollection JSON') if 'floating_ips' in _dict: - args['floating_ips'] = [FloatingIP.from_dict(x) for x in _dict.get('floating_ips')] + args['floating_ips'] = [FloatingIP.from_dict(v) for v in _dict.get('floating_ips')] else: raise ValueError('Required property \'floating_ips\' not present in FloatingIPCollection JSON') if 'limit' in _dict: @@ -28674,13 +29878,25 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'first') and self.first is not None: - _dict['first'] = self.first.to_dict() + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() if hasattr(self, 'floating_ips') and self.floating_ips is not None: - _dict['floating_ips'] = [x.to_dict() for x in self.floating_ips] + floating_ips_list = [] + for v in self.floating_ips: + if isinstance(v, dict): + floating_ips_list.append(v) + else: + floating_ips_list.append(v.to_dict()) + _dict['floating_ips'] = floating_ips_list if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit if hasattr(self, 'next') and self.next is not None: - _dict['next'] = self.next.to_dict() + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() if hasattr(self, 'total_count') and self.total_count is not None: _dict['total_count'] = self.total_count return _dict @@ -28820,7 +30036,8 @@ class FloatingIPPatch(): """ FloatingIPPatch. - :attr str name: (optional) The unique user-defined name for this floating IP. + :attr str name: (optional) The name for this floating IP. The name must not be + used by another floating IP in the region. :attr FloatingIPTargetPatch target: (optional) 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 @@ -28834,8 +30051,8 @@ def __init__(self, """ Initialize a FloatingIPPatch object. - :param str name: (optional) The unique user-defined name for this floating - IP. + :param str name: (optional) The name for this floating IP. The name must + not be used by another floating IP in the region. :param FloatingIPTargetPatch target: (optional) 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 @@ -28893,8 +30110,9 @@ class FloatingIPPrototype(): """ FloatingIPPrototype. - :attr str name: (optional) The unique user-defined name for this floating IP. If - unspecified, the name will be a hyphenated list of randomly-selected words. + :attr str name: (optional) The name for this floating IP. The name must not be + used by another floating IP in the region. If unspecified, the name will be a + hyphenated list of randomly-selected words. :attr ResourceGroupIdentity resource_group: (optional) The resource group to use. If unspecified, the account's [default resource group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. @@ -28907,9 +30125,9 @@ def __init__(self, """ Initialize a FloatingIPPrototype object. - :param str name: (optional) The unique user-defined name for this floating - IP. If unspecified, the name will be a hyphenated list of randomly-selected - words. + :param str name: (optional) The name for this floating IP. The name must + not be used by another floating IP in the region. If unspecified, the name + will be a hyphenated list of randomly-selected words. :param ResourceGroupIdentity resource_group: (optional) The resource group to use. If unspecified, the account's [default resource group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is @@ -28930,7 +30148,8 @@ class FloatingIPReference(): some supplementary information. :attr str href: The URL for this floating IP. :attr str id: The unique identifier for this floating IP. - :attr str name: The unique user-defined name for this floating IP. + :attr str name: The name for this floating IP. The name is unique across all + floating IPs in the region. """ def __init__(self, @@ -28948,7 +30167,8 @@ def __init__(self, :param str crn: The CRN for this floating IP. :param str href: The URL for this floating IP. :param str id: The unique identifier for this floating IP. - :param str name: The unique user-defined name for this floating IP. + :param str name: The name for this floating IP. The name is unique across + all floating IPs in the region. :param FloatingIPReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and provides some supplementary information. @@ -29001,7 +30221,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'crn') and self.crn is not None: _dict['crn'] = self.crn if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -29137,7 +30360,7 @@ def from_dict(cls, _dict: Dict) -> 'FloatingIPUnpaginatedCollection': """Initialize a FloatingIPUnpaginatedCollection object from a json dictionary.""" args = {} if 'floating_ips' in _dict: - args['floating_ips'] = [FloatingIP.from_dict(x) for x in _dict.get('floating_ips')] + args['floating_ips'] = [FloatingIP.from_dict(v) for v in _dict.get('floating_ips')] else: raise ValueError('Required property \'floating_ips\' not present in FloatingIPUnpaginatedCollection JSON') return cls(**args) @@ -29151,7 +30374,13 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'floating_ips') and self.floating_ips is not None: - _dict['floating_ips'] = [x.to_dict() for x in self.floating_ips] + floating_ips_list = [] + for v in self.floating_ips: + if isinstance(v, dict): + floating_ips_list.append(v) + else: + floating_ips_list.append(v.to_dict()) + _dict['floating_ips'] = floating_ips_list return _dict def _to_dict(self): @@ -29186,7 +30415,8 @@ class FlowLogCollector(): :attr str href: The URL for this flow log collector. :attr str id: The unique identifier for this flow log collector. :attr str lifecycle_state: The lifecycle state of the flow log collector. - :attr str name: The unique user-defined name for this flow log collector. + :attr str name: The name for this flow log collector. The name is unique across + all flow log collectors in the region. :attr ResourceGroupReference resource_group: The resource group for this flow log collector. :attr LegacyCloudObjectStorageBucketReference storage_bucket: The Cloud Object @@ -29233,7 +30463,8 @@ def __init__(self, :param str href: The URL for this flow log collector. :param str id: The unique identifier for this flow log collector. :param str lifecycle_state: The lifecycle state of the flow log collector. - :param str name: The unique user-defined name for this flow log collector. + :param str name: The name for this flow log collector. The name is unique + across all flow log collectors in the region. :param ResourceGroupReference resource_group: The resource group for this flow log collector. :param LegacyCloudObjectStorageBucketReference storage_bucket: The Cloud @@ -29348,16 +30579,25 @@ def to_dict(self) -> Dict: if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'resource_group') and self.resource_group is not None: - _dict['resource_group'] = self.resource_group.to_dict() + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() if hasattr(self, 'storage_bucket') and self.storage_bucket is not None: - _dict['storage_bucket'] = self.storage_bucket.to_dict() + if isinstance(self.storage_bucket, dict): + _dict['storage_bucket'] = self.storage_bucket + else: + _dict['storage_bucket'] = self.storage_bucket.to_dict() if hasattr(self, 'target') and self.target is not None: if isinstance(self.target, dict): _dict['target'] = self.target else: _dict['target'] = self.target.to_dict() if hasattr(self, 'vpc') and self.vpc is not None: - _dict['vpc'] = self.vpc.to_dict() + if isinstance(self.vpc, dict): + _dict['vpc'] = self.vpc + else: + _dict['vpc'] = self.vpc.to_dict() return _dict def _to_dict(self): @@ -29443,7 +30683,7 @@ def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorCollection': else: raise ValueError('Required property \'first\' not present in FlowLogCollectorCollection JSON') if 'flow_log_collectors' in _dict: - args['flow_log_collectors'] = [FlowLogCollector.from_dict(x) for x in _dict.get('flow_log_collectors')] + args['flow_log_collectors'] = [FlowLogCollector.from_dict(v) for v in _dict.get('flow_log_collectors')] else: raise ValueError('Required property \'flow_log_collectors\' not present in FlowLogCollectorCollection JSON') if 'limit' in _dict: @@ -29467,13 +30707,25 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'first') and self.first is not None: - _dict['first'] = self.first.to_dict() + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() if hasattr(self, 'flow_log_collectors') and self.flow_log_collectors is not None: - _dict['flow_log_collectors'] = [x.to_dict() for x in self.flow_log_collectors] + flow_log_collectors_list = [] + for v in self.flow_log_collectors: + if isinstance(v, dict): + flow_log_collectors_list.append(v) + else: + flow_log_collectors_list.append(v.to_dict()) + _dict['flow_log_collectors'] = flow_log_collectors_list if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit if hasattr(self, 'next') and self.next is not None: - _dict['next'] = self.next.to_dict() + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() if hasattr(self, 'total_count') and self.total_count is not None: _dict['total_count'] = self.total_count return _dict @@ -29616,8 +30868,8 @@ class FlowLogCollectorPatch(): :attr bool active: (optional) Indicates whether this collector is active. Updating to false deactivates the collector and updating to true activates the collector. - :attr str name: (optional) The unique user-defined name for this flow log - collector. + :attr str name: (optional) The name for this flow log collector. The name must + not be used by another flow log collector in the region. """ def __init__(self, @@ -29630,8 +30882,8 @@ def __init__(self, :param bool active: (optional) Indicates whether this collector is active. Updating to false deactivates the collector and updating to true activates the collector. - :param str name: (optional) The unique user-defined name for this flow log - collector. + :param str name: (optional) The name for this flow log collector. The name + must not be used by another flow log collector in the region. """ self.active = active self.name = name @@ -29794,7 +31046,8 @@ class IKEPolicy(): :attr str id: The unique identifier for this IKE policy. :attr int ike_version: The IKE protocol version. :attr int key_lifetime: The key lifetime in seconds. - :attr str name: The user-defined name for this IKE policy. + :attr str name: The name for this IKE policy. The name is unique across all IKE + policies in the region. :attr str negotiation_mode: The IKE negotiation mode. Only `main` is supported. :attr ResourceGroupReference resource_group: The resource group for this IKE policy. @@ -29832,7 +31085,8 @@ def __init__(self, :param str id: The unique identifier for this IKE policy. :param int ike_version: The IKE protocol version. :param int key_lifetime: The key lifetime in seconds. - :param str name: The user-defined name for this IKE policy. + :param str name: The name for this IKE policy. The name is unique across + all IKE policies in the region. :param str negotiation_mode: The IKE negotiation mode. Only `main` is supported. :param ResourceGroupReference resource_group: The resource group for this @@ -29862,7 +31116,7 @@ def from_dict(cls, _dict: Dict) -> 'IKEPolicy': else: raise ValueError('Required property \'authentication_algorithm\' not present in IKEPolicy JSON') if 'connections' in _dict: - args['connections'] = [VPNGatewayConnectionReference.from_dict(x) for x in _dict.get('connections')] + args['connections'] = [VPNGatewayConnectionReference.from_dict(v) for v in _dict.get('connections')] else: raise ValueError('Required property \'connections\' not present in IKEPolicy JSON') if 'created_at' in _dict: @@ -29922,7 +31176,13 @@ def to_dict(self) -> Dict: if hasattr(self, 'authentication_algorithm') and self.authentication_algorithm is not None: _dict['authentication_algorithm'] = self.authentication_algorithm if hasattr(self, 'connections') and self.connections is not None: - _dict['connections'] = [x.to_dict() for x in self.connections] + connections_list = [] + for v in self.connections: + if isinstance(v, dict): + connections_list.append(v) + else: + connections_list.append(v.to_dict()) + _dict['connections'] = connections_list if hasattr(self, 'created_at') and self.created_at is not None: _dict['created_at'] = datetime_to_string(self.created_at) if hasattr(self, 'dh_group') and self.dh_group is not None: @@ -29942,7 +31202,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'negotiation_mode') and self.negotiation_mode is not None: _dict['negotiation_mode'] = self.negotiation_mode if hasattr(self, 'resource_group') and self.resource_group is not None: - _dict['resource_group'] = self.resource_group.to_dict() + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() if hasattr(self, 'resource_type') and self.resource_type is not None: _dict['resource_type'] = self.resource_type return _dict @@ -30051,7 +31314,7 @@ def from_dict(cls, _dict: Dict) -> 'IKEPolicyCollection': else: raise ValueError('Required property \'first\' not present in IKEPolicyCollection JSON') if 'ike_policies' in _dict: - args['ike_policies'] = [IKEPolicy.from_dict(x) for x in _dict.get('ike_policies')] + args['ike_policies'] = [IKEPolicy.from_dict(v) for v in _dict.get('ike_policies')] else: raise ValueError('Required property \'ike_policies\' not present in IKEPolicyCollection JSON') if 'limit' in _dict: @@ -30075,13 +31338,25 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'first') and self.first is not None: - _dict['first'] = self.first.to_dict() + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() if hasattr(self, 'ike_policies') and self.ike_policies is not None: - _dict['ike_policies'] = [x.to_dict() for x in self.ike_policies] + ike_policies_list = [] + for v in self.ike_policies: + if isinstance(v, dict): + ike_policies_list.append(v) + else: + ike_policies_list.append(v.to_dict()) + _dict['ike_policies'] = ike_policies_list if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit if hasattr(self, 'next') and self.next is not None: - _dict['next'] = self.next.to_dict() + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() if hasattr(self, 'total_count') and self.total_count is not None: _dict['total_count'] = self.total_count return _dict @@ -30229,7 +31504,8 @@ class IKEPolicyPatch(): 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. + :attr str name: (optional) The name for this IKE policy. The name must not be + used by another IKE policy in the region. """ def __init__(self, @@ -30252,7 +31528,8 @@ def __init__(self, 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. + :param str name: (optional) The name for this IKE policy. The name must not + be used by another IKE policy in the region. """ self.authentication_algorithm = authentication_algorithm self.dh_group = dh_group @@ -30351,7 +31628,8 @@ class IKEPolicyReference(): some supplementary information. :attr str href: The IKE policy's canonical URL. :attr str id: The unique identifier for this IKE policy. - :attr str name: The user-defined name for this IKE policy. + :attr str name: The name for this IKE policy. The name is unique across all IKE + policies in the region. :attr str resource_type: The resource type. """ @@ -30367,7 +31645,8 @@ def __init__(self, :param str href: The IKE policy's canonical URL. :param str id: The unique identifier for this IKE policy. - :param str name: The user-defined name for this IKE policy. + :param str name: The name for this IKE policy. The name is unique across + all IKE policies in the region. :param str resource_type: The resource type. :param IKEPolicyReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and provides @@ -30412,7 +31691,10 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -30591,7 +31873,8 @@ class IPsecPolicy(): :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 name: The name for this IPsec policy. The name is unique across all + IPsec policies in the region. :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 @@ -30636,7 +31919,8 @@ def __init__(self, :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 name: The name for this IPsec policy. The name is unique across + all IPsec policies in the region. :param str pfs: Perfect Forward Secrecy Groups `group_2` and `group_5` have been deprecated. :param ResourceGroupReference resource_group: The resource group for this @@ -30668,7 +31952,7 @@ def from_dict(cls, _dict: Dict) -> 'IPsecPolicy': else: raise ValueError('Required property \'authentication_algorithm\' not present in IPsecPolicy JSON') if 'connections' in _dict: - args['connections'] = [VPNGatewayConnectionReference.from_dict(x) for x in _dict.get('connections')] + args['connections'] = [VPNGatewayConnectionReference.from_dict(v) for v in _dict.get('connections')] else: raise ValueError('Required property \'connections\' not present in IPsecPolicy JSON') if 'created_at' in _dict: @@ -30728,7 +32012,13 @@ def to_dict(self) -> Dict: if hasattr(self, 'authentication_algorithm') and self.authentication_algorithm is not None: _dict['authentication_algorithm'] = self.authentication_algorithm if hasattr(self, 'connections') and self.connections is not None: - _dict['connections'] = [x.to_dict() for x in self.connections] + connections_list = [] + for v in self.connections: + if isinstance(v, dict): + connections_list.append(v) + else: + connections_list.append(v.to_dict()) + _dict['connections'] = connections_list if hasattr(self, 'created_at') and self.created_at is not None: _dict['created_at'] = datetime_to_string(self.created_at) if hasattr(self, 'encapsulation_mode') and self.encapsulation_mode is not None: @@ -30746,7 +32036,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'pfs') and self.pfs is not None: _dict['pfs'] = self.pfs if hasattr(self, 'resource_group') and self.resource_group is not None: - _dict['resource_group'] = self.resource_group.to_dict() + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() if hasattr(self, 'resource_type') and self.resource_type is not None: _dict['resource_type'] = self.resource_type if hasattr(self, 'transform_protocol') and self.transform_protocol is not None: @@ -30895,7 +32188,7 @@ def from_dict(cls, _dict: Dict) -> 'IPsecPolicyCollection': else: raise ValueError('Required property \'first\' not present in IPsecPolicyCollection JSON') if 'ipsec_policies' in _dict: - args['ipsec_policies'] = [IPsecPolicy.from_dict(x) for x in _dict.get('ipsec_policies')] + args['ipsec_policies'] = [IPsecPolicy.from_dict(v) for v in _dict.get('ipsec_policies')] else: raise ValueError('Required property \'ipsec_policies\' not present in IPsecPolicyCollection JSON') if 'limit' in _dict: @@ -30919,13 +32212,25 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'first') and self.first is not None: - _dict['first'] = self.first.to_dict() + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() if hasattr(self, 'ipsec_policies') and self.ipsec_policies is not None: - _dict['ipsec_policies'] = [x.to_dict() for x in self.ipsec_policies] + ipsec_policies_list = [] + for v in self.ipsec_policies: + if isinstance(v, dict): + ipsec_policies_list.append(v) + else: + ipsec_policies_list.append(v.to_dict()) + _dict['ipsec_policies'] = ipsec_policies_list if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit if hasattr(self, 'next') and self.next is not None: - _dict['next'] = self.next.to_dict() + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() if hasattr(self, 'total_count') and self.total_count is not None: _dict['total_count'] = self.total_count return _dict @@ -31075,7 +32380,8 @@ class IPsecPolicyPatch(): `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 name: (optional) The name for this IPsec policy. The name must not be + used by another IPsec policy in the region. :attr str pfs: (optional) Perfect Forward Secrecy Groups `group_2` and `group_5` have been deprecated. """ @@ -31101,7 +32407,8 @@ def __init__(self, `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 name: (optional) The name for this IPsec policy. The name must + not be used by another IPsec policy in the region. :param str pfs: (optional) Perfect Forward Secrecy Groups `group_2` and `group_5` have been deprecated. """ @@ -31228,7 +32535,8 @@ class IPsecPolicyReference(): some supplementary information. :attr str href: The IPsec policy's canonical URL. :attr str id: The unique identifier for this IPsec policy. - :attr str name: The user-defined name for this IPsec policy. + :attr str name: The name for this IPsec policy. The name is unique across all + IPsec policies in the region. :attr str resource_type: The resource type. """ @@ -31244,7 +32552,8 @@ def __init__(self, :param str href: The IPsec policy's canonical URL. :param str id: The unique identifier for this IPsec policy. - :param str name: The user-defined name for this IPsec policy. + :param str name: The name for this IPsec policy. The name is unique across + all IPsec policies in the region. :param str resource_type: The resource type. :param IPsecPolicyReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and provides @@ -31289,7 +32598,10 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -31402,7 +32714,8 @@ class Image(): of a volume onto which this image may be provisioned. 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 str name: The name for this image. The name is unique across all images in + the region. :attr OperatingSystem operating_system: (optional) The operating system included in this image. :attr ResourceGroupReference resource_group: The resource group for this image. @@ -31477,7 +32790,8 @@ def __init__(self, :param ImageFile file: Details for the stored image file. :param str href: The URL for this image. :param str id: The unique identifier for this image. - :param str name: The user-defined or system-provided name for this image. + :param str name: The name for this image. The name is unique across all + images in the region. :param ResourceGroupReference resource_group: The resource group for this image. :param str status: The status of this image @@ -31605,7 +32919,7 @@ def from_dict(cls, _dict: Dict) -> 'Image': else: raise ValueError('Required property \'status\' not present in Image JSON') if 'status_reasons' in _dict: - args['status_reasons'] = [ImageStatusReason.from_dict(x) for x in _dict.get('status_reasons')] + args['status_reasons'] = [ImageStatusReason.from_dict(v) for v in _dict.get('status_reasons')] else: raise ValueError('Required property \'status_reasons\' not present in Image JSON') if 'visibility' in _dict: @@ -31623,7 +32937,10 @@ 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 isinstance(self.catalog_offering, dict): + _dict['catalog_offering'] = self.catalog_offering + else: + _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: @@ -31631,9 +32948,15 @@ def to_dict(self) -> Dict: if hasattr(self, 'encryption') and self.encryption is not None: _dict['encryption'] = self.encryption if hasattr(self, 'encryption_key') and self.encryption_key is not None: - _dict['encryption_key'] = self.encryption_key.to_dict() + if isinstance(self.encryption_key, dict): + _dict['encryption_key'] = self.encryption_key + else: + _dict['encryption_key'] = self.encryption_key.to_dict() if hasattr(self, 'file') and self.file is not None: - _dict['file'] = self.file.to_dict() + if isinstance(self.file, dict): + _dict['file'] = self.file + else: + _dict['file'] = self.file.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: @@ -31643,15 +32966,30 @@ def to_dict(self) -> Dict: if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'operating_system') and self.operating_system is not None: - _dict['operating_system'] = self.operating_system.to_dict() + if isinstance(self.operating_system, dict): + _dict['operating_system'] = self.operating_system + else: + _dict['operating_system'] = self.operating_system.to_dict() if hasattr(self, 'resource_group') and self.resource_group is not None: - _dict['resource_group'] = self.resource_group.to_dict() + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() if hasattr(self, 'source_volume') and self.source_volume is not None: - _dict['source_volume'] = self.source_volume.to_dict() + if isinstance(self.source_volume, dict): + _dict['source_volume'] = self.source_volume + else: + _dict['source_volume'] = self.source_volume.to_dict() if hasattr(self, 'status') and self.status is not None: _dict['status'] = self.status if hasattr(self, 'status_reasons') and self.status_reasons is not None: - _dict['status_reasons'] = [x.to_dict() for x in self.status_reasons] + status_reasons_list = [] + for v in self.status_reasons: + if isinstance(v, dict): + status_reasons_list.append(v) + else: + status_reasons_list.append(v.to_dict()) + _dict['status_reasons'] = status_reasons_list if hasattr(self, 'visibility') and self.visibility is not None: _dict['visibility'] = self.visibility return _dict @@ -31773,7 +33111,10 @@ def to_dict(self) -> 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() + if isinstance(self.version, dict): + _dict['version'] = self.version + else: + _dict['version'] = self.version.to_dict() return _dict def _to_dict(self): @@ -31838,7 +33179,7 @@ def from_dict(cls, _dict: Dict) -> 'ImageCollection': else: raise ValueError('Required property \'first\' not present in ImageCollection JSON') if 'images' in _dict: - args['images'] = [Image.from_dict(x) for x in _dict.get('images')] + args['images'] = [Image.from_dict(v) for v in _dict.get('images')] else: raise ValueError('Required property \'images\' not present in ImageCollection JSON') if 'limit' in _dict: @@ -31858,13 +33199,25 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'first') and self.first is not None: - _dict['first'] = self.first.to_dict() + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() if hasattr(self, 'images') and self.images is not None: - _dict['images'] = [x.to_dict() for x in self.images] + images_list = [] + for v in self.images: + if isinstance(v, dict): + images_list.append(v) + else: + images_list.append(v.to_dict()) + _dict['images'] = images_list if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit if hasattr(self, 'next') and self.next is not None: - _dict['next'] = self.next.to_dict() + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() return _dict def _to_dict(self): @@ -32053,7 +33406,10 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'checksums') and self.checksums is not None: - _dict['checksums'] = self.checksums.to_dict() + if isinstance(self.checksums, dict): + _dict['checksums'] = self.checksums + else: + _dict['checksums'] = self.checksums.to_dict() if hasattr(self, 'size') and self.size is not None: _dict['size'] = self.size return _dict @@ -32211,8 +33567,9 @@ class ImagePatch(): """ ImagePatch. - :attr str name: (optional) The unique user-defined name for this image. Names - starting with `ibm-` are not allowed. + :attr str name: (optional) The name for this image. The name must not be used by + another image in the region. Names starting with `ibm-` are reserved for + system-provided images, and are not allowed. """ def __init__(self, @@ -32221,8 +33578,9 @@ def __init__(self, """ Initialize a ImagePatch object. - :param str name: (optional) The unique user-defined name for this image. - Names starting with `ibm-` are not allowed. + :param str name: (optional) The name for this image. The name must not be + used by another image in the region. Names starting with `ibm-` are + reserved for system-provided images, and are not allowed. """ self.name = name @@ -32268,8 +33626,9 @@ class ImagePrototype(): """ ImagePrototype. - :attr str name: (optional) The unique user-defined name for this image. Names - starting with `ibm-` are not allowed. If unspecified, the name will be a + :attr str name: (optional) The name for this image. The name must not be used by + another image in the region. Names starting with `ibm-` are reserved for + system-provided images, and are not allowed. If unspecified, the name will be a hyphenated list of randomly-selected words. :attr ResourceGroupIdentity resource_group: (optional) The resource group to use. If unspecified, the account's [default resource @@ -32283,9 +33642,10 @@ def __init__(self, """ Initialize a ImagePrototype object. - :param str name: (optional) The unique user-defined name for this image. - Names starting with `ibm-` are not allowed. If unspecified, the name will - be a hyphenated list of randomly-selected words. + :param str name: (optional) The name for this image. The name must not be + used by another image in the region. Names starting with `ibm-` are + reserved for system-provided images, and are not allowed. If unspecified, + the name will be a hyphenated list of randomly-selected words. :param ResourceGroupIdentity resource_group: (optional) The resource group to use. If unspecified, the account's [default resource group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is @@ -32305,7 +33665,8 @@ class ImageReference(): some supplementary information. :attr str href: The URL for this image. :attr str id: The unique identifier for this image. - :attr str name: The user-defined or system-provided name for this image. + :attr str name: The name for this image. The name is unique across all images in + the region. """ def __init__(self, @@ -32321,7 +33682,8 @@ def __init__(self, :param str crn: The CRN for this image. :param str href: The URL for this image. :param str id: The unique identifier for this image. - :param str name: The user-defined or system-provided name for this image. + :param str name: The name for this image. The name is unique across all + images in the region. :param ImageReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and provides some supplementary information. @@ -32367,7 +33729,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'crn') and self.crn is not None: _dict['crn'] = self.crn if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -32576,8 +33941,8 @@ class Instance(): :attr int memory: The amount of memory, truncated to whole gibibytes. :attr InstanceMetadataService metadata_service: The metadata service configuration. - :attr str name: The user-defined name for this virtual server instance (and - default system hostname). + :attr str name: The name for this virtual server instance. The name is unique + across all virtual server instances in the region. :attr List[NetworkInterfaceInstanceContextReference] network_interfaces: The network interfaces for this virtual server instance, including the primary network interface. @@ -32680,8 +34045,8 @@ def __init__(self, :param int memory: The amount of memory, truncated to whole gibibytes. :param InstanceMetadataService metadata_service: The metadata service configuration. - :param str name: The user-defined name for this virtual server instance - (and default system hostname). + :param str name: The name for this virtual server instance. The name is + unique across all virtual server instances in the region. :param List[NetworkInterfaceInstanceContextReference] network_interfaces: The network interfaces for this virtual server instance, including the primary network interface. @@ -32794,7 +34159,7 @@ def from_dict(cls, _dict: Dict) -> 'Instance': if 'dedicated_host' in _dict: args['dedicated_host'] = DedicatedHostReference.from_dict(_dict.get('dedicated_host')) if 'disks' in _dict: - args['disks'] = [InstanceDisk.from_dict(x) for x in _dict.get('disks')] + args['disks'] = [InstanceDisk.from_dict(v) for v in _dict.get('disks')] else: raise ValueError('Required property \'disks\' not present in Instance JSON') if 'gpu' in _dict: @@ -32810,7 +34175,7 @@ def from_dict(cls, _dict: Dict) -> 'Instance': 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')] + args['lifecycle_reasons'] = [LifecycleReason.from_dict(v) for v in _dict.get('lifecycle_reasons')] else: raise ValueError('Required property \'lifecycle_reasons\' not present in Instance JSON') if 'lifecycle_state' in _dict: @@ -32830,7 +34195,7 @@ def from_dict(cls, _dict: Dict) -> 'Instance': else: raise ValueError('Required property \'name\' not present in Instance JSON') if 'network_interfaces' in _dict: - args['network_interfaces'] = [NetworkInterfaceInstanceContextReference.from_dict(x) for x in _dict.get('network_interfaces')] + args['network_interfaces'] = [NetworkInterfaceInstanceContextReference.from_dict(v) for v in _dict.get('network_interfaces')] else: raise ValueError('Required property \'network_interfaces\' not present in Instance JSON') if 'placement_target' in _dict: @@ -32860,7 +34225,7 @@ def from_dict(cls, _dict: Dict) -> 'Instance': else: raise ValueError('Required property \'status\' not present in Instance JSON') if 'status_reasons' in _dict: - args['status_reasons'] = [InstanceStatusReason.from_dict(x) for x in _dict.get('status_reasons')] + args['status_reasons'] = [InstanceStatusReason.from_dict(v) for v in _dict.get('status_reasons')] else: raise ValueError('Required property \'status_reasons\' not present in Instance JSON') if 'total_network_bandwidth' in _dict: @@ -32876,7 +34241,7 @@ def from_dict(cls, _dict: Dict) -> 'Instance': else: raise ValueError('Required property \'vcpu\' not present in Instance JSON') if 'volume_attachments' in _dict: - args['volume_attachments'] = [VolumeAttachmentReferenceInstanceContext.from_dict(x) for x in _dict.get('volume_attachments')] + args['volume_attachments'] = [VolumeAttachmentReferenceInstanceContext.from_dict(v) for v in _dict.get('volume_attachments')] else: raise ValueError('Required property \'volume_attachments\' not present in Instance JSON') if 'vpc' in _dict: @@ -32898,52 +34263,100 @@ 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 isinstance(self.availability_policy, dict): + _dict['availability_policy'] = self.availability_policy + else: + _dict['availability_policy'] = self.availability_policy.to_dict() if hasattr(self, 'bandwidth') and self.bandwidth is not None: _dict['bandwidth'] = self.bandwidth if hasattr(self, 'boot_volume_attachment') and self.boot_volume_attachment is not None: - _dict['boot_volume_attachment'] = self.boot_volume_attachment.to_dict() + if isinstance(self.boot_volume_attachment, dict): + _dict['boot_volume_attachment'] = self.boot_volume_attachment + else: + _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 isinstance(self.catalog_offering, dict): + _dict['catalog_offering'] = self.catalog_offering + else: + _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: _dict['crn'] = self.crn if hasattr(self, 'dedicated_host') and self.dedicated_host is not None: - _dict['dedicated_host'] = self.dedicated_host.to_dict() + if isinstance(self.dedicated_host, dict): + _dict['dedicated_host'] = self.dedicated_host + else: + _dict['dedicated_host'] = self.dedicated_host.to_dict() if hasattr(self, 'disks') and self.disks is not None: - _dict['disks'] = [x.to_dict() for x in self.disks] + disks_list = [] + for v in self.disks: + if isinstance(v, dict): + disks_list.append(v) + else: + disks_list.append(v.to_dict()) + _dict['disks'] = disks_list if hasattr(self, 'gpu') and self.gpu is not None: - _dict['gpu'] = self.gpu.to_dict() + if isinstance(self.gpu, dict): + _dict['gpu'] = self.gpu + else: + _dict['gpu'] = self.gpu.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, 'image') and self.image is not None: - _dict['image'] = self.image.to_dict() + if isinstance(self.image, dict): + _dict['image'] = self.image + else: + _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] + lifecycle_reasons_list = [] + for v in self.lifecycle_reasons: + if isinstance(v, dict): + lifecycle_reasons_list.append(v) + else: + lifecycle_reasons_list.append(v.to_dict()) + _dict['lifecycle_reasons'] = lifecycle_reasons_list if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None: _dict['lifecycle_state'] = self.lifecycle_state if hasattr(self, 'memory') and self.memory is not None: _dict['memory'] = self.memory if hasattr(self, 'metadata_service') and self.metadata_service is not None: - _dict['metadata_service'] = self.metadata_service.to_dict() + if isinstance(self.metadata_service, dict): + _dict['metadata_service'] = self.metadata_service + else: + _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] + network_interfaces_list = [] + for v in self.network_interfaces: + if isinstance(v, dict): + network_interfaces_list.append(v) + else: + network_interfaces_list.append(v.to_dict()) + _dict['network_interfaces'] = network_interfaces_list if hasattr(self, '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, 'primary_network_interface') and self.primary_network_interface is not None: - _dict['primary_network_interface'] = self.primary_network_interface.to_dict() + if isinstance(self.primary_network_interface, dict): + _dict['primary_network_interface'] = self.primary_network_interface + else: + _dict['primary_network_interface'] = self.primary_network_interface.to_dict() if hasattr(self, 'profile') and self.profile is not None: - _dict['profile'] = self.profile.to_dict() + 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 isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() if hasattr(self, 'resource_type') and self.resource_type is not None: _dict['resource_type'] = self.resource_type if hasattr(self, 'startable') and self.startable is not None: @@ -32951,19 +34364,40 @@ def to_dict(self) -> Dict: if hasattr(self, 'status') and self.status is not None: _dict['status'] = self.status if hasattr(self, 'status_reasons') and self.status_reasons is not None: - _dict['status_reasons'] = [x.to_dict() for x in self.status_reasons] + status_reasons_list = [] + for v in self.status_reasons: + if isinstance(v, dict): + status_reasons_list.append(v) + else: + status_reasons_list.append(v.to_dict()) + _dict['status_reasons'] = status_reasons_list if hasattr(self, 'total_network_bandwidth') and self.total_network_bandwidth is not None: _dict['total_network_bandwidth'] = self.total_network_bandwidth 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, 'vcpu') and self.vcpu is not None: - _dict['vcpu'] = self.vcpu.to_dict() + if isinstance(self.vcpu, dict): + _dict['vcpu'] = self.vcpu + else: + _dict['vcpu'] = self.vcpu.to_dict() if hasattr(self, 'volume_attachments') and self.volume_attachments is not None: - _dict['volume_attachments'] = [x.to_dict() for x in self.volume_attachments] + volume_attachments_list = [] + for v in self.volume_attachments: + if isinstance(v, dict): + volume_attachments_list.append(v) + else: + volume_attachments_list.append(v.to_dict()) + _dict['volume_attachments'] = volume_attachments_list if hasattr(self, 'vpc') and self.vpc is not None: - _dict['vpc'] = self.vpc.to_dict() + if isinstance(self.vpc, dict): + _dict['vpc'] = self.vpc + else: + _dict['vpc'] = self.vpc.to_dict() if hasattr(self, 'zone') and self.zone is not None: - _dict['zone'] = self.zone.to_dict() + if isinstance(self.zone, dict): + _dict['zone'] = self.zone + else: + _dict['zone'] = self.zone.to_dict() return _dict def _to_dict(self): @@ -33026,16 +34460,16 @@ class InstanceAction(): """ InstanceAction. - :attr datetime completed_at: (optional) The date and time that the action was - completed. + :attr datetime completed_at: (optional) Deprecated: The date and time that the + action was completed. :attr datetime created_at: The date and time that the action was created. :attr bool force: (optional) If set to true, the action will be forced immediately, and all queued actions deleted. Ignored for the start action. - :attr str href: The URL for this instance action. - :attr str id: The identifier for this instance action. - :attr datetime started_at: (optional) The date and time that the action was - started. - :attr str status: The current status of this action. + :attr str href: Deprecated: The URL for this instance action. + :attr str id: Deprecated: The identifier for this instance action. + :attr datetime started_at: (optional) Deprecated: The date and time that the + action was started. + :attr str status: Deprecated: The current status of this action. :attr str type: The type of action. """ @@ -33053,16 +34487,16 @@ def __init__(self, Initialize a InstanceAction object. :param datetime created_at: The date and time that the action was created. - :param str href: The URL for this instance action. - :param str id: The identifier for this instance action. - :param str status: The current status of this action. + :param str href: Deprecated: The URL for this instance action. + :param str id: Deprecated: The identifier for this instance action. + :param str status: Deprecated: The current status of this action. :param str type: The type of action. - :param datetime completed_at: (optional) The date and time that the action - was completed. + :param datetime completed_at: (optional) Deprecated: The date and time that + the action was completed. :param bool force: (optional) If set to true, the action will be forced immediately, and all queued actions deleted. Ignored for the start action. - :param datetime started_at: (optional) The date and time that the action - was started. + :param datetime started_at: (optional) Deprecated: The date and time that + the action was started. """ self.completed_at = completed_at self.created_at = created_at @@ -33475,7 +34909,10 @@ 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() + if isinstance(self.version, dict): + _dict['version'] = self.version + else: + _dict['version'] = self.version.to_dict() return _dict def _to_dict(self): @@ -33565,7 +35002,7 @@ def from_dict(cls, _dict: Dict) -> 'InstanceCollection': else: raise ValueError('Required property \'first\' not present in InstanceCollection JSON') if 'instances' in _dict: - args['instances'] = [Instance.from_dict(x) for x in _dict.get('instances')] + args['instances'] = [Instance.from_dict(v) for v in _dict.get('instances')] else: raise ValueError('Required property \'instances\' not present in InstanceCollection JSON') if 'limit' in _dict: @@ -33589,13 +35026,25 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'first') and self.first is not None: - _dict['first'] = self.first.to_dict() + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() if hasattr(self, 'instances') and self.instances is not None: - _dict['instances'] = [x.to_dict() for x in self.instances] + instances_list = [] + for v in self.instances: + if isinstance(v, dict): + instances_list.append(v) + else: + instances_list.append(v.to_dict()) + _dict['instances'] = instances_list if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit if hasattr(self, 'next') and self.next is not None: - _dict['next'] = self.next.to_dict() + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() if hasattr(self, 'total_count') and self.total_count is not None: _dict['total_count'] = self.total_count return _dict @@ -33944,7 +35393,8 @@ class InstanceDisk(): 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 name: The user-defined name for this disk. + :attr str name: The name for this instance disk. The name is unique across all + disks on the instance. :attr str resource_type: The resource type. :attr int size: The size of the disk in GB (gigabytes). """ @@ -33968,7 +35418,8 @@ def __init__(self, future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected property value was encountered. - :param str name: The user-defined name for this disk. + :param str name: The name for this instance disk. The name is unique across + all disks on the instance. :param str resource_type: The resource type. :param int size: The size of the disk in GB (gigabytes). """ @@ -34096,7 +35547,7 @@ def from_dict(cls, _dict: Dict) -> 'InstanceDiskCollection': """Initialize a InstanceDiskCollection object from a json dictionary.""" args = {} if 'disks' in _dict: - args['disks'] = [InstanceDisk.from_dict(x) for x in _dict.get('disks')] + args['disks'] = [InstanceDisk.from_dict(v) for v in _dict.get('disks')] else: raise ValueError('Required property \'disks\' not present in InstanceDiskCollection JSON') return cls(**args) @@ -34110,7 +35561,13 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'disks') and self.disks is not None: - _dict['disks'] = [x.to_dict() for x in self.disks] + disks_list = [] + for v in self.disks: + if isinstance(v, dict): + disks_list.append(v) + else: + disks_list.append(v.to_dict()) + _dict['disks'] = disks_list return _dict def _to_dict(self): @@ -34135,7 +35592,8 @@ class InstanceDiskPatch(): """ InstanceDiskPatch. - :attr str name: (optional) The user-defined name for this disk. + :attr str name: (optional) The name for this instance disk. The name must not be + used by another disk on the instance. """ def __init__(self, @@ -34144,7 +35602,8 @@ def __init__(self, """ Initialize a InstanceDiskPatch object. - :param str name: (optional) The user-defined name for this disk. + :param str name: (optional) The name for this instance disk. The name must + not be used by another disk on the instance. """ self.name = name @@ -34195,7 +35654,8 @@ class InstanceDiskReference(): some supplementary information. :attr str href: The URL for this instance disk. :attr str id: The unique identifier for this instance disk. - :attr str name: The user-defined name for this disk. + :attr str name: The name for this instance disk. The name is unique across all + disks on the instance. :attr str resource_type: The resource type. """ @@ -34211,7 +35671,8 @@ def __init__(self, :param str href: The URL for this instance disk. :param str id: The unique identifier for this instance disk. - :param str name: The user-defined name for this disk. + :param str name: The name for this instance disk. The name is unique across + all disks on the instance. :param str resource_type: The resource type. :param InstanceDiskReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and provides @@ -34256,7 +35717,10 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -34455,7 +35919,8 @@ class InstanceGroup(): :attr List[InstanceGroupManagerReference] managers: The managers for the instance group. :attr int membership_count: The number of instances in the instance group. - :attr str name: The user-defined name for this instance group. + :attr str name: The name for this instance group. The name is unique across all + instance groups in the region. :attr ResourceGroupReference resource_group: :attr str status: The status of the instance group - `deleting`: Group is being deleted @@ -34500,7 +35965,8 @@ def __init__(self, :param List[InstanceGroupManagerReference] managers: The managers for the instance group. :param int membership_count: The number of instances in the instance group. - :param str name: The user-defined name for this instance group. + :param str name: The name for this instance group. The name is unique + across all instance groups in the region. :param ResourceGroupReference resource_group: :param str status: The status of the instance group - `deleting`: Group is being deleted @@ -34566,7 +36032,7 @@ def from_dict(cls, _dict: Dict) -> 'InstanceGroup': if 'load_balancer_pool' in _dict: args['load_balancer_pool'] = LoadBalancerPoolReference.from_dict(_dict.get('load_balancer_pool')) if 'managers' in _dict: - args['managers'] = [InstanceGroupManagerReference.from_dict(x) for x in _dict.get('managers')] + args['managers'] = [InstanceGroupManagerReference.from_dict(v) for v in _dict.get('managers')] else: raise ValueError('Required property \'managers\' not present in InstanceGroup JSON') if 'membership_count' in _dict: @@ -34586,7 +36052,7 @@ def from_dict(cls, _dict: Dict) -> 'InstanceGroup': else: raise ValueError('Required property \'status\' not present in InstanceGroup JSON') if 'subnets' in _dict: - args['subnets'] = [SubnetReference.from_dict(x) for x in _dict.get('subnets')] + args['subnets'] = [SubnetReference.from_dict(v) for v in _dict.get('subnets')] else: raise ValueError('Required property \'subnets\' not present in InstanceGroup JSON') if 'updated_at' in _dict: @@ -34618,25 +36084,49 @@ def to_dict(self) -> Dict: if hasattr(self, 'id') and self.id is not None: _dict['id'] = self.id if hasattr(self, 'instance_template') and self.instance_template is not None: - _dict['instance_template'] = self.instance_template.to_dict() + if isinstance(self.instance_template, dict): + _dict['instance_template'] = self.instance_template + else: + _dict['instance_template'] = self.instance_template.to_dict() if hasattr(self, 'load_balancer_pool') and self.load_balancer_pool is not None: - _dict['load_balancer_pool'] = self.load_balancer_pool.to_dict() + if isinstance(self.load_balancer_pool, dict): + _dict['load_balancer_pool'] = self.load_balancer_pool + else: + _dict['load_balancer_pool'] = self.load_balancer_pool.to_dict() if hasattr(self, 'managers') and self.managers is not None: - _dict['managers'] = [x.to_dict() for x in self.managers] + managers_list = [] + for v in self.managers: + if isinstance(v, dict): + managers_list.append(v) + else: + managers_list.append(v.to_dict()) + _dict['managers'] = managers_list if hasattr(self, 'membership_count') and self.membership_count is not None: _dict['membership_count'] = self.membership_count if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'resource_group') and self.resource_group is not None: - _dict['resource_group'] = self.resource_group.to_dict() + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() if hasattr(self, 'status') and self.status is not None: _dict['status'] = self.status if hasattr(self, 'subnets') and self.subnets is not None: - _dict['subnets'] = [x.to_dict() for x in self.subnets] + subnets_list = [] + for v in self.subnets: + if isinstance(v, dict): + subnets_list.append(v) + else: + subnets_list.append(v.to_dict()) + _dict['subnets'] = subnets_list if hasattr(self, 'updated_at') and self.updated_at is not None: _dict['updated_at'] = datetime_to_string(self.updated_at) if hasattr(self, 'vpc') and self.vpc is not None: - _dict['vpc'] = self.vpc.to_dict() + if isinstance(self.vpc, dict): + _dict['vpc'] = self.vpc + else: + _dict['vpc'] = self.vpc.to_dict() return _dict def _to_dict(self): @@ -34721,7 +36211,7 @@ def from_dict(cls, _dict: Dict) -> 'InstanceGroupCollection': else: raise ValueError('Required property \'first\' not present in InstanceGroupCollection JSON') if 'instance_groups' in _dict: - args['instance_groups'] = [InstanceGroup.from_dict(x) for x in _dict.get('instance_groups')] + args['instance_groups'] = [InstanceGroup.from_dict(v) for v in _dict.get('instance_groups')] else: raise ValueError('Required property \'instance_groups\' not present in InstanceGroupCollection JSON') if 'limit' in _dict: @@ -34745,13 +36235,25 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'first') and self.first is not None: - _dict['first'] = self.first.to_dict() + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() if hasattr(self, 'instance_groups') and self.instance_groups is not None: - _dict['instance_groups'] = [x.to_dict() for x in self.instance_groups] + instance_groups_list = [] + for v in self.instance_groups: + if isinstance(v, dict): + instance_groups_list.append(v) + else: + instance_groups_list.append(v.to_dict()) + _dict['instance_groups'] = instance_groups_list if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit if hasattr(self, 'next') and self.next is not None: - _dict['next'] = self.next.to_dict() + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() if hasattr(self, 'total_count') and self.total_count is not None: _dict['total_count'] = self.total_count return _dict @@ -34897,7 +36399,8 @@ class InstanceGroupManager(): :attr str id: The unique identifier for this instance group manager. :attr bool management_enabled: Indicates whether this manager will control the instance group. - :attr str name: The user-defined name for this instance group manager. + :attr str name: The name for this instance group manager. The name is unique + across all managers for the instance group. :attr datetime updated_at: The date and time that the instance group manager was updated. """ @@ -34918,7 +36421,8 @@ def __init__(self, :param str id: The unique identifier for this instance group manager. :param bool management_enabled: Indicates whether this manager will control the instance group. - :param str name: The user-defined name for this instance group manager. + :param str name: The name for this instance group manager. The name is + unique across all managers for the instance group. :param datetime updated_at: The date and time that the instance group manager was updated. """ @@ -34942,7 +36446,8 @@ class InstanceGroupManagerAction(): action was created. :attr str href: The URL for this instance group manager action. :attr str id: The unique identifier for this instance group manager action. - :attr str name: The user-defined name for this instance group manager action. + :attr str name: The name for this instance group manager action. The name is + unique across all actions for the instance group manager. :attr str resource_type: The resource type. :attr str status: The status of the instance group action - `active`: Action is ready to be run @@ -34980,8 +36485,8 @@ def __init__(self, :param str href: The URL for this instance group manager action. :param str id: The unique identifier for this instance group manager action. - :param str name: The user-defined name for this instance group manager - action. + :param str name: The name for this instance group manager action. The name + is unique across all actions for the instance group manager. :param str resource_type: The resource type. :param str status: The status of the instance group action - `active`: Action is ready to be run @@ -35153,8 +36658,8 @@ class InstanceGroupManagerActionPatch(): action. Actions can be applied a maximum of one time within a 5 min period. :attr InstanceGroupManagerActionGroupPatch group: (optional) :attr InstanceGroupManagerActionManagerPatch manager: (optional) - :attr str name: (optional) The user-defined name for this instance group manager - action. + :attr str name: (optional) The name for this instance group manager action. The + name must not be used by another action for the instance group manager. :attr datetime run_at: (optional) The date and time the scheduled action will run. """ @@ -35174,8 +36679,9 @@ def __init__(self, min period. :param InstanceGroupManagerActionGroupPatch group: (optional) :param InstanceGroupManagerActionManagerPatch manager: (optional) - :param str name: (optional) The user-defined name for this instance group - manager action. + :param str name: (optional) The name for this instance group manager + action. The name must not be used by another action for the instance group + manager. :param datetime run_at: (optional) The date and time the scheduled action will run. """ @@ -35212,9 +36718,15 @@ def to_dict(self) -> Dict: if hasattr(self, 'cron_spec') and self.cron_spec is not None: _dict['cron_spec'] = self.cron_spec if hasattr(self, 'group') and self.group is not None: - _dict['group'] = self.group.to_dict() + if isinstance(self.group, dict): + _dict['group'] = self.group + else: + _dict['group'] = self.group.to_dict() if hasattr(self, 'manager') and self.manager is not None: - _dict['manager'] = self.manager.to_dict() + if isinstance(self.manager, dict): + _dict['manager'] = self.manager + else: + _dict['manager'] = self.manager.to_dict() if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'run_at') and self.run_at is not None: @@ -35243,9 +36755,9 @@ class InstanceGroupManagerActionPrototype(): """ InstanceGroupManagerActionPrototype. - :attr str name: (optional) The user-defined name for this instance group manager - action. Names must be unique within the instance group manager. If unspecified, - the name will be a hyphenated list of randomly-selected words. + :attr str name: (optional) The name for this instance group manager action. The + name must not be used by another action for the instance group manager. If + unspecified, the name will be a hyphenated list of randomly-selected words. """ def __init__(self, @@ -35254,9 +36766,10 @@ def __init__(self, """ Initialize a InstanceGroupManagerActionPrototype object. - :param str name: (optional) The user-defined name for this instance group - manager action. Names must be unique within the instance group manager. If - unspecified, the name will be a hyphenated list of randomly-selected words. + :param str name: (optional) The name for this instance group manager + action. The name must not be used by another action for the instance group + manager. 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(['InstanceGroupManagerActionPrototypeScheduledActionPrototype'])) @@ -35271,7 +36784,8 @@ class InstanceGroupManagerActionReference(): 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. - :attr str name: The user-defined name for this instance group manager action. + :attr str name: The name for this instance group manager action. The name is + unique across all actions for the instance group manager. :attr str resource_type: The resource type. """ @@ -35288,8 +36802,8 @@ def __init__(self, :param str href: The URL for this instance group manager action. :param str id: The unique identifier for this instance group manager action. - :param str name: The user-defined name for this instance group manager - action. + :param str name: The name for this instance group manager action. The name + is unique across all actions for the instance group manager. :param str resource_type: The resource type. :param InstanceGroupManagerActionReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, @@ -35335,7 +36849,10 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -35505,18 +37022,24 @@ def to_dict(self) -> Dict: _dict = {} if hasattr(self, 'actions') and self.actions is not None: actions_list = [] - for x in self.actions: - if isinstance(x, dict): - actions_list.append(x) + for v in self.actions: + if isinstance(v, dict): + actions_list.append(v) else: - actions_list.append(x.to_dict()) + actions_list.append(v.to_dict()) _dict['actions'] = actions_list if hasattr(self, 'first') and self.first is not None: - _dict['first'] = self.first.to_dict() + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit if hasattr(self, 'next') and self.next is not None: - _dict['next'] = self.next.to_dict() + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() if hasattr(self, 'total_count') and self.total_count is not None: _dict['total_count'] = self.total_count return _dict @@ -35728,19 +37251,25 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'first') and self.first is not None: - _dict['first'] = self.first.to_dict() + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit if hasattr(self, 'managers') and self.managers is not None: managers_list = [] - for x in self.managers: - if isinstance(x, dict): - managers_list.append(x) + for v in self.managers: + if isinstance(v, dict): + managers_list.append(v) else: - managers_list.append(x.to_dict()) + managers_list.append(v.to_dict()) _dict['managers'] = managers_list if hasattr(self, 'next') and self.next is not None: - _dict['next'] = self.next.to_dict() + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() if hasattr(self, 'total_count') and self.total_count is not None: _dict['total_count'] = self.total_count return _dict @@ -35890,8 +37419,8 @@ class InstanceGroupManagerPatch(): managed instance group. :attr int min_membership_count: (optional) The minimum number of members in a managed instance group. - :attr str name: (optional) The user-defined name for this instance group - manager. + :attr str name: (optional) The name for this instance group manager. The name + must not be used by another manager for the instance group. """ def __init__(self, @@ -35915,8 +37444,8 @@ def __init__(self, in a managed instance group. :param int min_membership_count: (optional) The minimum number of members in a managed instance group. - :param str name: (optional) The user-defined name for this instance group - manager. + :param str name: (optional) The name for this instance group manager. The + name must not be used by another manager for the instance group. """ self.aggregation_window = aggregation_window self.cooldown = cooldown @@ -35991,7 +37520,8 @@ class InstanceGroupManagerPolicy(): policy was created. :attr str href: The URL for this instance group manager policy. :attr str id: The unique identifier for this instance group manager policy. - :attr str name: The user-defined name for this instance group manager policy. + :attr str name: The name for this instance group manager policy. The name is + unique across all policies for the instance group manager. :attr datetime updated_at: The date and time that the instance group manager policy was updated. """ @@ -36010,8 +37540,8 @@ def __init__(self, :param str href: The URL for this instance group manager policy. :param str id: The unique identifier for this instance group manager policy. - :param str name: The user-defined name for this instance group manager - policy. + :param str name: The name for this instance group manager policy. The name + is unique across all policies for the instance group manager. :param datetime updated_at: The date and time that the instance group manager policy was updated. """ @@ -36095,18 +37625,24 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'first') and self.first is not None: - _dict['first'] = self.first.to_dict() + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit if hasattr(self, 'next') and self.next is not None: - _dict['next'] = self.next.to_dict() + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() if hasattr(self, 'policies') and self.policies is not None: policies_list = [] - for x in self.policies: - if isinstance(x, dict): - policies_list.append(x) + for v in self.policies: + if isinstance(v, dict): + policies_list.append(v) else: - policies_list.append(x.to_dict()) + policies_list.append(v.to_dict()) _dict['policies'] = policies_list if hasattr(self, 'total_count') and self.total_count is not None: _dict['total_count'] = self.total_count @@ -36249,8 +37785,8 @@ class InstanceGroupManagerPolicyPatch(): :attr str metric_type: (optional) The type of metric to be evaluated. :attr int metric_value: (optional) The metric value to be evaluated. - :attr str name: (optional) The user-defined name for this instance group manager - policy. + :attr str name: (optional) The name for this instance group manager policy. The + name must not be used by another policy for the instance group manager. """ def __init__(self, @@ -36263,8 +37799,9 @@ def __init__(self, :param str metric_type: (optional) The type of metric to be evaluated. :param int metric_value: (optional) The metric value to be evaluated. - :param str name: (optional) The user-defined name for this instance group - manager policy. + :param str name: (optional) The name for this instance group manager + policy. The name must not be used by another policy for the instance group + manager. """ self.metric_type = metric_type self.metric_value = metric_value @@ -36330,9 +37867,9 @@ class InstanceGroupManagerPolicyPrototype(): """ InstanceGroupManagerPolicyPrototype. - :attr str name: (optional) The user-defined name for this instance group manager - policy. Names must be unique within the instance group manager. If unspecified, - the name will be a hyphenated list of randomly-selected words. + :attr str name: (optional) The name for this instance group manager policy. The + name must not be used by another policy for the instance group manager. If + unspecified, the name will be a hyphenated list of randomly-selected words. """ def __init__(self, @@ -36341,9 +37878,10 @@ def __init__(self, """ Initialize a InstanceGroupManagerPolicyPrototype object. - :param str name: (optional) The user-defined name for this instance group - manager policy. Names must be unique within the instance group manager. If - unspecified, the name will be a hyphenated list of randomly-selected words. + :param str name: (optional) The name for this instance group manager + policy. The name must not be used by another policy for the instance group + manager. 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(['InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype'])) @@ -36358,7 +37896,8 @@ class InstanceGroupManagerPolicyReference(): 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. - :attr str name: The user-defined name for this instance group manager policy. + :attr str name: The name for this instance group manager policy. The name is + unique across all policies for the instance group manager. """ def __init__(self, @@ -36373,8 +37912,8 @@ def __init__(self, :param str href: The URL for this instance group manager policy. :param str id: The unique identifier for this instance group manager policy. - :param str name: The user-defined name for this instance group manager - policy. + :param str name: The name for this instance group manager policy. The name + is unique across all policies for the instance group manager. :param InstanceGroupManagerPolicyReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and provides @@ -36414,7 +37953,10 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -36504,8 +38046,8 @@ class InstanceGroupManagerPrototype(): :attr bool management_enabled: (optional) Indicates whether this manager will control the instance group. - :attr str name: (optional) The user-defined name for this instance group - manager. Names must be unique within the instance group. If unspecified, the + :attr str name: (optional) The name for this instance group manager. The name + must not be used by another manager for the instance group. If unspecified, the name will be a hyphenated list of randomly-selected words. """ @@ -36518,9 +38060,9 @@ def __init__(self, :param bool management_enabled: (optional) Indicates whether this manager will control the instance group. - :param str name: (optional) The user-defined name for this instance group - manager. Names must be unique within the instance group. If unspecified, - the name will be a hyphenated list of randomly-selected words. + :param str name: (optional) The name for this instance group manager. The + name must not be used by another manager for the instance group. 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(['InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype', 'InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype'])) @@ -36535,7 +38077,8 @@ class InstanceGroupManagerReference(): some supplementary information. :attr str href: The URL for this instance group manager. :attr str id: The unique identifier for this instance group manager. - :attr str name: The user-defined name for this instance group manager. + :attr str name: The name for this instance group manager. The name is unique + across all managers for the instance group. """ def __init__(self, @@ -36549,7 +38092,8 @@ def __init__(self, :param str href: The URL for this instance group manager. :param str id: The unique identifier for this instance group manager. - :param str name: The user-defined name for this instance group manager. + :param str name: The name for this instance group manager. The name is + unique across all managers for the instance group. :param InstanceGroupManagerReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and provides @@ -36589,7 +38133,10 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -36831,8 +38378,8 @@ class InstanceGroupMembership(): :attr str id: The unique identifier for this instance group membership. :attr InstanceReference instance: :attr InstanceTemplateReference instance_template: - :attr str name: The user-defined name for this instance group membership. Names - must be unique within the instance group. + :attr str name: The name for this instance group membership. The name is unique + across all memberships for the instance group. :attr LoadBalancerPoolMemberReference pool_member: (optional) :attr str status: The status of the instance group membership - `deleting`: Membership is deleting dependent resources @@ -36867,8 +38414,8 @@ def __init__(self, :param str id: The unique identifier for this instance group membership. :param InstanceReference instance: :param InstanceTemplateReference instance_template: - :param str name: The user-defined name for this instance group membership. - Names must be unique within the instance group. + :param str name: The name for this instance group membership. The name is + unique across all memberships for the instance group. :param str status: The status of the instance group membership - `deleting`: Membership is deleting dependent resources - `failed`: Membership was unable to maintain dependent resources @@ -36951,13 +38498,22 @@ def to_dict(self) -> Dict: if hasattr(self, 'id') and self.id is not None: _dict['id'] = self.id if hasattr(self, 'instance') and self.instance is not None: - _dict['instance'] = self.instance.to_dict() + if isinstance(self.instance, dict): + _dict['instance'] = self.instance + else: + _dict['instance'] = self.instance.to_dict() if hasattr(self, 'instance_template') and self.instance_template is not None: - _dict['instance_template'] = self.instance_template.to_dict() + if isinstance(self.instance_template, dict): + _dict['instance_template'] = self.instance_template + else: + _dict['instance_template'] = self.instance_template.to_dict() if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'pool_member') and self.pool_member is not None: - _dict['pool_member'] = self.pool_member.to_dict() + if isinstance(self.pool_member, dict): + _dict['pool_member'] = self.pool_member + else: + _dict['pool_member'] = self.pool_member.to_dict() if hasattr(self, 'status') and self.status is not None: _dict['status'] = self.status if hasattr(self, 'updated_at') and self.updated_at is not None: @@ -37054,7 +38610,7 @@ def from_dict(cls, _dict: Dict) -> 'InstanceGroupMembershipCollection': else: raise ValueError('Required property \'limit\' not present in InstanceGroupMembershipCollection JSON') if 'memberships' in _dict: - args['memberships'] = [InstanceGroupMembership.from_dict(x) for x in _dict.get('memberships')] + args['memberships'] = [InstanceGroupMembership.from_dict(v) for v in _dict.get('memberships')] else: raise ValueError('Required property \'memberships\' not present in InstanceGroupMembershipCollection JSON') if 'next' in _dict: @@ -37074,13 +38630,25 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'first') and self.first is not None: - _dict['first'] = self.first.to_dict() + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit if hasattr(self, 'memberships') and self.memberships is not None: - _dict['memberships'] = [x.to_dict() for x in self.memberships] + memberships_list = [] + for v in self.memberships: + if isinstance(v, dict): + memberships_list.append(v) + else: + memberships_list.append(v.to_dict()) + _dict['memberships'] = memberships_list if hasattr(self, 'next') and self.next is not None: - _dict['next'] = self.next.to_dict() + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() if hasattr(self, 'total_count') and self.total_count is not None: _dict['total_count'] = self.total_count return _dict @@ -37220,8 +38788,8 @@ class InstanceGroupMembershipPatch(): """ InstanceGroupMembershipPatch. - :attr str name: (optional) The user-defined name for this instance group - membership. Names must be unique within the instance group. + :attr str name: (optional) The name for this instance group membership. The name + must not be used by another membership for the instance group manager. """ def __init__(self, @@ -37230,8 +38798,9 @@ def __init__(self, """ Initialize a InstanceGroupMembershipPatch object. - :param str name: (optional) The user-defined name for this instance group - membership. Names must be unique within the instance group. + :param str name: (optional) The name for this instance group membership. + The name must not be used by another membership for the instance group + manager. """ self.name = name @@ -37287,9 +38856,8 @@ class InstanceGroupPatch(): for `default_trusted_profile.auto_link`. :attr LoadBalancerIdentity load_balancer: (optional) The load balancer - associated with `load_balancer_pool`. - This property must be specified if and only if `load_balancer_pool` has been - specified. + associated with the specified load balancer pool. + Required if `load_balancer_pool` is specified. At present, only load balancers in the `application` family are supported. :attr LoadBalancerPoolIdentity load_balancer_pool: (optional) If specified, the load balancer pool this instance group will manage. A pool member @@ -37297,7 +38865,8 @@ class InstanceGroupPatch(): 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. + :attr str name: (optional) The name for this instance group. The name must not + be used by another instance group in the region. :attr List[SubnetIdentity] subnets: (optional) The subnets to use when creating new instances. """ @@ -37323,10 +38892,8 @@ def __init__(self, `true` for `default_trusted_profile.auto_link`. :param LoadBalancerIdentity load_balancer: (optional) The load balancer - associated with `load_balancer_pool`. - This property must be specified if and only if `load_balancer_pool` has - been - specified. + associated with the specified load balancer pool. + Required if `load_balancer_pool` is specified. At present, only load balancers in the `application` family are supported. :param LoadBalancerPoolIdentity load_balancer_pool: (optional) If specified, the load balancer pool this instance group will manage. A pool @@ -37336,7 +38903,8 @@ def __init__(self, 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. + :param str name: (optional) The name for this instance group. The name must + not be used by another instance group in the region. :param List[SubnetIdentity] subnets: (optional) The subnets to use when creating new instances. """ @@ -37399,11 +38967,11 @@ def to_dict(self) -> Dict: _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) + for v in self.subnets: + if isinstance(v, dict): + subnets_list.append(v) else: - subnets_list.append(x.to_dict()) + subnets_list.append(v.to_dict()) _dict['subnets'] = subnets_list return _dict @@ -37435,7 +39003,8 @@ class InstanceGroupReference(): some supplementary information. :attr str href: The URL for this instance group. :attr str id: The unique identifier for this instance group. - :attr str name: The user-defined name for this instance group. + :attr str name: The name for this instance group. The name is unique across all + instance groups in the region. """ def __init__(self, @@ -37451,7 +39020,8 @@ def __init__(self, :param str crn: The CRN for this instance group. :param str href: The URL for this instance group. :param str id: The unique identifier for this instance group. - :param str name: The user-defined name for this instance group. + :param str name: The name for this instance group. The name is unique + across all instance groups in the region. :param InstanceGroupReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and provides some supplementary information. @@ -37497,7 +39067,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'crn') and self.crn is not None: _dict['crn'] = self.crn if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -37621,7 +39194,7 @@ def from_dict(cls, _dict: Dict) -> 'InstanceInitialization': if 'default_trusted_profile' in _dict: args['default_trusted_profile'] = InstanceInitializationDefaultTrustedProfile.from_dict(_dict.get('default_trusted_profile')) if 'keys' in _dict: - args['keys'] = [KeyReference.from_dict(x) for x in _dict.get('keys')] + args['keys'] = [KeyReference.from_dict(v) for v in _dict.get('keys')] else: raise ValueError('Required property \'keys\' not present in InstanceInitialization JSON') if 'password' in _dict: @@ -37637,11 +39210,23 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'default_trusted_profile') and self.default_trusted_profile is not None: - _dict['default_trusted_profile'] = self.default_trusted_profile.to_dict() + if isinstance(self.default_trusted_profile, dict): + _dict['default_trusted_profile'] = self.default_trusted_profile + else: + _dict['default_trusted_profile'] = self.default_trusted_profile.to_dict() if hasattr(self, 'keys') and self.keys is not None: - _dict['keys'] = [x.to_dict() for x in self.keys] + keys_list = [] + for v in self.keys: + if isinstance(v, dict): + keys_list.append(v) + else: + keys_list.append(v.to_dict()) + _dict['keys'] = keys_list if hasattr(self, 'password') and self.password is not None: - _dict['password'] = self.password.to_dict() + if isinstance(self.password, dict): + _dict['password'] = self.password + else: + _dict['password'] = self.password.to_dict() return _dict def _to_dict(self): @@ -37715,7 +39300,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'auto_link') and self.auto_link is not None: _dict['auto_link'] = self.auto_link if hasattr(self, 'target') and self.target is not None: - _dict['target'] = self.target.to_dict() + if isinstance(self.target, dict): + _dict['target'] = self.target + else: + _dict['target'] = self.target.to_dict() return _dict def _to_dict(self): @@ -37786,7 +39374,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'encrypted_password') and self.encrypted_password is not None: _dict['encrypted_password'] = str(base64.b64encode(self.encrypted_password), 'utf-8') if hasattr(self, 'encryption_key') and self.encryption_key is not None: - _dict['encryption_key'] = self.encryption_key.to_dict() + if isinstance(self.encryption_key, dict): + _dict['encryption_key'] = self.encryption_key + else: + _dict['encryption_key'] = self.encryption_key.to_dict() return _dict def _to_dict(self): @@ -37987,8 +39578,9 @@ class InstancePatch(): availability policy for this virtual server instance. :attr InstanceMetadataServicePatch metadata_service: (optional) The metadata service configuration. - :attr str name: (optional) The user-defined name for this virtual server - instance (and default system hostname). + :attr str name: (optional) The name for this virtual server instance. The name + must not be used by another virtual server instance in the region. Changing the + name will not affect the system hostname. :attr InstancePlacementTargetPatch placement_target: (optional) The placement restrictions to use for the virtual server instance. For the placement restrictions to be changed, the instance `status` must be `stopping` or @@ -38027,8 +39619,9 @@ def __init__(self, availability policy for this virtual server instance. :param InstanceMetadataServicePatch metadata_service: (optional) The metadata service configuration. - :param str name: (optional) The user-defined name for this virtual server - instance (and default system hostname). + :param str name: (optional) The name for this virtual server instance. The + name must not be used by another virtual server instance in the region. + Changing the name will not affect the system hostname. :param InstancePlacementTargetPatch placement_target: (optional) The placement restrictions to use for the virtual server instance. For the placement @@ -38089,9 +39682,15 @@ 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 isinstance(self.availability_policy, dict): + _dict['availability_policy'] = self.availability_policy + else: + _dict['availability_policy'] = self.availability_policy.to_dict() if hasattr(self, 'metadata_service') and self.metadata_service is not None: - _dict['metadata_service'] = self.metadata_service.to_dict() + if isinstance(self.metadata_service, dict): + _dict['metadata_service'] = self.metadata_service + else: + _dict['metadata_service'] = self.metadata_service.to_dict() if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'placement_target') and self.placement_target is not None: @@ -38202,8 +39801,8 @@ class InstanceProfile(): :attr InstanceProfileBandwidth bandwidth: :attr List[InstanceProfileDisk] disks: Collection of the instance profile's disks. - :attr str family: (optional) The product family this virtual server instance - profile belongs to. + :attr str family: The product family this virtual server instance profile + belongs to. :attr InstanceProfileGPU gpu_count: (optional) :attr InstanceProfileGPUManufacturer gpu_manufacturer: (optional) :attr InstanceProfileGPUMemory gpu_memory: (optional) @@ -38222,6 +39821,7 @@ class InstanceProfile(): def __init__(self, bandwidth: 'InstanceProfileBandwidth', disks: List['InstanceProfileDisk'], + family: str, href: str, memory: 'InstanceProfileMemory', name: str, @@ -38231,7 +39831,6 @@ def __init__(self, vcpu_architecture: 'InstanceProfileVCPUArchitecture', vcpu_count: 'InstanceProfileVCPU', *, - family: str = None, gpu_count: 'InstanceProfileGPU' = None, gpu_manufacturer: 'InstanceProfileGPUManufacturer' = None, gpu_memory: 'InstanceProfileGPUMemory' = None, @@ -38242,6 +39841,8 @@ def __init__(self, :param InstanceProfileBandwidth bandwidth: :param List[InstanceProfileDisk] disks: Collection of the instance profile's disks. + :param str family: The product family this virtual server instance profile + belongs to. :param str href: The URL for this virtual server instance profile. :param InstanceProfileMemory memory: :param str name: The globally unique name for this virtual server instance @@ -38251,8 +39852,6 @@ def __init__(self, :param InstanceProfileVolumeBandwidth total_volume_bandwidth: :param InstanceProfileVCPUArchitecture vcpu_architecture: :param InstanceProfileVCPU vcpu_count: - :param str family: (optional) The product family this virtual server - instance profile belongs to. :param InstanceProfileGPU gpu_count: (optional) :param InstanceProfileGPUManufacturer gpu_manufacturer: (optional) :param InstanceProfileGPUMemory gpu_memory: (optional) @@ -38283,11 +39882,13 @@ def from_dict(cls, _dict: Dict) -> 'InstanceProfile': else: raise ValueError('Required property \'bandwidth\' not present in InstanceProfile JSON') if 'disks' in _dict: - args['disks'] = [InstanceProfileDisk.from_dict(x) for x in _dict.get('disks')] + args['disks'] = [InstanceProfileDisk.from_dict(v) for v in _dict.get('disks')] else: raise ValueError('Required property \'disks\' not present in InstanceProfile JSON') if 'family' in _dict: args['family'] = _dict.get('family') + else: + raise ValueError('Required property \'family\' not present in InstanceProfile JSON') if 'gpu_count' in _dict: args['gpu_count'] = _dict.get('gpu_count') if 'gpu_manufacturer' in _dict: @@ -38344,7 +39945,13 @@ def to_dict(self) -> Dict: else: _dict['bandwidth'] = self.bandwidth.to_dict() if hasattr(self, 'disks') and self.disks is not None: - _dict['disks'] = [x.to_dict() for x in self.disks] + disks_list = [] + for v in self.disks: + if isinstance(v, dict): + disks_list.append(v) + else: + disks_list.append(v.to_dict()) + _dict['disks'] = disks_list if hasattr(self, 'family') and self.family is not None: _dict['family'] = self.family if hasattr(self, 'gpu_count') and self.gpu_count is not None: @@ -38353,14 +39960,20 @@ def to_dict(self) -> Dict: else: _dict['gpu_count'] = self.gpu_count.to_dict() if hasattr(self, 'gpu_manufacturer') and self.gpu_manufacturer is not None: - _dict['gpu_manufacturer'] = self.gpu_manufacturer.to_dict() + if isinstance(self.gpu_manufacturer, dict): + _dict['gpu_manufacturer'] = self.gpu_manufacturer + else: + _dict['gpu_manufacturer'] = self.gpu_manufacturer.to_dict() if hasattr(self, 'gpu_memory') and self.gpu_memory is not None: if isinstance(self.gpu_memory, dict): _dict['gpu_memory'] = self.gpu_memory else: _dict['gpu_memory'] = self.gpu_memory.to_dict() if hasattr(self, 'gpu_model') and self.gpu_model is not None: - _dict['gpu_model'] = self.gpu_model.to_dict() + if isinstance(self.gpu_model, dict): + _dict['gpu_model'] = self.gpu_model + else: + _dict['gpu_model'] = self.gpu_model.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'memory') and self.memory is not None: @@ -38371,7 +39984,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'os_architecture') and self.os_architecture is not None: - _dict['os_architecture'] = self.os_architecture.to_dict() + if isinstance(self.os_architecture, dict): + _dict['os_architecture'] = self.os_architecture + else: + _dict['os_architecture'] = self.os_architecture.to_dict() if hasattr(self, 'port_speed') and self.port_speed is not None: if isinstance(self.port_speed, dict): _dict['port_speed'] = self.port_speed @@ -38383,7 +39999,10 @@ def to_dict(self) -> Dict: else: _dict['total_volume_bandwidth'] = self.total_volume_bandwidth.to_dict() if hasattr(self, 'vcpu_architecture') and self.vcpu_architecture is not None: - _dict['vcpu_architecture'] = self.vcpu_architecture.to_dict() + if isinstance(self.vcpu_architecture, dict): + _dict['vcpu_architecture'] = self.vcpu_architecture + else: + _dict['vcpu_architecture'] = self.vcpu_architecture.to_dict() if hasattr(self, 'vcpu_count') and self.vcpu_count is not None: if isinstance(self.vcpu_count, dict): _dict['vcpu_count'] = self.vcpu_count @@ -38447,7 +40066,7 @@ def from_dict(cls, _dict: Dict) -> 'InstanceProfileCollection': """Initialize a InstanceProfileCollection object from a json dictionary.""" args = {} if 'profiles' in _dict: - args['profiles'] = [InstanceProfile.from_dict(x) for x in _dict.get('profiles')] + args['profiles'] = [InstanceProfile.from_dict(v) for v in _dict.get('profiles')] else: raise ValueError('Required property \'profiles\' not present in InstanceProfileCollection JSON') return cls(**args) @@ -38461,7 +40080,13 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'profiles') and self.profiles is not None: - _dict['profiles'] = [x.to_dict() for x in self.profiles] + profiles_list = [] + for v in self.profiles: + if isinstance(v, dict): + profiles_list.append(v) + else: + profiles_list.append(v.to_dict()) + _dict['profiles'] = profiles_list return _dict def _to_dict(self): @@ -38543,7 +40168,10 @@ def to_dict(self) -> Dict: else: _dict['size'] = self.size.to_dict() if hasattr(self, 'supported_interface_types') and self.supported_interface_types is not None: - _dict['supported_interface_types'] = self.supported_interface_types.to_dict() + if isinstance(self.supported_interface_types, dict): + _dict['supported_interface_types'] = self.supported_interface_types + else: + _dict['supported_interface_types'] = self.supported_interface_types.to_dict() return _dict def _to_dict(self): @@ -39235,9 +40863,10 @@ class InstancePrototype(): property. :attr InstanceMetadataServicePrototype metadata_service: (optional) The metadata service configuration. - :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 str name: (optional) The name for this virtual server instance. The name + must not be used by another virtual server instance in the region. If + unspecified, the name will be a hyphenated list of randomly-selected words. + The system hostname will be based on this name. :attr List[NetworkInterfacePrototype] network_interfaces: (optional) The additional network interfaces to create for the virtual server instance. :attr InstancePlacementTargetPrototype placement_target: (optional) The @@ -39258,9 +40887,8 @@ class InstancePrototype(): :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 List[VolumeAttachmentPrototype] 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 @@ -39280,7 +40908,7 @@ def __init__(self, resource_group: 'ResourceGroupIdentity' = None, total_volume_bandwidth: int = None, user_data: str = None, - volume_attachments: List['VolumeAttachmentPrototypeInstanceContext'] = None, + volume_attachments: List['VolumeAttachmentPrototype'] = None, vpc: 'VPCIdentity' = None) -> None: """ Initialize a InstancePrototype object. @@ -39313,9 +40941,10 @@ def __init__(self, property. :param InstanceMetadataServicePrototype metadata_service: (optional) The metadata service configuration. - :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 str name: (optional) The name for this virtual server instance. The + name must not be used by another virtual server instance in the region. If + unspecified, the name will be a hyphenated list of randomly-selected words. + The system hostname will be based on this name. :param List[NetworkInterfacePrototype] network_interfaces: (optional) The additional network interfaces to create for the virtual server instance. :param InstancePlacementTargetPrototype placement_target: (optional) The @@ -39338,9 +40967,8 @@ def __init__(self, :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 List[VolumeAttachmentPrototype] 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 @@ -39361,8 +40989,8 @@ class InstanceReference(): some supplementary information. :attr str href: The URL for this virtual server instance. :attr str id: The unique identifier for this virtual server instance. - :attr str name: The user-defined name for this virtual server instance (and - default system hostname). + :attr str name: The name for this virtual server instance. The name is unique + across all virtual server instances in the region. """ def __init__(self, @@ -39378,8 +41006,8 @@ def __init__(self, :param str crn: The CRN for this virtual server instance. :param str href: The URL for this virtual server instance. :param str id: The unique identifier for this virtual server instance. - :param str name: The user-defined name for this virtual server instance - (and default system hostname). + :param str name: The name for this virtual server instance. The name is + unique across all virtual server instances in the region. :param InstanceReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and provides some supplementary information. @@ -39425,7 +41053,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'crn') and self.crn is not None: _dict['crn'] = self.crn if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -39637,7 +41268,8 @@ class InstanceTemplate(): property. :attr InstanceMetadataServicePrototype metadata_service: (optional) The metadata service configuration. - :attr str name: The unique user-defined name for this instance template. + :attr str name: The name for this instance template. The name is unique across + all instance templates in the region. :attr List[NetworkInterfacePrototype] network_interfaces: (optional) The additional network interfaces to create for the virtual server instance. :attr InstancePlacementTargetPrototype placement_target: (optional) The @@ -39657,9 +41289,8 @@ class InstanceTemplate(): :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 List[VolumeAttachmentPrototype] 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 @@ -39683,7 +41314,7 @@ def __init__(self, profile: 'InstanceProfileIdentity' = None, total_volume_bandwidth: int = None, user_data: str = None, - volume_attachments: List['VolumeAttachmentPrototypeInstanceContext'] = None, + volume_attachments: List['VolumeAttachmentPrototype'] = None, vpc: 'VPCIdentity' = None) -> None: """ Initialize a InstanceTemplate object. @@ -39693,7 +41324,8 @@ def __init__(self, :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 str name: The name for this instance template. The name is unique + across all instance templates in the region. :param ResourceGroupReference resource_group: The resource group for this instance template. :param InstanceAvailabilityPrototype availability_policy: (optional) The @@ -39742,9 +41374,8 @@ def __init__(self, :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 List[VolumeAttachmentPrototype] 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 @@ -39829,18 +41460,24 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'first') and self.first is not None: - _dict['first'] = self.first.to_dict() + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit if hasattr(self, 'next') and self.next is not None: - _dict['next'] = self.next.to_dict() + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() if hasattr(self, 'templates') and self.templates is not None: templates_list = [] - for x in self.templates: - if isinstance(x, dict): - templates_list.append(x) + for v in self.templates: + if isinstance(v, dict): + templates_list.append(v) else: - templates_list.append(x.to_dict()) + templates_list.append(v.to_dict()) _dict['templates'] = templates_list if hasattr(self, 'total_count') and self.total_count is not None: _dict['total_count'] = self.total_count @@ -39996,8 +41633,8 @@ class InstanceTemplatePatch(): """ InstanceTemplatePatch. - :attr str name: (optional) The unique user-defined name for this instance - template. + :attr str name: (optional) The name for this instance template. The name must + not be used by another instance template in the region. """ def __init__(self, @@ -40006,8 +41643,8 @@ def __init__(self, """ Initialize a InstanceTemplatePatch object. - :param str name: (optional) The unique user-defined name for this instance - template. + :param str name: (optional) The name for this instance template. The name + must not be used by another instance template in the region. """ self.name = name @@ -40079,9 +41716,9 @@ class InstanceTemplatePrototype(): property. :attr InstanceMetadataServicePrototype metadata_service: (optional) The metadata service configuration. - :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 str name: (optional) The name for this instance template. The name must + not be used by another instance template in the region. 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 @@ -40102,9 +41739,8 @@ class InstanceTemplatePrototype(): :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 List[VolumeAttachmentPrototype] 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 @@ -40124,7 +41760,7 @@ def __init__(self, resource_group: 'ResourceGroupIdentity' = None, total_volume_bandwidth: int = None, user_data: str = None, - volume_attachments: List['VolumeAttachmentPrototypeInstanceContext'] = None, + volume_attachments: List['VolumeAttachmentPrototype'] = None, vpc: 'VPCIdentity' = None) -> None: """ Initialize a InstanceTemplatePrototype object. @@ -40157,9 +41793,9 @@ def __init__(self, property. :param InstanceMetadataServicePrototype metadata_service: (optional) The metadata service configuration. - :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 str name: (optional) The name for this instance template. The name + must not be used by another instance template in the region. 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 @@ -40182,9 +41818,8 @@ def __init__(self, :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 List[VolumeAttachmentPrototype] 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 @@ -40205,7 +41840,8 @@ class InstanceTemplateReference(): some supplementary information. :attr str href: The URL for this instance template. :attr str id: The unique identifier for this instance template. - :attr str name: The unique user-defined name for this instance template. + :attr str name: The name for this instance template. The name is unique across + all instance templates in the region. """ def __init__(self, @@ -40221,7 +41857,8 @@ def __init__(self, :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 str name: The name for this instance template. The name is unique + across all instance templates in the region. :param InstanceTemplateReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and provides @@ -40268,7 +41905,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'crn') and self.crn is not None: _dict['crn'] = self.crn if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -40429,8 +42069,9 @@ class Key(): :attr str href: The URL for this key. :attr str id: The unique identifier for this key. :attr int length: The length of this key (in bits). - :attr str name: The unique user-defined name for this key. If unspecified, the - name will be a hyphenated list of randomly-selected words. + :attr str name: The name for this key. The name must not be used by another key + in the region. If unspecified, the name will be a hyphenated list of + randomly-selected words. :attr str public_key: The public SSH key, consisting of two space-separated fields: the algorithm name, and the base64-encoded key. :attr ResourceGroupReference resource_group: The resource group for this key. @@ -40459,8 +42100,9 @@ def __init__(self, :param str href: The URL for this key. :param str id: The unique identifier for this key. :param int length: The length of this key (in bits). - :param str name: The unique user-defined name for this key. If unspecified, - the name will be a hyphenated list of randomly-selected words. + :param str name: The name for this key. The name must not be used by + another key in the region. If unspecified, the name will be a hyphenated + list of randomly-selected words. :param str public_key: The public SSH key, consisting of two space-separated fields: the algorithm name, and the base64-encoded key. :param ResourceGroupReference resource_group: The resource group for this @@ -40549,7 +42191,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'public_key') and self.public_key is not None: _dict['public_key'] = self.public_key if hasattr(self, 'resource_group') and self.resource_group is not None: - _dict['resource_group'] = self.resource_group.to_dict() + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() if hasattr(self, 'type') and self.type is not None: _dict['type'] = self.type return _dict @@ -40627,7 +42272,7 @@ def from_dict(cls, _dict: Dict) -> 'KeyCollection': else: raise ValueError('Required property \'first\' not present in KeyCollection JSON') if 'keys' in _dict: - args['keys'] = [Key.from_dict(x) for x in _dict.get('keys')] + args['keys'] = [Key.from_dict(v) for v in _dict.get('keys')] else: raise ValueError('Required property \'keys\' not present in KeyCollection JSON') if 'limit' in _dict: @@ -40651,13 +42296,25 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'first') and self.first is not None: - _dict['first'] = self.first.to_dict() + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() if hasattr(self, 'keys') and self.keys is not None: - _dict['keys'] = [x.to_dict() for x in self.keys] + keys_list = [] + for v in self.keys: + if isinstance(v, dict): + keys_list.append(v) + else: + keys_list.append(v.to_dict()) + _dict['keys'] = keys_list if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit if hasattr(self, 'next') and self.next is not None: - _dict['next'] = self.next.to_dict() + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() if hasattr(self, 'total_count') and self.total_count is not None: _dict['total_count'] = self.total_count return _dict @@ -40812,7 +42469,8 @@ class KeyPatch(): """ KeyPatch. - :attr str name: (optional) The user-defined name for this key. + :attr str name: (optional) The name for this key. The name must not be used by + another key in the region. """ def __init__(self, @@ -40821,7 +42479,8 @@ def __init__(self, """ Initialize a KeyPatch object. - :param str name: (optional) The user-defined name for this key. + :param str name: (optional) The name for this key. The name must not be + used by another key in the region. """ self.name = name @@ -40875,7 +42534,8 @@ class KeyReference(): base64-encoded and prefixed with the hash algorithm (always `SHA256`). :attr str href: The URL for this key. :attr str id: The unique identifier for this key. - :attr str name: The user-defined name for this key. + :attr str name: The name for this key. The name is unique across all keys in the + region. """ def __init__(self, @@ -40895,7 +42555,8 @@ def __init__(self, `SHA256`). :param str href: The URL for this key. :param str id: The unique identifier for this key. - :param str name: The user-defined name for this key. + :param str name: The name for this key. The name is unique across all keys + in the region. :param KeyReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and provides some supplementary information. @@ -40946,7 +42607,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'crn') and self.crn is not None: _dict['crn'] = self.crn if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'fingerprint') and self.fingerprint is not None: _dict['fingerprint'] = self.fingerprint if hasattr(self, 'href') and self.href is not None: @@ -41205,7 +42869,8 @@ class LoadBalancer(): balancer. :attr LoadBalancerLogging logging: The logging configuration for this load balancer. - :attr str name: The unique user-defined name for this load balancer. + :attr str name: The name for this load balancer. The name is unique across all + load balancers in the VPC. :attr str operating_status: The operating status of this load balancer. :attr List[LoadBalancerPoolReference] pools: The pools of this load balancer. :attr List[LoadBalancerPrivateIpsItem] private_ips: The private IP addresses @@ -41286,7 +42951,8 @@ def __init__(self, load balancer. :param LoadBalancerLogging logging: The logging configuration for this load balancer. - :param str name: The unique user-defined name for this load balancer. + :param str name: The name for this load balancer. The name is unique across + all load balancers in the VPC. :param str operating_status: The operating status of this load balancer. :param List[LoadBalancerPoolReference] pools: The pools of this load balancer. @@ -41388,7 +43054,7 @@ def from_dict(cls, _dict: Dict) -> 'LoadBalancer': else: raise ValueError('Required property \'is_public\' not present in LoadBalancer JSON') if 'listeners' in _dict: - args['listeners'] = [LoadBalancerListenerReference.from_dict(x) for x in _dict.get('listeners')] + args['listeners'] = [LoadBalancerListenerReference.from_dict(v) for v in _dict.get('listeners')] else: raise ValueError('Required property \'listeners\' not present in LoadBalancer JSON') if 'logging' in _dict: @@ -41404,11 +43070,11 @@ def from_dict(cls, _dict: Dict) -> 'LoadBalancer': else: raise ValueError('Required property \'operating_status\' not present in LoadBalancer JSON') if 'pools' in _dict: - args['pools'] = [LoadBalancerPoolReference.from_dict(x) for x in _dict.get('pools')] + args['pools'] = [LoadBalancerPoolReference.from_dict(v) for v in _dict.get('pools')] else: raise ValueError('Required property \'pools\' not present in LoadBalancer JSON') if 'private_ips' in _dict: - args['private_ips'] = [LoadBalancerPrivateIpsItem.from_dict(x) for x in _dict.get('private_ips')] + args['private_ips'] = [LoadBalancerPrivateIpsItem.from_dict(v) for v in _dict.get('private_ips')] else: raise ValueError('Required property \'private_ips\' not present in LoadBalancer JSON') if 'profile' in _dict: @@ -41420,7 +43086,7 @@ def from_dict(cls, _dict: Dict) -> 'LoadBalancer': else: raise ValueError('Required property \'provisioning_status\' not present in LoadBalancer JSON') if 'public_ips' in _dict: - args['public_ips'] = [IP.from_dict(x) for x in _dict.get('public_ips')] + args['public_ips'] = [IP.from_dict(v) for v in _dict.get('public_ips')] else: raise ValueError('Required property \'public_ips\' not present in LoadBalancer JSON') if 'resource_group' in _dict: @@ -41436,7 +43102,7 @@ def from_dict(cls, _dict: Dict) -> 'LoadBalancer': else: raise ValueError('Required property \'route_mode\' not present in LoadBalancer JSON') if 'security_groups' in _dict: - args['security_groups'] = [SecurityGroupReference.from_dict(x) for x in _dict.get('security_groups')] + args['security_groups'] = [SecurityGroupReference.from_dict(v) for v in _dict.get('security_groups')] else: raise ValueError('Required property \'security_groups\' not present in LoadBalancer JSON') if 'security_groups_supported' in _dict: @@ -41444,7 +43110,7 @@ def from_dict(cls, _dict: Dict) -> 'LoadBalancer': else: raise ValueError('Required property \'security_groups_supported\' not present in LoadBalancer JSON') if 'subnets' in _dict: - args['subnets'] = [SubnetReference.from_dict(x) for x in _dict.get('subnets')] + args['subnets'] = [SubnetReference.from_dict(v) for v in _dict.get('subnets')] else: raise ValueError('Required property \'subnets\' not present in LoadBalancer JSON') if 'udp_supported' in _dict: @@ -41474,35 +43140,80 @@ def to_dict(self) -> Dict: if hasattr(self, 'is_public') and self.is_public is not None: _dict['is_public'] = self.is_public if hasattr(self, 'listeners') and self.listeners is not None: - _dict['listeners'] = [x.to_dict() for x in self.listeners] + listeners_list = [] + for v in self.listeners: + if isinstance(v, dict): + listeners_list.append(v) + else: + listeners_list.append(v.to_dict()) + _dict['listeners'] = listeners_list if hasattr(self, 'logging') and self.logging is not None: - _dict['logging'] = self.logging.to_dict() + if isinstance(self.logging, dict): + _dict['logging'] = self.logging + else: + _dict['logging'] = self.logging.to_dict() if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'operating_status') and self.operating_status is not None: _dict['operating_status'] = self.operating_status if hasattr(self, 'pools') and self.pools is not None: - _dict['pools'] = [x.to_dict() for x in self.pools] + pools_list = [] + for v in self.pools: + if isinstance(v, dict): + pools_list.append(v) + else: + pools_list.append(v.to_dict()) + _dict['pools'] = pools_list if hasattr(self, 'private_ips') and self.private_ips is not None: - _dict['private_ips'] = [x.to_dict() for x in self.private_ips] + private_ips_list = [] + for v in self.private_ips: + if isinstance(v, dict): + private_ips_list.append(v) + else: + private_ips_list.append(v.to_dict()) + _dict['private_ips'] = private_ips_list if hasattr(self, 'profile') and self.profile is not None: - _dict['profile'] = self.profile.to_dict() + if isinstance(self.profile, dict): + _dict['profile'] = self.profile + else: + _dict['profile'] = self.profile.to_dict() if hasattr(self, 'provisioning_status') and self.provisioning_status is not None: _dict['provisioning_status'] = self.provisioning_status if hasattr(self, 'public_ips') and self.public_ips is not None: - _dict['public_ips'] = [x.to_dict() for x in self.public_ips] + public_ips_list = [] + for v in self.public_ips: + if isinstance(v, dict): + public_ips_list.append(v) + else: + public_ips_list.append(v.to_dict()) + _dict['public_ips'] = public_ips_list if hasattr(self, 'resource_group') and self.resource_group is not None: - _dict['resource_group'] = self.resource_group.to_dict() + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() if hasattr(self, 'resource_type') and self.resource_type is not None: _dict['resource_type'] = self.resource_type if hasattr(self, 'route_mode') and self.route_mode is not None: _dict['route_mode'] = self.route_mode if hasattr(self, 'security_groups') and self.security_groups is not None: - _dict['security_groups'] = [x.to_dict() for x in self.security_groups] + security_groups_list = [] + for v in self.security_groups: + if isinstance(v, dict): + security_groups_list.append(v) + else: + security_groups_list.append(v.to_dict()) + _dict['security_groups'] = security_groups_list if hasattr(self, 'security_groups_supported') and self.security_groups_supported is not None: _dict['security_groups_supported'] = self.security_groups_supported if hasattr(self, 'subnets') and self.subnets is not None: - _dict['subnets'] = [x.to_dict() for x in self.subnets] + subnets_list = [] + for v in self.subnets: + if isinstance(v, dict): + subnets_list.append(v) + else: + subnets_list.append(v.to_dict()) + _dict['subnets'] = subnets_list if hasattr(self, 'udp_supported') and self.udp_supported is not None: _dict['udp_supported'] = self.udp_supported return _dict @@ -41621,7 +43332,7 @@ def from_dict(cls, _dict: Dict) -> 'LoadBalancerCollection': else: raise ValueError('Required property \'limit\' not present in LoadBalancerCollection JSON') if 'load_balancers' in _dict: - args['load_balancers'] = [LoadBalancer.from_dict(x) for x in _dict.get('load_balancers')] + args['load_balancers'] = [LoadBalancer.from_dict(v) for v in _dict.get('load_balancers')] else: raise ValueError('Required property \'load_balancers\' not present in LoadBalancerCollection JSON') if 'next' in _dict: @@ -41641,13 +43352,25 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'first') and self.first is not None: - _dict['first'] = self.first.to_dict() + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit if hasattr(self, 'load_balancers') and self.load_balancers is not None: - _dict['load_balancers'] = [x.to_dict() for x in self.load_balancers] + load_balancers_list = [] + for v in self.load_balancers: + if isinstance(v, dict): + load_balancers_list.append(v) + else: + load_balancers_list.append(v.to_dict()) + _dict['load_balancers'] = load_balancers_list if hasattr(self, 'next') and self.next is not None: - _dict['next'] = self.next.to_dict() + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() if hasattr(self, 'total_count') and self.total_count is not None: _dict['total_count'] = self.total_count return _dict @@ -41956,7 +43679,7 @@ def from_dict(cls, _dict: Dict) -> 'LoadBalancerListener': else: raise ValueError('Required property \'id\' not present in LoadBalancerListener JSON') if 'policies' in _dict: - args['policies'] = [LoadBalancerListenerPolicyReference.from_dict(x) for x in _dict.get('policies')] + args['policies'] = [LoadBalancerListenerPolicyReference.from_dict(v) for v in _dict.get('policies')] if 'port' in _dict: args['port'] = _dict.get('port') else: @@ -41990,21 +43713,36 @@ def to_dict(self) -> 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: - _dict['certificate_instance'] = self.certificate_instance.to_dict() + 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, 'created_at') and self.created_at is not None: _dict['created_at'] = datetime_to_string(self.created_at) if hasattr(self, 'default_pool') and self.default_pool is not None: - _dict['default_pool'] = self.default_pool.to_dict() + if isinstance(self.default_pool, dict): + _dict['default_pool'] = self.default_pool + else: + _dict['default_pool'] = self.default_pool.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'https_redirect') and self.https_redirect is not None: - _dict['https_redirect'] = self.https_redirect.to_dict() + if isinstance(self.https_redirect, dict): + _dict['https_redirect'] = self.https_redirect + else: + _dict['https_redirect'] = self.https_redirect.to_dict() if hasattr(self, 'id') and self.id is not None: _dict['id'] = self.id if hasattr(self, 'policies') and self.policies is not None: - _dict['policies'] = [x.to_dict() for x in self.policies] + policies_list = [] + for v in self.policies: + if isinstance(v, dict): + policies_list.append(v) + else: + policies_list.append(v.to_dict()) + _dict['policies'] = policies_list 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: @@ -42085,7 +43823,7 @@ def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerCollection': """Initialize a LoadBalancerListenerCollection object from a json dictionary.""" args = {} if 'listeners' in _dict: - args['listeners'] = [LoadBalancerListener.from_dict(x) for x in _dict.get('listeners')] + args['listeners'] = [LoadBalancerListener.from_dict(v) for v in _dict.get('listeners')] else: raise ValueError('Required property \'listeners\' not present in LoadBalancerListenerCollection JSON') return cls(**args) @@ -42099,7 +43837,13 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'listeners') and self.listeners is not None: - _dict['listeners'] = [x.to_dict() for x in self.listeners] + listeners_list = [] + for v in self.listeners: + if isinstance(v, dict): + listeners_list.append(v) + else: + listeners_list.append(v.to_dict()) + _dict['listeners'] = listeners_list return _dict def _to_dict(self): @@ -42172,7 +43916,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'http_status_code') and self.http_status_code is not None: _dict['http_status_code'] = self.http_status_code if hasattr(self, 'listener') and self.listener is not None: - _dict['listener'] = self.listener.to_dict() + if isinstance(self.listener, dict): + _dict['listener'] = self.listener + else: + _dict['listener'] = self.listener.to_dict() if hasattr(self, 'uri') and self.uri is not None: _dict['uri'] = self.uri return _dict @@ -42563,7 +44310,10 @@ def to_dict(self) -> Dict: else: _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 isinstance(self.https_redirect, dict): + _dict['https_redirect'] = self.https_redirect + else: + _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: @@ -42624,7 +44374,8 @@ class LoadBalancerListenerPolicy(): :attr datetime created_at: The date and time that this policy was created. :attr str href: The listener policy's canonical URL. :attr str id: The policy's unique identifier. - :attr str name: The user-defined name for this policy. + :attr str name: The name for this load balancer listener policy. The name is + unique across all policies for the load balancer listener. :attr int priority: Priority of the policy. Lower value indicates higher priority. :attr str provisioning_status: The provisioning status of this policy @@ -42664,7 +44415,8 @@ def __init__(self, :param datetime created_at: The date and time that this policy was created. :param str href: The listener policy's canonical URL. :param str id: The policy's unique identifier. - :param str name: The user-defined name for this policy. + :param str name: The name for this load balancer listener policy. The name + is unique across all policies for the load balancer listener. :param int priority: Priority of the policy. Lower value indicates higher priority. :param str provisioning_status: The provisioning status of this policy @@ -42724,7 +44476,7 @@ def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicy': else: raise ValueError('Required property \'provisioning_status\' not present in LoadBalancerListenerPolicy JSON') if 'rules' in _dict: - args['rules'] = [LoadBalancerListenerPolicyRuleReference.from_dict(x) for x in _dict.get('rules')] + args['rules'] = [LoadBalancerListenerPolicyRuleReference.from_dict(v) for v in _dict.get('rules')] else: raise ValueError('Required property \'rules\' not present in LoadBalancerListenerPolicy JSON') if 'target' in _dict: @@ -42754,7 +44506,13 @@ def to_dict(self) -> Dict: if hasattr(self, 'provisioning_status') and self.provisioning_status is not None: _dict['provisioning_status'] = self.provisioning_status if hasattr(self, 'rules') and self.rules is not None: - _dict['rules'] = [x.to_dict() for x in self.rules] + rules_list = [] + for v in self.rules: + if isinstance(v, dict): + rules_list.append(v) + else: + rules_list.append(v.to_dict()) + _dict['rules'] = rules_list if hasattr(self, 'target') and self.target is not None: if isinstance(self.target, dict): _dict['target'] = self.target @@ -42830,7 +44588,7 @@ def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyCollection': """Initialize a LoadBalancerListenerPolicyCollection object from a json dictionary.""" args = {} if 'policies' in _dict: - args['policies'] = [LoadBalancerListenerPolicy.from_dict(x) for x in _dict.get('policies')] + args['policies'] = [LoadBalancerListenerPolicy.from_dict(v) for v in _dict.get('policies')] else: raise ValueError('Required property \'policies\' not present in LoadBalancerListenerPolicyCollection JSON') return cls(**args) @@ -42844,7 +44602,13 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'policies') and self.policies is not None: - _dict['policies'] = [x.to_dict() for x in self.policies] + policies_list = [] + for v in self.policies: + if isinstance(v, dict): + policies_list.append(v) + else: + policies_list.append(v.to_dict()) + _dict['policies'] = policies_list return _dict def _to_dict(self): @@ -42869,8 +44633,8 @@ class LoadBalancerListenerPolicyPatch(): """ LoadBalancerListenerPolicyPatch. - :attr str name: (optional) The user-defined name for this policy. Names must be - unique within the load balancer listener the policy resides in. + :attr str name: (optional) The name for this policy. The name must not be used + by another policy for the load balancer listener. :attr int priority: (optional) Priority of the policy. Lower value indicates higher priority. :attr LoadBalancerListenerPolicyTargetPatch target: (optional) - If `action` is @@ -42889,8 +44653,8 @@ def __init__(self, """ Initialize a LoadBalancerListenerPolicyPatch object. - :param str name: (optional) The user-defined name for this policy. Names - must be unique within the load balancer listener the policy resides in. + :param str name: (optional) The name for this policy. The name must not be + used by another policy for the load balancer listener. :param int priority: (optional) Priority of the policy. Lower value indicates higher priority. :param LoadBalancerListenerPolicyTargetPatch target: (optional) - If @@ -42962,8 +44726,9 @@ class LoadBalancerListenerPolicyPrototype(): 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 str name: (optional) The user-defined name for this policy. Names must be - unique within the load balancer listener the policy resides in. + :attr str name: (optional) The name for this policy. The name must not be used + by another policy for the load balancer listener. If unspecified, the name will + be a hyphenated list of randomly-selected words. :attr int priority: Priority of the policy. Lower value indicates higher priority. :attr List[LoadBalancerListenerPolicyRulePrototype] rules: (optional) The rule @@ -42993,8 +44758,9 @@ def __init__(self, which the unexpected property value was encountered. :param int priority: Priority of the policy. Lower value indicates higher priority. - :param str name: (optional) The user-defined name for this policy. Names - must be unique within the load balancer listener the policy resides in. + :param str name: (optional) The name for this policy. The name must not be + used by another policy for the load balancer listener. If unspecified, the + name will be a hyphenated list of randomly-selected words. :param List[LoadBalancerListenerPolicyRulePrototype] rules: (optional) The rule prototype objects for this policy. :param LoadBalancerListenerPolicyTargetPrototype target: (optional) - If @@ -43025,7 +44791,7 @@ def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyPrototype': else: raise ValueError('Required property \'priority\' not present in LoadBalancerListenerPolicyPrototype JSON') if 'rules' in _dict: - args['rules'] = [LoadBalancerListenerPolicyRulePrototype.from_dict(x) for x in _dict.get('rules')] + args['rules'] = [LoadBalancerListenerPolicyRulePrototype.from_dict(v) for v in _dict.get('rules')] if 'target' in _dict: args['target'] = _dict.get('target') return cls(**args) @@ -43045,7 +44811,13 @@ def to_dict(self) -> Dict: if hasattr(self, 'priority') and self.priority is not None: _dict['priority'] = self.priority if hasattr(self, 'rules') and self.rules is not None: - _dict['rules'] = [x.to_dict() for x in self.rules] + rules_list = [] + for v in self.rules: + if isinstance(v, dict): + rules_list.append(v) + else: + rules_list.append(v.to_dict()) + _dict['rules'] = rules_list if hasattr(self, 'target') and self.target is not None: if isinstance(self.target, dict): _dict['target'] = self.target @@ -43094,11 +44866,13 @@ class LoadBalancerListenerPolicyReference(): some supplementary information. :attr str href: The listener policy's canonical URL. :attr str id: The policy's unique identifier. + :attr object name: """ def __init__(self, href: str, id: str, + name: object, *, deleted: 'LoadBalancerListenerPolicyReferenceDeleted' = None) -> None: """ @@ -43106,6 +44880,7 @@ def __init__(self, :param str href: The listener policy's canonical URL. :param str id: The policy's unique identifier. + :param object name: :param LoadBalancerListenerPolicyReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and provides @@ -43114,6 +44889,7 @@ def __init__(self, self.deleted = deleted self.href = href self.id = id + self.name = name @classmethod def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyReference': @@ -43129,6 +44905,10 @@ def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyReference': args['id'] = _dict.get('id') else: raise ValueError('Required property \'id\' not present in LoadBalancerListenerPolicyReference JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in LoadBalancerListenerPolicyReference JSON') return cls(**args) @classmethod @@ -43140,11 +44920,16 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: _dict['id'] = self.id + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name return _dict def _to_dict(self): @@ -43433,7 +45218,7 @@ def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyRuleCollection': """Initialize a LoadBalancerListenerPolicyRuleCollection object from a json dictionary.""" args = {} if 'rules' in _dict: - args['rules'] = [LoadBalancerListenerPolicyRule.from_dict(x) for x in _dict.get('rules')] + args['rules'] = [LoadBalancerListenerPolicyRule.from_dict(v) for v in _dict.get('rules')] else: raise ValueError('Required property \'rules\' not present in LoadBalancerListenerPolicyRuleCollection JSON') return cls(**args) @@ -43447,7 +45232,13 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'rules') and self.rules is not None: - _dict['rules'] = [x.to_dict() for x in self.rules] + rules_list = [] + for v in self.rules: + if isinstance(v, dict): + rules_list.append(v) + else: + rules_list.append(v.to_dict()) + _dict['rules'] = rules_list return _dict def _to_dict(self): @@ -43772,7 +45563,10 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -44106,9 +45900,15 @@ def to_dict(self) -> 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 isinstance(self.default_pool, dict): + _dict['default_pool'] = self.default_pool + else: + _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 isinstance(self.https_redirect, dict): + _dict['https_redirect'] = self.https_redirect + else: + _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: @@ -44211,7 +46011,10 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -44329,7 +46132,10 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'datapath') and self.datapath is not None: - _dict['datapath'] = self.datapath.to_dict() + if isinstance(self.datapath, dict): + _dict['datapath'] = self.datapath + else: + _dict['datapath'] = self.datapath.to_dict() return _dict def _to_dict(self): @@ -44416,7 +46222,8 @@ class LoadBalancerPatch(): for this load balancer. 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 str name: (optional) The name for this load balancer. The name must not be + used by another load balancer in the VPC. :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. @@ -44437,8 +46244,8 @@ def __init__(self, use for this load balancer. To activate logging, the load balancer profile must support the specified logging type. - :param str name: (optional) The unique user-defined name for this load - balancer. + :param str name: (optional) The name for this load balancer. The name must + not be used by another load balancer in the VPC. :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. @@ -44471,16 +46278,19 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'logging') and self.logging is not None: - _dict['logging'] = self.logging.to_dict() + if isinstance(self.logging, dict): + _dict['logging'] = self.logging + else: + _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) + for v in self.subnets: + if isinstance(v, dict): + subnets_list.append(v) else: - subnets_list.append(x.to_dict()) + subnets_list.append(v.to_dict()) _dict['subnets'] = subnets_list return _dict @@ -44516,7 +46326,8 @@ class LoadBalancerPool(): is managing this pool. :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 name: The name for this load balancer pool. The name is unique across + all pools for the load balancer. :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 @@ -44565,7 +46376,8 @@ def __init__(self, this pool. :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 name: The name for this load balancer pool. The name is unique + across all pools for the load balancer. :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. @@ -44635,7 +46447,7 @@ def from_dict(cls, _dict: Dict) -> 'LoadBalancerPool': if 'instance_group' in _dict: args['instance_group'] = InstanceGroupReference.from_dict(_dict.get('instance_group')) if 'members' in _dict: - args['members'] = [LoadBalancerPoolMemberReference.from_dict(x) for x in _dict.get('members')] + args['members'] = [LoadBalancerPoolMemberReference.from_dict(v) for v in _dict.get('members')] if 'name' in _dict: args['name'] = _dict.get('name') else: @@ -44669,15 +46481,27 @@ def to_dict(self) -> 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, 'health_monitor') and self.health_monitor is not None: - _dict['health_monitor'] = self.health_monitor.to_dict() + if isinstance(self.health_monitor, dict): + _dict['health_monitor'] = self.health_monitor + else: + _dict['health_monitor'] = self.health_monitor.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, 'instance_group') and self.instance_group is not None: - _dict['instance_group'] = self.instance_group.to_dict() + if isinstance(self.instance_group, dict): + _dict['instance_group'] = self.instance_group + else: + _dict['instance_group'] = self.instance_group.to_dict() if hasattr(self, 'members') and self.members is not None: - _dict['members'] = [x.to_dict() for x in self.members] + members_list = [] + for v in self.members: + if isinstance(v, dict): + members_list.append(v) + else: + members_list.append(v.to_dict()) + _dict['members'] = members_list if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'protocol') and self.protocol is not None: @@ -44687,7 +46511,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'proxy_protocol') and self.proxy_protocol is not None: _dict['proxy_protocol'] = self.proxy_protocol if hasattr(self, 'session_persistence') and self.session_persistence is not None: - _dict['session_persistence'] = self.session_persistence.to_dict() + if isinstance(self.session_persistence, dict): + _dict['session_persistence'] = self.session_persistence + else: + _dict['session_persistence'] = self.session_persistence.to_dict() return _dict def _to_dict(self): @@ -44781,7 +46608,7 @@ def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolCollection': """Initialize a LoadBalancerPoolCollection object from a json dictionary.""" args = {} if 'pools' in _dict: - args['pools'] = [LoadBalancerPool.from_dict(x) for x in _dict.get('pools')] + args['pools'] = [LoadBalancerPool.from_dict(v) for v in _dict.get('pools')] else: raise ValueError('Required property \'pools\' not present in LoadBalancerPoolCollection JSON') return cls(**args) @@ -44795,7 +46622,13 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'pools') and self.pools is not None: - _dict['pools'] = [x.to_dict() for x in self.pools] + pools_list = [] + for v in self.pools: + if isinstance(v, dict): + pools_list.append(v) + else: + pools_list.append(v.to_dict()) + _dict['pools'] = pools_list return _dict def _to_dict(self): @@ -45217,7 +47050,8 @@ class LoadBalancerPoolIdentityByName(): """ LoadBalancerPoolIdentityByName. - :attr str name: The user-defined name for this load balancer pool. + :attr str name: The name for this load balancer pool. The name is unique across + all pools for the load balancer. """ def __init__(self, @@ -45225,7 +47059,8 @@ def __init__(self, """ Initialize a LoadBalancerPoolIdentityByName object. - :param str name: The user-defined name for this load balancer pool. + :param str name: The name for this load balancer pool. The name is unique + across all pools for the load balancer. """ self.name = name @@ -45477,7 +47312,7 @@ def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolMemberCollection': """Initialize a LoadBalancerPoolMemberCollection object from a json dictionary.""" args = {} if 'members' in _dict: - args['members'] = [LoadBalancerPoolMember.from_dict(x) for x in _dict.get('members')] + args['members'] = [LoadBalancerPoolMember.from_dict(v) for v in _dict.get('members')] else: raise ValueError('Required property \'members\' not present in LoadBalancerPoolMemberCollection JSON') return cls(**args) @@ -45491,7 +47326,13 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'members') and self.members is not None: - _dict['members'] = [x.to_dict() for x in self.members] + members_list = [] + for v in self.members: + if isinstance(v, dict): + members_list.append(v) + else: + members_list.append(v.to_dict()) + _dict['members'] = members_list return _dict def _to_dict(self): @@ -45782,7 +47623,10 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -45907,7 +47751,8 @@ class LoadBalancerPoolPatch(): :attr str algorithm: (optional) The load balancing algorithm. :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 name: (optional) The name for this load balancer pool. The name must + not be used by another pool for the load balancer. :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 @@ -45940,8 +47785,8 @@ def __init__(self, :param str algorithm: (optional) The load balancing algorithm. :param LoadBalancerPoolHealthMonitorPatch health_monitor: (optional) The health monitor of this pool. - :param str name: (optional) The user-defined name for this load balancer - pool. + :param str name: (optional) The name for this load balancer pool. The name + must not be used by another pool for the load balancer. :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 @@ -45996,7 +47841,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'algorithm') and self.algorithm is not None: _dict['algorithm'] = self.algorithm if hasattr(self, 'health_monitor') and self.health_monitor is not None: - _dict['health_monitor'] = self.health_monitor.to_dict() + if isinstance(self.health_monitor, dict): + _dict['health_monitor'] = self.health_monitor + else: + _dict['health_monitor'] = self.health_monitor.to_dict() if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'protocol') and self.protocol is not None: @@ -46004,7 +47852,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'proxy_protocol') and self.proxy_protocol is not None: _dict['proxy_protocol'] = self.proxy_protocol if hasattr(self, 'session_persistence') and self.session_persistence is not None: - _dict['session_persistence'] = self.session_persistence.to_dict() + if isinstance(self.session_persistence, dict): + _dict['session_persistence'] = self.session_persistence + else: + _dict['session_persistence'] = self.session_persistence.to_dict() return _dict def _to_dict(self): @@ -46075,8 +47926,9 @@ class LoadBalancerPoolPrototype(): this load balancer pool. For load balancers in the `network` family, the same `port` and `target` tuple cannot be shared by a pool member of any other load balancer in the same VPC. - :attr str name: (optional) The user-defined name for this load balancer pool. If - unspecified, the name will be a hyphenated list of randomly-selected words. + :attr str name: (optional) The name for this load balancer pool. The name must + not be used by another pool for the load balancer. If unspecified, the name will + be a hyphenated list of randomly-selected words. :attr str protocol: The protocol used for this load balancer pool. Load balancers in the `network` family support `tcp` and `udp` (if `udp_supported` is `true`). Load balancers in the @@ -46114,9 +47966,9 @@ def __init__(self, members for this load balancer pool. For load balancers in the `network` family, the same `port` and `target` tuple cannot be shared by a pool member of any other load balancer in the same VPC. - :param str name: (optional) The user-defined name for this load balancer - pool. If unspecified, the name will be a hyphenated list of - randomly-selected words. + :param str name: (optional) The name for this load balancer pool. The name + must not be used by another pool for the load balancer. If unspecified, the + name will be a hyphenated list of randomly-selected words. :param str proxy_protocol: (optional) The PROXY protocol setting for this pool: - `v1`: Enabled with version 1 (human-readable header format) @@ -46148,7 +48000,7 @@ def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolPrototype': else: raise ValueError('Required property \'health_monitor\' not present in LoadBalancerPoolPrototype JSON') if 'members' in _dict: - args['members'] = [LoadBalancerPoolMemberPrototype.from_dict(x) for x in _dict.get('members')] + args['members'] = [LoadBalancerPoolMemberPrototype.from_dict(v) for v in _dict.get('members')] if 'name' in _dict: args['name'] = _dict.get('name') if 'protocol' in _dict: @@ -46172,9 +48024,18 @@ def to_dict(self) -> Dict: if hasattr(self, 'algorithm') and self.algorithm is not None: _dict['algorithm'] = self.algorithm if hasattr(self, 'health_monitor') and self.health_monitor is not None: - _dict['health_monitor'] = self.health_monitor.to_dict() + if isinstance(self.health_monitor, dict): + _dict['health_monitor'] = self.health_monitor + else: + _dict['health_monitor'] = self.health_monitor.to_dict() if hasattr(self, 'members') and self.members is not None: - _dict['members'] = [x.to_dict() for x in self.members] + members_list = [] + for v in self.members: + if isinstance(v, dict): + members_list.append(v) + else: + members_list.append(v.to_dict()) + _dict['members'] = members_list if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'protocol') and self.protocol is not None: @@ -46182,7 +48043,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'proxy_protocol') and self.proxy_protocol is not None: _dict['proxy_protocol'] = self.proxy_protocol if hasattr(self, 'session_persistence') and self.session_persistence is not None: - _dict['session_persistence'] = self.session_persistence.to_dict() + if isinstance(self.session_persistence, dict): + _dict['session_persistence'] = self.session_persistence + else: + _dict['session_persistence'] = self.session_persistence.to_dict() return _dict def _to_dict(self): @@ -46248,7 +48112,8 @@ class LoadBalancerPoolReference(): some supplementary information. :attr str href: The pool's canonical URL. :attr str id: The unique identifier for this load balancer pool. - :attr str name: The user-defined name for this load balancer pool. + :attr str name: The name for this load balancer pool. The name is unique across + all pools for the load balancer. """ def __init__(self, @@ -46262,7 +48127,8 @@ 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 name: The name for this load balancer pool. The name is unique + across all pools for the load balancer. :param LoadBalancerPoolReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and provides @@ -46302,7 +48168,10 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -46644,7 +48513,8 @@ class LoadBalancerPrivateIpsItem(): some supplementary information. :attr str href: The URL for this reserved IP. :attr str id: The unique identifier for this reserved IP. - :attr str name: The user-defined or system-provided name for this reserved IP. + :attr str name: The name for this reserved IP. The name is unique across all + reserved IPs in a subnet. :attr str resource_type: The resource type. """ @@ -46668,8 +48538,8 @@ def __init__(self, address format was encountered. :param str href: The URL for this reserved IP. :param str id: The unique identifier for this reserved IP. - :param str name: The user-defined or system-provided name for this reserved - IP. + :param str name: The name for this reserved IP. The name is unique across + all reserved IPs in a subnet. :param str resource_type: The resource type. :param ReservedIPReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and provides @@ -46721,7 +48591,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'address') and self.address is not None: _dict['address'] = self.address if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -46848,7 +48721,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'logging_supported') and self.logging_supported is not None: - _dict['logging_supported'] = self.logging_supported.to_dict() + if isinstance(self.logging_supported, dict): + _dict['logging_supported'] = self.logging_supported + else: + _dict['logging_supported'] = self.logging_supported.to_dict() if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'route_mode_supported') and self.route_mode_supported is not None: @@ -46943,7 +48819,7 @@ def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileCollection': if 'next' in _dict: args['next'] = LoadBalancerProfileCollectionNext.from_dict(_dict.get('next')) if 'profiles' in _dict: - args['profiles'] = [LoadBalancerProfile.from_dict(x) for x in _dict.get('profiles')] + args['profiles'] = [LoadBalancerProfile.from_dict(v) for v in _dict.get('profiles')] else: raise ValueError('Required property \'profiles\' not present in LoadBalancerProfileCollection JSON') if 'total_count' in _dict: @@ -46961,13 +48837,25 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'first') and self.first is not None: - _dict['first'] = self.first.to_dict() + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit if hasattr(self, 'next') and self.next is not None: - _dict['next'] = self.next.to_dict() + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() if hasattr(self, 'profiles') and self.profiles is not None: - _dict['profiles'] = [x.to_dict() for x in self.profiles] + profiles_list = [] + for v in self.profiles: + if isinstance(v, dict): + profiles_list.append(v) + else: + profiles_list.append(v.to_dict()) + _dict['profiles'] = profiles_list if hasattr(self, 'total_count') and self.total_count is not None: _dict['total_count'] = self.total_count return _dict @@ -47472,7 +49360,8 @@ class NetworkACL(): :attr str crn: The CRN for this network ACL. :attr str href: The URL for this network ACL. :attr str id: The unique identifier for this network ACL. - :attr str name: The user-defined name for this network ACL. + :attr str name: The name for this network ACL. The name is unique across all + network ACLs for the VPC. :attr ResourceGroupReference resource_group: The resource group for this network ACL. :attr List[NetworkACLRuleItem] rules: The ordered rules for this network ACL. If @@ -47500,7 +49389,8 @@ def __init__(self, :param str crn: The CRN for this network ACL. :param str href: The URL for this network ACL. :param str id: The unique identifier for this network ACL. - :param str name: The user-defined name for this network ACL. + :param str name: The name for this network ACL. The name is unique across + all network ACLs for the VPC. :param ResourceGroupReference resource_group: The resource group for this network ACL. :param List[NetworkACLRuleItem] rules: The ordered rules for this network @@ -47548,11 +49438,11 @@ def from_dict(cls, _dict: Dict) -> 'NetworkACL': else: raise ValueError('Required property \'resource_group\' not present in NetworkACL JSON') if 'rules' in _dict: - args['rules'] = [NetworkACLRuleItem.from_dict(x) for x in _dict.get('rules')] + args['rules'] = [NetworkACLRuleItem.from_dict(v) for v in _dict.get('rules')] else: raise ValueError('Required property \'rules\' not present in NetworkACL JSON') if 'subnets' in _dict: - args['subnets'] = [SubnetReference.from_dict(x) for x in _dict.get('subnets')] + args['subnets'] = [SubnetReference.from_dict(v) for v in _dict.get('subnets')] else: raise ValueError('Required property \'subnets\' not present in NetworkACL JSON') if 'vpc' in _dict: @@ -47580,13 +49470,31 @@ def to_dict(self) -> Dict: if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'resource_group') and self.resource_group is not None: - _dict['resource_group'] = self.resource_group.to_dict() + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() if hasattr(self, 'rules') and self.rules is not None: - _dict['rules'] = [x.to_dict() for x in self.rules] + rules_list = [] + for v in self.rules: + if isinstance(v, dict): + rules_list.append(v) + else: + rules_list.append(v.to_dict()) + _dict['rules'] = rules_list if hasattr(self, 'subnets') and self.subnets is not None: - _dict['subnets'] = [x.to_dict() for x in self.subnets] + subnets_list = [] + for v in self.subnets: + if isinstance(v, dict): + subnets_list.append(v) + else: + subnets_list.append(v.to_dict()) + _dict['subnets'] = subnets_list if hasattr(self, 'vpc') and self.vpc is not None: - _dict['vpc'] = self.vpc.to_dict() + if isinstance(self.vpc, dict): + _dict['vpc'] = self.vpc + else: + _dict['vpc'] = self.vpc.to_dict() return _dict def _to_dict(self): @@ -47660,7 +49568,7 @@ def from_dict(cls, _dict: Dict) -> 'NetworkACLCollection': else: raise ValueError('Required property \'limit\' not present in NetworkACLCollection JSON') if 'network_acls' in _dict: - args['network_acls'] = [NetworkACL.from_dict(x) for x in _dict.get('network_acls')] + args['network_acls'] = [NetworkACL.from_dict(v) for v in _dict.get('network_acls')] else: raise ValueError('Required property \'network_acls\' not present in NetworkACLCollection JSON') if 'next' in _dict: @@ -47680,13 +49588,25 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'first') and self.first is not None: - _dict['first'] = self.first.to_dict() + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit if hasattr(self, 'network_acls') and self.network_acls is not None: - _dict['network_acls'] = [x.to_dict() for x in self.network_acls] + network_acls_list = [] + for v in self.network_acls: + if isinstance(v, dict): + network_acls_list.append(v) + else: + network_acls_list.append(v.to_dict()) + _dict['network_acls'] = network_acls_list if hasattr(self, 'next') and self.next is not None: - _dict['next'] = self.next.to_dict() + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() if hasattr(self, 'total_count') and self.total_count is not None: _dict['total_count'] = self.total_count return _dict @@ -47841,8 +49761,8 @@ class NetworkACLPatch(): """ NetworkACLPatch. - :attr str name: (optional) The user-defined name for this network ACL. Names - must be unique within the VPC the network ACL resides in. + :attr str name: (optional) The name for this network ACL. The name must not be + used by another network ACL for the VPC. """ def __init__(self, @@ -47851,8 +49771,8 @@ def __init__(self, """ Initialize a NetworkACLPatch object. - :param str name: (optional) The user-defined name for this network ACL. - Names must be unique within the VPC the network ACL resides in. + :param str name: (optional) The name for this network ACL. The name must + not be used by another network ACL for the VPC. """ self.name = name @@ -47898,9 +49818,9 @@ class NetworkACLPrototype(): """ NetworkACLPrototype. - :attr 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. + :attr str name: (optional) The name for this network ACL. The name must not be + used by another network ACL for the VPC. If unspecified, the name will be a + hyphenated list of randomly-selected words. :attr ResourceGroupIdentity resource_group: (optional) The resource group to use. If unspecified, the account's [default resource group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. @@ -47916,9 +49836,9 @@ def __init__(self, Initialize a NetworkACLPrototype object. :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. + :param str name: (optional) The name for this network ACL. The name must + not be used by another network ACL for the VPC. If unspecified, the name + will be a hyphenated list of randomly-selected words. :param ResourceGroupIdentity resource_group: (optional) The resource group to use. If unspecified, the account's [default resource group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is @@ -47938,7 +49858,8 @@ class NetworkACLReference(): some supplementary information. :attr str href: The URL for this network ACL. :attr str id: The unique identifier for this network ACL. - :attr str name: The user-defined name for this network ACL. + :attr str name: The name for this network ACL. The name is unique across all + network ACLs for the VPC. """ def __init__(self, @@ -47954,7 +49875,8 @@ def __init__(self, :param str crn: The CRN for this network ACL. :param str href: The URL for this network ACL. :param str id: The unique identifier for this network ACL. - :param str name: The user-defined name for this network ACL. + :param str name: The name for this network ACL. The name is unique across + all network ACLs for the VPC. :param NetworkACLReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and provides some supplementary information. @@ -48000,7 +49922,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'crn') and self.crn is not None: _dict['crn'] = self.crn if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -48098,7 +50023,8 @@ class NetworkACLRule(): :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 network ACL rule. + :attr str name: The name for this network ACL rule. The name is unique across + all rules for the network ACL. :attr str protocol: The protocol to enforce. :attr str source: The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. @@ -48128,7 +50054,8 @@ def __init__(self, :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 network ACL rule. + :param str name: The name for this network ACL rule. The name is unique + across all rules for the network ACL. :param str protocol: The protocol to enforce. :param str source: The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. @@ -48296,7 +50223,7 @@ def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleCollection': if 'next' in _dict: args['next'] = NetworkACLRuleCollectionNext.from_dict(_dict.get('next')) if 'rules' in _dict: - args['rules'] = [NetworkACLRuleItem.from_dict(x) for x in _dict.get('rules')] + args['rules'] = [NetworkACLRuleItem.from_dict(v) for v in _dict.get('rules')] else: raise ValueError('Required property \'rules\' not present in NetworkACLRuleCollection JSON') if 'total_count' in _dict: @@ -48314,13 +50241,25 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'first') and self.first is not None: - _dict['first'] = self.first.to_dict() + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit if hasattr(self, 'next') and self.next is not None: - _dict['next'] = self.next.to_dict() + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() if hasattr(self, 'rules') and self.rules is not None: - _dict['rules'] = [x.to_dict() for x in self.rules] + rules_list = [] + for v in self.rules: + if isinstance(v, dict): + rules_list.append(v) + else: + rules_list.append(v.to_dict()) + _dict['rules'] = rules_list if hasattr(self, 'total_count') and self.total_count is not None: _dict['total_count'] = self.total_count return _dict @@ -48471,7 +50410,8 @@ class NetworkACLRuleItem(): :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 network ACL rule. + :attr str name: The name for this network ACL rule. The name is unique across + all rules for the network ACL. :attr str protocol: The protocol to enforce. :attr str source: The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. @@ -48501,7 +50441,8 @@ def __init__(self, :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 network ACL rule. + :param str name: The name for this network ACL rule. The name is unique + across all rules for the network ACL. :param str protocol: The protocol to enforce. :param str source: The source IP address or CIDR block to match. The CIDR block `0.0.0.0/0` matches all source addresses. @@ -48599,8 +50540,8 @@ class NetworkACLRulePatch(): :attr int destination_port_min: (optional) The inclusive lower bound of TCP/UDP destination port range. :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 name: (optional) The name for this network ACL rule. The name must not + be used by another rule for the network ACL. :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. @@ -48642,8 +50583,8 @@ def __init__(self, :param int destination_port_min: (optional) The inclusive lower bound of TCP/UDP destination port range. :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 name: (optional) The name for this network ACL rule. The name + must not be used by another rule for the network ACL. :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. @@ -48793,9 +50734,9 @@ class NetworkACLRulePrototype(): :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 name: (optional) The name for this network ACL rule. The name must not + be used by another rule for the network ACL. 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 to match. The CIDR block `0.0.0.0/0` matches all source addresses. @@ -48823,8 +50764,8 @@ def __init__(self, :param NetworkACLRuleBeforePrototype before: (optional) The rule to insert 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 + :param str name: (optional) The name for this network ACL rule. The name + must not be used by another rule for the network ACL. 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( @@ -48900,9 +50841,9 @@ class NetworkACLRulePrototypeNetworkACLContext(): :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 name: (optional) The name for this network ACL rule. The name must not + be used by another rule for the network ACL. 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 to match. The CIDR block `0.0.0.0/0` matches all source addresses. @@ -48926,8 +50867,8 @@ def __init__(self, :param str protocol: The protocol to enforce. :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 + :param str name: (optional) The name for this network ACL rule. The name + must not be used by another rule for the network ACL. 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( @@ -49004,7 +50945,8 @@ class NetworkACLRuleReference(): some supplementary information. :attr str href: The URL for this network ACL rule. :attr str id: The unique identifier for this network ACL rule. - :attr str name: The user-defined name for this network ACL rule. + :attr str name: The name for this network ACL rule. The name is unique across + all rules for the network ACL. """ def __init__(self, @@ -49018,7 +50960,8 @@ def __init__(self, :param str href: The URL for this network ACL rule. :param str id: The unique identifier for this network ACL rule. - :param str name: The user-defined name for this network ACL rule. + :param str name: The name for this network ACL rule. The name is unique + across all rules for the network ACL. :param NetworkACLRuleReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and provides some supplementary information. @@ -49057,7 +51000,10 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -49154,7 +51100,7 @@ class NetworkInterface(): 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 name: The user-defined name for this network interface. + :attr str name: The 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. @@ -49190,7 +51136,7 @@ def __init__(self, was created. :param str href: The URL for this network interface. :param str id: The unique identifier for this network interface. - :param str name: The user-defined name for this network interface. + :param str name: The 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. @@ -49230,7 +51176,7 @@ def from_dict(cls, _dict: Dict) -> 'NetworkInterface': else: raise ValueError('Required property \'created_at\' not present in NetworkInterface JSON') if 'floating_ips' in _dict: - args['floating_ips'] = [FloatingIPReference.from_dict(x) for x in _dict.get('floating_ips')] + args['floating_ips'] = [FloatingIPReference.from_dict(v) for v in _dict.get('floating_ips')] if 'href' in _dict: args['href'] = _dict.get('href') else: @@ -49256,7 +51202,7 @@ def from_dict(cls, _dict: Dict) -> 'NetworkInterface': else: raise ValueError('Required property \'resource_type\' not present in NetworkInterface JSON') if 'security_groups' in _dict: - args['security_groups'] = [SecurityGroupReference.from_dict(x) for x in _dict.get('security_groups')] + args['security_groups'] = [SecurityGroupReference.from_dict(v) for v in _dict.get('security_groups')] else: raise ValueError('Required property \'security_groups\' not present in NetworkInterface JSON') if 'status' in _dict: @@ -49286,7 +51232,13 @@ def to_dict(self) -> 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, 'floating_ips') and self.floating_ips is not None: - _dict['floating_ips'] = [x.to_dict() for x in self.floating_ips] + floating_ips_list = [] + for v in self.floating_ips: + if isinstance(v, dict): + floating_ips_list.append(v) + else: + floating_ips_list.append(v.to_dict()) + _dict['floating_ips'] = floating_ips_list if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -49296,15 +51248,27 @@ def to_dict(self) -> Dict: 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 isinstance(self.primary_ip, dict): + _dict['primary_ip'] = self.primary_ip + else: + _dict['primary_ip'] = self.primary_ip.to_dict() if hasattr(self, 'resource_type') and self.resource_type is not None: _dict['resource_type'] = self.resource_type if hasattr(self, 'security_groups') and self.security_groups is not None: - _dict['security_groups'] = [x.to_dict() for x in self.security_groups] + security_groups_list = [] + for v in self.security_groups: + if isinstance(v, dict): + security_groups_list.append(v) + else: + security_groups_list.append(v.to_dict()) + _dict['security_groups'] = security_groups_list if hasattr(self, '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 isinstance(self.subnet, dict): + _dict['subnet'] = self.subnet + else: + _dict['subnet'] = self.subnet.to_dict() if hasattr(self, 'type') and self.type is not None: _dict['type'] = self.type return _dict @@ -49362,7 +51326,7 @@ class NetworkInterfaceBareMetalServerContextReference(): some supplementary information. :attr str href: The URL for this network interface. :attr str id: The unique identifier for this network interface. - :attr str name: The user-defined name for this network interface. + :attr str name: The name for this network interface. :attr ReservedIPReference primary_ip: :attr str resource_type: The resource type. :attr SubnetReference subnet: The associated subnet. @@ -49382,7 +51346,7 @@ def __init__(self, :param str href: The URL for this network interface. :param str id: The unique identifier for this network interface. - :param str name: The user-defined name for this network interface. + :param str name: The name for this network interface. :param ReservedIPReference primary_ip: :param str resource_type: The resource type. :param SubnetReference subnet: The associated subnet. @@ -49440,7 +51404,10 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -49448,11 +51415,17 @@ def to_dict(self) -> Dict: 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: - _dict['primary_ip'] = self.primary_ip.to_dict() + if isinstance(self.primary_ip, dict): + _dict['primary_ip'] = self.primary_ip + else: + _dict['primary_ip'] = self.primary_ip.to_dict() if hasattr(self, 'resource_type') and self.resource_type is not None: _dict['resource_type'] = self.resource_type if hasattr(self, 'subnet') and self.subnet is not None: - _dict['subnet'] = self.subnet.to_dict() + if isinstance(self.subnet, dict): + _dict['subnet'] = self.subnet + else: + _dict['subnet'] = self.subnet.to_dict() return _dict def _to_dict(self): @@ -49562,7 +51535,7 @@ class NetworkInterfaceInstanceContextReference(): some supplementary information. :attr str href: The URL for this network interface. :attr str id: The unique identifier for this network interface. - :attr str name: The user-defined name for this network interface. + :attr str name: The name for this network interface. :attr ReservedIPReference primary_ip: :attr str resource_type: The resource type. :attr SubnetReference subnet: The associated subnet. @@ -49582,7 +51555,7 @@ def __init__(self, :param str href: The URL for this network interface. :param str id: The unique identifier for this network interface. - :param str name: The user-defined name for this network interface. + :param str name: The name for this network interface. :param ReservedIPReference primary_ip: :param str resource_type: The resource type. :param SubnetReference subnet: The associated subnet. @@ -49640,7 +51613,10 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -49648,11 +51624,17 @@ def to_dict(self) -> Dict: 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: - _dict['primary_ip'] = self.primary_ip.to_dict() + if isinstance(self.primary_ip, dict): + _dict['primary_ip'] = self.primary_ip + else: + _dict['primary_ip'] = self.primary_ip.to_dict() if hasattr(self, 'resource_type') and self.resource_type is not None: _dict['resource_type'] = self.resource_type if hasattr(self, 'subnet') and self.subnet is not None: - _dict['subnet'] = self.subnet.to_dict() + if isinstance(self.subnet, dict): + _dict['subnet'] = self.subnet + else: + _dict['subnet'] = self.subnet.to_dict() return _dict def _to_dict(self): @@ -49744,8 +51726,8 @@ class NetworkInterfacePatch(): :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 str name: (optional) The user-defined name for network interface. Names - must be unique within the instance the network interface resides in. + :attr str name: (optional) The name for network interface. The name must not be + used by another network interface on the virtual server instance. """ def __init__(self, @@ -49759,8 +51741,8 @@ def __init__(self, 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 str name: (optional) The user-defined name for network interface. - Names must be unique within the instance the network interface resides in. + :param str name: (optional) The name for network interface. The name must + not be used by another network interface on the virtual server instance. """ self.allow_ip_spoofing = allow_ip_spoofing self.name = name @@ -49814,8 +51796,8 @@ class NetworkInterfacePrototype(): :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 str name: (optional) The user-defined name for network interface. Names - must be unique within the instance the network interface resides in. If + :attr str name: (optional) The name for network interface. The name must not be + used by another network interface on the virtual server instance. 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 @@ -49846,10 +51828,9 @@ def __init__(self, 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 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 str name: (optional) The name for network interface. The name must + not be used by another network interface on the virtual server instance. 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. @@ -49905,11 +51886,11 @@ def to_dict(self) -> Dict: _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) + for v in self.security_groups: + if isinstance(v, dict): + security_groups_list.append(v) else: - security_groups_list.append(x.to_dict()) + security_groups_list.append(v.to_dict()) _dict['security_groups'] = security_groups_list if hasattr(self, 'subnet') and self.subnet is not None: if isinstance(self.subnet, dict): @@ -50073,7 +52054,7 @@ def from_dict(cls, _dict: Dict) -> 'NetworkInterfaceUnpaginatedCollection': """Initialize a NetworkInterfaceUnpaginatedCollection object from a json dictionary.""" args = {} if 'network_interfaces' in _dict: - args['network_interfaces'] = [NetworkInterface.from_dict(x) for x in _dict.get('network_interfaces')] + args['network_interfaces'] = [NetworkInterface.from_dict(v) for v in _dict.get('network_interfaces')] else: raise ValueError('Required property \'network_interfaces\' not present in NetworkInterfaceUnpaginatedCollection JSON') return cls(**args) @@ -50087,7 +52068,13 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'network_interfaces') and self.network_interfaces is not None: - _dict['network_interfaces'] = [x.to_dict() for x in self.network_interfaces] + network_interfaces_list = [] + for v in self.network_interfaces: + if isinstance(v, dict): + network_interfaces_list.append(v) + else: + network_interfaces_list.append(v.to_dict()) + _dict['network_interfaces'] = network_interfaces_list return _dict def _to_dict(self): @@ -50291,7 +52278,7 @@ def from_dict(cls, _dict: Dict) -> 'OperatingSystemCollection': if 'next' in _dict: args['next'] = OperatingSystemCollectionNext.from_dict(_dict.get('next')) if 'operating_systems' in _dict: - args['operating_systems'] = [OperatingSystem.from_dict(x) for x in _dict.get('operating_systems')] + args['operating_systems'] = [OperatingSystem.from_dict(v) for v in _dict.get('operating_systems')] else: raise ValueError('Required property \'operating_systems\' not present in OperatingSystemCollection JSON') return cls(**args) @@ -50305,13 +52292,25 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'first') and self.first is not None: - _dict['first'] = self.first.to_dict() + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit if hasattr(self, 'next') and self.next is not None: - _dict['next'] = self.next.to_dict() + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() if hasattr(self, 'operating_systems') and self.operating_systems is not None: - _dict['operating_systems'] = [x.to_dict() for x in self.operating_systems] + operating_systems_list = [] + for v in self.operating_systems: + if isinstance(v, dict): + operating_systems_list.append(v) + else: + operating_systems_list.append(v.to_dict()) + _dict['operating_systems'] = operating_systems_list return _dict def _to_dict(self): @@ -50536,7 +52535,8 @@ class PlacementGroup(): :attr str href: The URL for this placement group. :attr str id: The unique identifier for this placement group. :attr str lifecycle_state: The lifecycle state of the placement group. - :attr str name: The user-defined name for this placement group. + :attr str name: The name for this placement group. The name is unique across all + placement groups in the region. :attr ResourceGroupReference resource_group: The resource group for this placement group. :attr str resource_type: The resource type. @@ -50568,7 +52568,8 @@ def __init__(self, :param str href: The URL for this placement group. :param str id: The unique identifier for this placement group. :param str lifecycle_state: The lifecycle state of the placement group. - :param str name: The user-defined name for this placement group. + :param str name: The name for this placement group. The name is unique + across all placement groups in the region. :param ResourceGroupReference resource_group: The resource group for this placement group. :param str resource_type: The resource type. @@ -50653,7 +52654,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'resource_group') and self.resource_group is not None: - _dict['resource_group'] = self.resource_group.to_dict() + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() if hasattr(self, 'resource_type') and self.resource_type is not None: _dict['resource_type'] = self.resource_type if hasattr(self, 'strategy') and self.strategy is not None: @@ -50769,7 +52773,7 @@ def from_dict(cls, _dict: Dict) -> 'PlacementGroupCollection': if 'next' in _dict: args['next'] = PlacementGroupCollectionNext.from_dict(_dict.get('next')) if 'placement_groups' in _dict: - args['placement_groups'] = [PlacementGroup.from_dict(x) for x in _dict.get('placement_groups')] + args['placement_groups'] = [PlacementGroup.from_dict(v) for v in _dict.get('placement_groups')] else: raise ValueError('Required property \'placement_groups\' not present in PlacementGroupCollection JSON') if 'total_count' in _dict: @@ -50787,13 +52791,25 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'first') and self.first is not None: - _dict['first'] = self.first.to_dict() + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit if hasattr(self, 'next') and self.next is not None: - _dict['next'] = self.next.to_dict() + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() if hasattr(self, 'placement_groups') and self.placement_groups is not None: - _dict['placement_groups'] = [x.to_dict() for x in self.placement_groups] + placement_groups_list = [] + for v in self.placement_groups: + if isinstance(v, dict): + placement_groups_list.append(v) + else: + placement_groups_list.append(v.to_dict()) + _dict['placement_groups'] = placement_groups_list if hasattr(self, 'total_count') and self.total_count is not None: _dict['total_count'] = self.total_count return _dict @@ -50933,7 +52949,8 @@ class PlacementGroupPatch(): """ PlacementGroupPatch. - :attr str name: (optional) The user-defined name for this placement group. + :attr str name: (optional) The name for this placement group. The name must not + be used by another placement group in the region. """ def __init__(self, @@ -50942,7 +52959,8 @@ def __init__(self, """ Initialize a PlacementGroupPatch object. - :param str name: (optional) The user-defined name for this placement group. + :param str name: (optional) The name for this placement group. The name + must not be used by another placement group in the region. """ self.name = name @@ -51052,7 +53070,8 @@ class PublicGateway(): gateway. :attr str href: The URL for this public gateway. :attr str id: The unique identifier for this public gateway. - :attr str name: The user-defined name for this public gateway. + :attr str name: The name for this public gateway. The name is unique across all + public gateways in the VPC. :attr ResourceGroupReference resource_group: The resource group for this public gateway. :attr str resource_type: The resource type. @@ -51083,7 +53102,8 @@ def __init__(self, public gateway. :param str href: The URL for this public gateway. :param str id: The unique identifier for this public gateway. - :param str name: The user-defined name for this public gateway. + :param str name: The name for this public gateway. The name is unique + across all public gateways in the VPC. :param ResourceGroupReference resource_group: The resource group for this public gateway. :param str resource_type: The resource type. @@ -51166,7 +53186,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'crn') and self.crn is not None: _dict['crn'] = self.crn if hasattr(self, 'floating_ip') and self.floating_ip is not None: - _dict['floating_ip'] = self.floating_ip.to_dict() + if isinstance(self.floating_ip, dict): + _dict['floating_ip'] = self.floating_ip + else: + _dict['floating_ip'] = self.floating_ip.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: @@ -51174,15 +53197,24 @@ def to_dict(self) -> Dict: if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'resource_group') and self.resource_group is not None: - _dict['resource_group'] = self.resource_group.to_dict() + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() if hasattr(self, 'resource_type') and self.resource_type is not None: _dict['resource_type'] = self.resource_type if hasattr(self, 'status') and self.status is not None: _dict['status'] = self.status if hasattr(self, 'vpc') and self.vpc is not None: - _dict['vpc'] = self.vpc.to_dict() + if isinstance(self.vpc, dict): + _dict['vpc'] = self.vpc + else: + _dict['vpc'] = self.vpc.to_dict() if hasattr(self, 'zone') and self.zone is not None: - _dict['zone'] = self.zone.to_dict() + if isinstance(self.zone, dict): + _dict['zone'] = self.zone + else: + _dict['zone'] = self.zone.to_dict() return _dict def _to_dict(self): @@ -51275,7 +53307,7 @@ def from_dict(cls, _dict: Dict) -> 'PublicGatewayCollection': if 'next' in _dict: args['next'] = PublicGatewayCollectionNext.from_dict(_dict.get('next')) if 'public_gateways' in _dict: - args['public_gateways'] = [PublicGateway.from_dict(x) for x in _dict.get('public_gateways')] + args['public_gateways'] = [PublicGateway.from_dict(v) for v in _dict.get('public_gateways')] else: raise ValueError('Required property \'public_gateways\' not present in PublicGatewayCollection JSON') if 'total_count' in _dict: @@ -51293,13 +53325,25 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'first') and self.first is not None: - _dict['first'] = self.first.to_dict() + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit if hasattr(self, 'next') and self.next is not None: - _dict['next'] = self.next.to_dict() + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() if hasattr(self, 'public_gateways') and self.public_gateways is not None: - _dict['public_gateways'] = [x.to_dict() for x in self.public_gateways] + public_gateways_list = [] + for v in self.public_gateways: + if isinstance(v, dict): + public_gateways_list.append(v) + else: + public_gateways_list.append(v.to_dict()) + _dict['public_gateways'] = public_gateways_list if hasattr(self, 'total_count') and self.total_count is not None: _dict['total_count'] = self.total_count return _dict @@ -51461,7 +53505,8 @@ class PublicGatewayFloatingIp(): some supplementary information. :attr str href: The URL for this floating IP. :attr str id: The unique identifier for this floating IP. - :attr str name: The unique user-defined name for this floating IP. + :attr str name: The name for this floating IP. The name is unique across all + floating IPs in the region. """ def __init__(self, @@ -51479,7 +53524,8 @@ def __init__(self, :param str crn: The CRN for this floating IP. :param str href: The URL for this floating IP. :param str id: The unique identifier for this floating IP. - :param str name: The unique user-defined name for this floating IP. + :param str name: The name for this floating IP. The name is unique across + all floating IPs in the region. :param FloatingIPReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and provides some supplementary information. @@ -51532,7 +53578,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'crn') and self.crn is not None: _dict['crn'] = self.crn if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -51578,8 +53627,8 @@ class PublicGatewayPatch(): """ PublicGatewayPatch. - :attr str name: (optional) The user-defined name for this public gateway. Names - must be unique within the VPC the public gateway resides in. + :attr str name: (optional) The name for this public gateway. The name must not + be used by another public gateway in the VPC. """ def __init__(self, @@ -51588,8 +53637,8 @@ def __init__(self, """ Initialize a PublicGatewayPatch object. - :param str name: (optional) The user-defined name for this public gateway. - Names must be unique within the VPC the public gateway resides in. + :param str name: (optional) The name for this public gateway. The name must + not be used by another public gateway in the VPC. """ self.name = name @@ -51641,7 +53690,8 @@ class PublicGatewayReference(): some supplementary information. :attr str href: The URL for this public gateway. :attr str id: The unique identifier for this public gateway. - :attr str name: The user-defined name for this public gateway. + :attr str name: The name for this public gateway. The name is unique across all + public gateways in the VPC. :attr str resource_type: The resource type. """ @@ -51659,7 +53709,8 @@ def __init__(self, :param str crn: The CRN for this public gateway. :param str href: The URL for this public gateway. :param str id: The unique identifier for this public gateway. - :param str name: The user-defined name for this public gateway. + :param str name: The name for this public gateway. The name is unique + across all public gateways in the VPC. :param str resource_type: The resource type. :param PublicGatewayReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and provides @@ -51711,7 +53762,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'crn') and self.crn is not None: _dict['crn'] = self.crn if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -51919,7 +53973,7 @@ def from_dict(cls, _dict: Dict) -> 'RegionCollection': """Initialize a RegionCollection object from a json dictionary.""" args = {} if 'regions' in _dict: - args['regions'] = [Region.from_dict(x) for x in _dict.get('regions')] + args['regions'] = [Region.from_dict(v) for v in _dict.get('regions')] else: raise ValueError('Required property \'regions\' not present in RegionCollection JSON') return cls(**args) @@ -51933,7 +53987,13 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'regions') and self.regions is not None: - _dict['regions'] = [x.to_dict() for x in self.regions] + regions_list = [] + for v in self.regions: + if isinstance(v, dict): + regions_list.append(v) + else: + regions_list.append(v.to_dict()) + _dict['regions'] = regions_list return _dict def _to_dict(self): @@ -52037,7 +54097,8 @@ class ReservedIP(): :attr str href: The URL for this reserved IP. :attr str id: The unique identifier for this reserved IP. :attr str lifecycle_state: The lifecycle state of the reserved IP. - :attr str name: The user-defined or system-provided name for this reserved IP. + :attr str name: The name for this reserved IP. The name is unique across all + reserved IPs in a subnet. :attr str owner: The owner of the reserved IP. :attr str resource_type: The resource type. :attr ReservedIPTarget target: (optional) The target this reserved IP is bound @@ -52075,8 +54136,8 @@ def __init__(self, :param str href: The URL for this reserved IP. :param str id: The unique identifier for this reserved IP. :param str lifecycle_state: The lifecycle state of the reserved IP. - :param str name: The user-defined or system-provided name for this reserved - IP. + :param str name: The name for this reserved IP. The name is unique across + all reserved IPs in a subnet. :param str owner: The owner of the reserved IP. :param str resource_type: The resource type. :param ReservedIPTarget target: (optional) The target this reserved IP is @@ -52273,7 +54334,7 @@ def from_dict(cls, _dict: Dict) -> 'ReservedIPCollection': if 'next' in _dict: args['next'] = ReservedIPCollectionNext.from_dict(_dict.get('next')) if 'reserved_ips' in _dict: - args['reserved_ips'] = [ReservedIP.from_dict(x) for x in _dict.get('reserved_ips')] + args['reserved_ips'] = [ReservedIP.from_dict(v) for v in _dict.get('reserved_ips')] else: raise ValueError('Required property \'reserved_ips\' not present in ReservedIPCollection JSON') if 'total_count' in _dict: @@ -52291,13 +54352,25 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'first') and self.first is not None: - _dict['first'] = self.first.to_dict() + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit if hasattr(self, 'next') and self.next is not None: - _dict['next'] = self.next.to_dict() + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() if hasattr(self, 'reserved_ips') and self.reserved_ips is not None: - _dict['reserved_ips'] = [x.to_dict() for x in self.reserved_ips] + reserved_ips_list = [] + for v in self.reserved_ips: + if isinstance(v, dict): + reserved_ips_list.append(v) + else: + reserved_ips_list.append(v.to_dict()) + _dict['reserved_ips'] = reserved_ips_list if hasattr(self, 'total_count') and self.total_count is not None: _dict['total_count'] = self.total_count return _dict @@ -52372,7 +54445,7 @@ def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionEndpointGatewayContext': else: raise ValueError('Required property \'first\' not present in ReservedIPCollectionEndpointGatewayContext JSON') if 'ips' in _dict: - args['ips'] = [ReservedIP.from_dict(x) for x in _dict.get('ips')] + args['ips'] = [ReservedIP.from_dict(v) for v in _dict.get('ips')] else: raise ValueError('Required property \'ips\' not present in ReservedIPCollectionEndpointGatewayContext JSON') if 'limit' in _dict: @@ -52396,13 +54469,25 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'first') and self.first is not None: - _dict['first'] = self.first.to_dict() + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() if hasattr(self, 'ips') and self.ips is not None: - _dict['ips'] = [x.to_dict() for x in self.ips] + ips_list = [] + for v in self.ips: + if isinstance(v, dict): + ips_list.append(v) + else: + ips_list.append(v.to_dict()) + _dict['ips'] = ips_list if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit if hasattr(self, 'next') and self.next is not None: - _dict['next'] = self.next.to_dict() + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() if hasattr(self, 'total_count') and self.total_count is not None: _dict['total_count'] = self.total_count return _dict @@ -52646,7 +54731,7 @@ def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionNetworkInterfaceContext' else: raise ValueError('Required property \'first\' not present in ReservedIPCollectionNetworkInterfaceContext JSON') if 'ips' in _dict: - args['ips'] = [ReservedIP.from_dict(x) for x in _dict.get('ips')] + args['ips'] = [ReservedIP.from_dict(v) for v in _dict.get('ips')] else: raise ValueError('Required property \'ips\' not present in ReservedIPCollectionNetworkInterfaceContext JSON') if 'limit' in _dict: @@ -52670,13 +54755,25 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'first') and self.first is not None: - _dict['first'] = self.first.to_dict() + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() if hasattr(self, 'ips') and self.ips is not None: - _dict['ips'] = [x.to_dict() for x in self.ips] + ips_list = [] + for v in self.ips: + if isinstance(v, dict): + ips_list.append(v) + else: + ips_list.append(v.to_dict()) + _dict['ips'] = ips_list if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit if hasattr(self, 'next') and self.next is not None: - _dict['next'] = self.next.to_dict() + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() if hasattr(self, 'total_count') and self.total_count is not None: _dict['total_count'] = self.total_count return _dict @@ -52877,9 +54974,9 @@ class ReservedIPPatch(): will be automatically deleted when either `target` is deleted, or the reserved IP is unbound. Must be `false` if the reserved IP is unbound. - :attr str name: (optional) The user-defined name for this reserved IP. Names - must be unique within the subnet the reserved IP resides in. Names beginning - with `ibm-` are reserved for provider-owned resources. + :attr str name: (optional) The name for this reserved IP. The name must not be + used by another reserved IP in the subnet. Names starting with `ibm-` are + reserved for provider-owned resources, and are not allowed. """ def __init__(self, @@ -52893,9 +54990,9 @@ def __init__(self, member will be automatically deleted when either `target` is deleted, or the reserved IP is unbound. Must be `false` if the reserved IP is unbound. - :param str name: (optional) The user-defined name for this reserved IP. - Names must be unique within the subnet the reserved IP resides in. Names - beginning with `ibm-` are reserved for provider-owned resources. + :param str name: (optional) The name for this reserved IP. The name must + not be used by another reserved IP in the subnet. Names starting with + `ibm-` are reserved for provider-owned resources, and are not allowed. """ self.auto_delete = auto_delete self.name = name @@ -52957,7 +55054,8 @@ class ReservedIPReference(): some supplementary information. :attr str href: The URL for this reserved IP. :attr str id: The unique identifier for this reserved IP. - :attr str name: The user-defined or system-provided name for this reserved IP. + :attr str name: The name for this reserved IP. The name is unique across all + reserved IPs in a subnet. :attr str resource_type: The resource type. """ @@ -52981,8 +55079,8 @@ def __init__(self, address format was encountered. :param str href: The URL for this reserved IP. :param str id: The unique identifier for this reserved IP. - :param str name: The user-defined or system-provided name for this reserved - IP. + :param str name: The name for this reserved IP. The name is unique across + all reserved IPs in a subnet. :param str resource_type: The resource type. :param ReservedIPReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and provides @@ -53034,7 +55132,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'address') and self.address is not None: _dict['address'] = self.address if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -53238,7 +55339,7 @@ class ResourceGroupReference(): :attr str href: The URL for this resource group. :attr str id: The unique identifier for this resource group. - :attr str name: The user-defined name for this resource group. + :attr str name: The name for this resource group. """ def __init__(self, @@ -53250,7 +55351,7 @@ def __init__(self, :param str href: The URL for this resource group. :param str id: The unique identifier for this resource group. - :param str name: The user-defined name for this resource group. + :param str name: The name for this resource group. """ self.href = href self.id = id @@ -53328,7 +55429,8 @@ class Route(): :attr str href: The URL for this route. :attr str id: The unique identifier for this route. :attr str lifecycle_state: The lifecycle state of the route. - :attr str name: The user-defined name for this route. + :attr str name: The name for this route. The name is unique across all routes in + the routing table. :attr RouteNextHop next_hop: If `action` is `deliver`, the next hop that packets will be delivered to. For other `action` values, its `address` will be `0.0.0.0`. @@ -53371,7 +55473,8 @@ def __init__(self, :param str href: The URL for this route. :param str id: The unique identifier for this route. :param str lifecycle_state: The lifecycle state of the route. - :param str name: The user-defined name for this route. + :param str name: The name for this route. The name is unique across all + routes in the routing table. :param RouteNextHop next_hop: If `action` is `deliver`, the next hop that packets will be delivered to. For other `action` values, its `address` will be `0.0.0.0`. @@ -53472,7 +55575,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'origin') and getattr(self, 'origin') is not None: _dict['origin'] = getattr(self, 'origin') if hasattr(self, 'zone') and self.zone is not None: - _dict['zone'] = self.zone.to_dict() + if isinstance(self.zone, dict): + _dict['zone'] = self.zone + else: + _dict['zone'] = self.zone.to_dict() return _dict def _to_dict(self): @@ -53589,7 +55695,7 @@ def from_dict(cls, _dict: Dict) -> 'RouteCollection': if 'next' in _dict: args['next'] = RouteCollectionNext.from_dict(_dict.get('next')) if 'routes' in _dict: - args['routes'] = [Route.from_dict(x) for x in _dict.get('routes')] + args['routes'] = [Route.from_dict(v) for v in _dict.get('routes')] else: raise ValueError('Required property \'routes\' not present in RouteCollection JSON') if 'total_count' in _dict: @@ -53607,13 +55713,25 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'first') and self.first is not None: - _dict['first'] = self.first.to_dict() + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit if hasattr(self, 'next') and self.next is not None: - _dict['next'] = self.next.to_dict() + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() if hasattr(self, 'routes') and self.routes is not None: - _dict['routes'] = [x.to_dict() for x in self.routes] + routes_list = [] + for v in self.routes: + if isinstance(v, dict): + routes_list.append(v) + else: + routes_list.append(v.to_dict()) + _dict['routes'] = routes_list if hasattr(self, 'total_count') and self.total_count is not None: _dict['total_count'] = self.total_count return _dict @@ -53785,8 +55903,9 @@ class RoutePatch(): """ RoutePatch. - :attr str name: (optional) The user-defined name for this route. Names must be - unique within the VPC routing table the route resides in. + :attr str name: (optional) The name for this route. The name must not be used by + another route in the routing table. Names starting with `ibm-` are reserved for + system-provided routes, and are not allowed. """ def __init__(self, @@ -53795,8 +55914,9 @@ def __init__(self, """ Initialize a RoutePatch object. - :param str name: (optional) The user-defined name for this route. Names - must be unique within the VPC routing table the route resides in. + :param str name: (optional) The name for this route. The name must not be + used by another route in the routing table. Names starting with `ibm-` are + reserved for system-provided routes, and are not allowed. """ self.name = name @@ -53852,9 +55972,10 @@ class RoutePrototype(): :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. - :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. + :attr str name: (optional) The name for this route. The name must not be used by + another route in the routing table. Names starting with `ibm-` are reserved for + system-provided routes, and are not allowed. If unspecified, the name will be a + hyphenated list of randomly-selected words. :attr RoutePrototypeNextHop next_hop: (optional) If `action` is `deliver`, the next hop that packets will be delivered to. For other `action` values, it must be omitted or specified as `0.0.0.0`. @@ -53886,9 +56007,10 @@ def __init__(self, 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 - 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. + :param str name: (optional) The name for this route. The name must not be + used by another route in the routing table. Names starting with `ibm-` are + reserved for system-provided routes, and are not allowed. If unspecified, + the name will be a hyphenated list of randomly-selected words. :param RoutePrototypeNextHop next_hop: (optional) If `action` is `deliver`, the next hop that packets will be delivered to. For other `action` values, it must be omitted or specified as `0.0.0.0`. @@ -54003,7 +56125,8 @@ class RouteReference(): some supplementary information. :attr str href: The URL for this route. :attr str id: The unique identifier for this route. - :attr str name: The user-defined name for this route. + :attr str name: The name for this route. The name is unique across all routes in + the routing table. """ def __init__(self, @@ -54017,7 +56140,8 @@ def __init__(self, :param str href: The URL for this route. :param str id: The unique identifier for this route. - :param str name: The user-defined name for this route. + :param str name: The name for this route. The name is unique across all + routes in the routing table. :param RouteReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and provides some supplementary information. @@ -54056,7 +56180,10 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -54156,7 +56283,8 @@ class RoutingTable(): :attr bool is_default: Indicates whether this is the default routing table for this VPC. :attr str lifecycle_state: The lifecycle state of the routing table. - :attr str name: The user-defined name for this routing table. + :attr str name: The name for this routing table. The name is unique across all + routing tables for the VPC. :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 @@ -54231,7 +56359,8 @@ def __init__(self, :param bool is_default: Indicates whether this is the default routing table for this VPC. :param str lifecycle_state: The lifecycle state of the routing table. - :param str name: The user-defined name for this routing table. + :param str name: The name for this routing table. The name is unique across + all routing tables for the VPC. :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 @@ -54298,7 +56427,7 @@ def from_dict(cls, _dict: Dict) -> 'RoutingTable': """Initialize a RoutingTable object from a json dictionary.""" args = {} if 'accept_routes_from' in _dict: - args['accept_routes_from'] = [ResourceFilter.from_dict(x) for x in _dict.get('accept_routes_from')] + args['accept_routes_from'] = [ResourceFilter.from_dict(v) for v in _dict.get('accept_routes_from')] else: raise ValueError('Required property \'accept_routes_from\' not present in RoutingTable JSON') if 'created_at' in _dict: @@ -54346,11 +56475,11 @@ def from_dict(cls, _dict: Dict) -> 'RoutingTable': else: raise ValueError('Required property \'route_vpc_zone_ingress\' not present in RoutingTable JSON') if 'routes' in _dict: - args['routes'] = [RouteReference.from_dict(x) for x in _dict.get('routes')] + args['routes'] = [RouteReference.from_dict(v) for v in _dict.get('routes')] else: raise ValueError('Required property \'routes\' not present in RoutingTable JSON') if 'subnets' in _dict: - args['subnets'] = [SubnetReference.from_dict(x) for x in _dict.get('subnets')] + args['subnets'] = [SubnetReference.from_dict(v) for v in _dict.get('subnets')] else: raise ValueError('Required property \'subnets\' not present in RoutingTable JSON') return cls(**args) @@ -54364,7 +56493,13 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'accept_routes_from') and self.accept_routes_from is not None: - _dict['accept_routes_from'] = [x.to_dict() for x in self.accept_routes_from] + accept_routes_from_list = [] + for v in self.accept_routes_from: + if isinstance(v, dict): + accept_routes_from_list.append(v) + else: + accept_routes_from_list.append(v.to_dict()) + _dict['accept_routes_from'] = accept_routes_from_list if hasattr(self, 'created_at') and self.created_at is not None: _dict['created_at'] = datetime_to_string(self.created_at) if hasattr(self, 'href') and self.href is not None: @@ -54388,9 +56523,21 @@ def to_dict(self) -> Dict: if hasattr(self, 'route_vpc_zone_ingress') and self.route_vpc_zone_ingress is not None: _dict['route_vpc_zone_ingress'] = self.route_vpc_zone_ingress if hasattr(self, 'routes') and self.routes is not None: - _dict['routes'] = [x.to_dict() for x in self.routes] + routes_list = [] + for v in self.routes: + if isinstance(v, dict): + routes_list.append(v) + else: + routes_list.append(v.to_dict()) + _dict['routes'] = routes_list if hasattr(self, 'subnets') and self.subnets is not None: - _dict['subnets'] = [x.to_dict() for x in self.subnets] + subnets_list = [] + for v in self.subnets: + if isinstance(v, dict): + subnets_list.append(v) + else: + subnets_list.append(v.to_dict()) + _dict['subnets'] = subnets_list return _dict def _to_dict(self): @@ -54486,7 +56633,7 @@ def from_dict(cls, _dict: Dict) -> 'RoutingTableCollection': if 'next' in _dict: args['next'] = RoutingTableCollectionNext.from_dict(_dict.get('next')) if 'routing_tables' in _dict: - args['routing_tables'] = [RoutingTable.from_dict(x) for x in _dict.get('routing_tables')] + args['routing_tables'] = [RoutingTable.from_dict(v) for v in _dict.get('routing_tables')] else: raise ValueError('Required property \'routing_tables\' not present in RoutingTableCollection JSON') if 'total_count' in _dict: @@ -54504,13 +56651,25 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'first') and self.first is not None: - _dict['first'] = self.first.to_dict() + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit if hasattr(self, 'next') and self.next is not None: - _dict['next'] = self.next.to_dict() + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() if hasattr(self, 'routing_tables') and self.routing_tables is not None: - _dict['routing_tables'] = [x.to_dict() for x in self.routing_tables] + routing_tables_list = [] + for v in self.routing_tables: + if isinstance(v, dict): + routing_tables_list.append(v) + else: + routing_tables_list.append(v.to_dict()) + _dict['routing_tables'] = routing_tables_list if hasattr(self, 'total_count') and self.total_count is not None: _dict['total_count'] = self.total_count return _dict @@ -54674,8 +56833,8 @@ class RoutingTablePatch(): 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. - :attr str name: (optional) The user-defined name for this routing table. Names - must be unique within the VPC the routing table resides in. + :attr str name: (optional) The name for this routing table. The name must not be + used by another routing table in the VPC. :attr bool route_direct_link_ingress: (optional) Indicates whether this routing table is used to route traffic that originates from [Direct Link](https://cloud.ibm.com/docs/dl/) to this VPC. Updating to `true` @@ -54756,8 +56915,8 @@ def __init__(self, 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. - :param str name: (optional) The user-defined name for this routing table. - Names must be unique within the VPC the routing table resides in. + :param str name: (optional) The name for this routing table. The name must + not be used by another routing table in the VPC. :param bool route_direct_link_ingress: (optional) Indicates whether this routing table is used to route traffic that originates from [Direct Link](https://cloud.ibm.com/docs/dl/) to this VPC. Updating to @@ -54829,7 +56988,7 @@ def from_dict(cls, _dict: Dict) -> 'RoutingTablePatch': """Initialize a RoutingTablePatch object from a json dictionary.""" args = {} if 'accept_routes_from' in _dict: - args['accept_routes_from'] = [ResourceFilter.from_dict(x) for x in _dict.get('accept_routes_from')] + args['accept_routes_from'] = [ResourceFilter.from_dict(v) for v in _dict.get('accept_routes_from')] if 'name' in _dict: args['name'] = _dict.get('name') if 'route_direct_link_ingress' in _dict: @@ -54851,7 +57010,13 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'accept_routes_from') and self.accept_routes_from is not None: - _dict['accept_routes_from'] = [x.to_dict() for x in self.accept_routes_from] + accept_routes_from_list = [] + for v in self.accept_routes_from: + if isinstance(v, dict): + accept_routes_from_list.append(v) + else: + accept_routes_from_list.append(v.to_dict()) + _dict['accept_routes_from'] = accept_routes_from_list if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'route_direct_link_ingress') and self.route_direct_link_ingress is not None: @@ -54891,7 +57056,8 @@ class RoutingTableReference(): some supplementary information. :attr str href: The URL for this routing table. :attr str id: The unique identifier for this routing table. - :attr str name: The user-defined name for this routing table. + :attr str name: The name for this routing table. The name is unique across all + routing tables for the VPC. :attr str resource_type: The resource type. """ @@ -54907,7 +57073,8 @@ def __init__(self, :param str href: The URL for this routing table. :param str id: The unique identifier for this routing table. - :param str name: The user-defined name for this routing table. + :param str name: The name for this routing table. The name is unique across + all routing tables for the VPC. :param str resource_type: The resource type. :param RoutingTableReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and provides @@ -54952,7 +57119,10 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -55054,8 +57224,8 @@ class SecurityGroup(): :attr str crn: The security group's CRN. :attr str href: The security group's canonical URL. :attr str id: The unique identifier for this security group. - :attr str name: The user-defined name for this security group. Names must be - unique within the VPC the security group resides in. + :attr str name: The name for this security group. The name is unique across all + security groups for the VPC. :attr ResourceGroupReference resource_group: The resource group for this security group. :attr List[SecurityGroupRule] rules: The rules for this security group. If no @@ -55083,8 +57253,8 @@ def __init__(self, :param str crn: The security group's CRN. :param str href: The security group's canonical URL. :param str id: The unique identifier for this security group. - :param str name: The user-defined name for this security group. Names must - be unique within the VPC the security group resides in. + :param str name: The name for this security group. The name is unique + across all security groups for the VPC. :param ResourceGroupReference resource_group: The resource group for this security group. :param List[SecurityGroupRule] rules: The rules for this security group. If @@ -55132,7 +57302,7 @@ def from_dict(cls, _dict: Dict) -> 'SecurityGroup': else: raise ValueError('Required property \'resource_group\' not present in SecurityGroup JSON') if 'rules' in _dict: - args['rules'] = [SecurityGroupRule.from_dict(x) for x in _dict.get('rules')] + args['rules'] = [SecurityGroupRule.from_dict(v) for v in _dict.get('rules')] else: raise ValueError('Required property \'rules\' not present in SecurityGroup JSON') if 'targets' in _dict: @@ -55164,19 +57334,31 @@ def to_dict(self) -> Dict: if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'resource_group') and self.resource_group is not None: - _dict['resource_group'] = self.resource_group.to_dict() + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() if hasattr(self, 'rules') and self.rules is not None: - _dict['rules'] = [x.to_dict() for x in self.rules] + rules_list = [] + for v in self.rules: + if isinstance(v, dict): + rules_list.append(v) + else: + rules_list.append(v.to_dict()) + _dict['rules'] = rules_list if hasattr(self, 'targets') and self.targets is not None: targets_list = [] - for x in self.targets: - if isinstance(x, dict): - targets_list.append(x) + for v in self.targets: + if isinstance(v, dict): + targets_list.append(v) else: - targets_list.append(x.to_dict()) + targets_list.append(v.to_dict()) _dict['targets'] = targets_list if hasattr(self, 'vpc') and self.vpc is not None: - _dict['vpc'] = self.vpc.to_dict() + if isinstance(self.vpc, dict): + _dict['vpc'] = self.vpc + else: + _dict['vpc'] = self.vpc.to_dict() return _dict def _to_dict(self): @@ -55252,7 +57434,7 @@ def from_dict(cls, _dict: Dict) -> 'SecurityGroupCollection': if 'next' in _dict: args['next'] = SecurityGroupCollectionNext.from_dict(_dict.get('next')) if 'security_groups' in _dict: - args['security_groups'] = [SecurityGroup.from_dict(x) for x in _dict.get('security_groups')] + args['security_groups'] = [SecurityGroup.from_dict(v) for v in _dict.get('security_groups')] else: raise ValueError('Required property \'security_groups\' not present in SecurityGroupCollection JSON') if 'total_count' in _dict: @@ -55270,13 +57452,25 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'first') and self.first is not None: - _dict['first'] = self.first.to_dict() + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit if hasattr(self, 'next') and self.next is not None: - _dict['next'] = self.next.to_dict() + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() if hasattr(self, 'security_groups') and self.security_groups is not None: - _dict['security_groups'] = [x.to_dict() for x in self.security_groups] + security_groups_list = [] + for v in self.security_groups: + if isinstance(v, dict): + security_groups_list.append(v) + else: + security_groups_list.append(v.to_dict()) + _dict['security_groups'] = security_groups_list if hasattr(self, 'total_count') and self.total_count is not None: _dict['total_count'] = self.total_count return _dict @@ -55431,8 +57625,8 @@ class SecurityGroupPatch(): """ SecurityGroupPatch. - :attr str name: (optional) The user-defined name for this security group. Names - must be unique within the VPC the security group resides in. + :attr str name: (optional) The name for this security group. The name must not + be used by another security group for the VPC. """ def __init__(self, @@ -55441,8 +57635,8 @@ def __init__(self, """ Initialize a SecurityGroupPatch object. - :param str name: (optional) The user-defined name for this security group. - Names must be unique within the VPC the security group resides in. + :param str name: (optional) The name for this security group. The name must + not be used by another security group for the VPC. """ self.name = name @@ -55494,8 +57688,8 @@ class SecurityGroupReference(): some supplementary information. :attr str href: The security group's canonical URL. :attr str id: The unique identifier for this security group. - :attr str name: The user-defined name for this security group. Names must be - unique within the VPC the security group resides in. + :attr str name: The name for this security group. The name is unique across all + security groups for the VPC. """ def __init__(self, @@ -55511,8 +57705,8 @@ def __init__(self, :param str crn: The security group's CRN. :param str href: The security group's canonical URL. :param str id: The unique identifier for this security group. - :param str name: The user-defined name for this security group. Names must - be unique within the VPC the security group resides in. + :param str name: The name for this security group. The name is unique + across all security groups for the VPC. :param SecurityGroupReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and provides some supplementary information. @@ -55558,7 +57752,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'crn') and self.crn is not None: _dict['crn'] = self.crn if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -55779,7 +57976,7 @@ def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleCollection': """Initialize a SecurityGroupRuleCollection object from a json dictionary.""" args = {} if 'rules' in _dict: - args['rules'] = [SecurityGroupRule.from_dict(x) for x in _dict.get('rules')] + args['rules'] = [SecurityGroupRule.from_dict(v) for v in _dict.get('rules')] else: raise ValueError('Required property \'rules\' not present in SecurityGroupRuleCollection JSON') return cls(**args) @@ -55793,7 +57990,13 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'rules') and self.rules is not None: - _dict['rules'] = [x.to_dict() for x in self.rules] + rules_list = [] + for v in self.rules: + if isinstance(v, dict): + rules_list.append(v) + else: + rules_list.append(v.to_dict()) + _dict['rules'] = rules_list return _dict def _to_dict(self): @@ -56217,18 +58420,24 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'first') and self.first is not None: - _dict['first'] = self.first.to_dict() + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit if hasattr(self, 'next') and self.next is not None: - _dict['next'] = self.next.to_dict() + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() if hasattr(self, 'targets') and self.targets is not None: targets_list = [] - for x in self.targets: - if isinstance(x, dict): - targets_list.append(x) + for v in self.targets: + if isinstance(v, dict): + targets_list.append(v) else: - targets_list.append(x.to_dict()) + targets_list.append(v.to_dict()) _dict['targets'] = targets_list if hasattr(self, 'total_count') and self.total_count is not None: _dict['total_count'] = self.total_count @@ -56397,8 +58606,8 @@ class Snapshot(): property may be absent for snapshots created before 1 January 2022. :attr datetime created_at: The date and time that this snapshot was created. :attr str crn: The CRN of this snapshot. - :attr bool deletable: Indicates whether this snapshot can be deleted. This value - will always be `true`. + :attr bool deletable: Deprecated: Indicates whether this snapshot can be + deleted. This value will always be `true`. :attr str encryption: The type of encryption used on the source volume. :attr EncryptionKeyReference encryption_key: (optional) The root key used to wrap the data encryption key for the source volume. @@ -56410,7 +58619,8 @@ class Snapshot(): :attr int minimum_capacity: The minimum capacity of a volume created from this snapshot. When a snapshot is created, this will be set to the capacity of the `source_volume`. - :attr str name: The user-defined name for this snapshot. + :attr str name: The name for this snapshot. The name is unique across all + snapshots in the region. :attr OperatingSystem operating_system: (optional) The operating system included in this image. :attr ResourceGroupReference resource_group: The resource group for this @@ -56462,8 +58672,8 @@ def __init__(self, :param datetime created_at: The date and time that this snapshot was created. :param str crn: The CRN of this snapshot. - :param bool deletable: Indicates whether this snapshot can be deleted. This - value will always be `true`. + :param bool deletable: Deprecated: Indicates whether this snapshot can be + deleted. This value will always be `true`. :param str encryption: The type of encryption used on the source volume. :param str href: The URL for this snapshot. :param str id: The unique identifier for this snapshot. @@ -56471,7 +58681,8 @@ def __init__(self, :param int minimum_capacity: The minimum capacity of a volume created from this snapshot. When a snapshot is created, this will be set to the capacity of the `source_volume`. - :param str name: The user-defined name for this snapshot. + :param str name: The name for this snapshot. The name is unique across all + snapshots in the region. :param ResourceGroupReference resource_group: The resource group for this snapshot. :param str resource_type: The resource type. @@ -56612,7 +58823,10 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'backup_policy_plan') and self.backup_policy_plan is not None: - _dict['backup_policy_plan'] = self.backup_policy_plan.to_dict() + if isinstance(self.backup_policy_plan, dict): + _dict['backup_policy_plan'] = self.backup_policy_plan + else: + _dict['backup_policy_plan'] = self.backup_policy_plan.to_dict() if hasattr(self, 'bootable') and self.bootable is not None: _dict['bootable'] = self.bootable if hasattr(self, 'captured_at') and self.captured_at is not None: @@ -56626,7 +58840,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'encryption') and self.encryption is not None: _dict['encryption'] = self.encryption if hasattr(self, 'encryption_key') and self.encryption_key is not None: - _dict['encryption_key'] = self.encryption_key.to_dict() + if isinstance(self.encryption_key, dict): + _dict['encryption_key'] = self.encryption_key + else: + _dict['encryption_key'] = self.encryption_key.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: @@ -56638,9 +58855,15 @@ def to_dict(self) -> Dict: if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'operating_system') and self.operating_system is not None: - _dict['operating_system'] = self.operating_system.to_dict() + if isinstance(self.operating_system, dict): + _dict['operating_system'] = self.operating_system + else: + _dict['operating_system'] = self.operating_system.to_dict() if hasattr(self, 'resource_group') and self.resource_group is not None: - _dict['resource_group'] = self.resource_group.to_dict() + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() if hasattr(self, 'resource_type') and self.resource_type is not None: _dict['resource_type'] = self.resource_type if hasattr(self, 'service_tags') and self.service_tags is not None: @@ -56648,9 +58871,15 @@ def to_dict(self) -> Dict: if hasattr(self, 'size') and self.size is not None: _dict['size'] = self.size if hasattr(self, 'source_image') and self.source_image is not None: - _dict['source_image'] = self.source_image.to_dict() + if isinstance(self.source_image, dict): + _dict['source_image'] = self.source_image + else: + _dict['source_image'] = self.source_image.to_dict() if hasattr(self, 'source_volume') and self.source_volume is not None: - _dict['source_volume'] = self.source_volume.to_dict() + if isinstance(self.source_volume, dict): + _dict['source_volume'] = self.source_volume + else: + _dict['source_volume'] = self.source_volume.to_dict() if hasattr(self, 'user_tags') and self.user_tags is not None: _dict['user_tags'] = self.user_tags return _dict @@ -56756,7 +58985,7 @@ def from_dict(cls, _dict: Dict) -> 'SnapshotCollection': if 'next' in _dict: args['next'] = SnapshotCollectionNext.from_dict(_dict.get('next')) if 'snapshots' in _dict: - args['snapshots'] = [Snapshot.from_dict(x) for x in _dict.get('snapshots')] + args['snapshots'] = [Snapshot.from_dict(v) for v in _dict.get('snapshots')] else: raise ValueError('Required property \'snapshots\' not present in SnapshotCollection JSON') if 'total_count' in _dict: @@ -56774,13 +59003,25 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'first') and self.first is not None: - _dict['first'] = self.first.to_dict() + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit if hasattr(self, 'next') and self.next is not None: - _dict['next'] = self.next.to_dict() + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() if hasattr(self, 'snapshots') and self.snapshots is not None: - _dict['snapshots'] = [x.to_dict() for x in self.snapshots] + snapshots_list = [] + for v in self.snapshots: + if isinstance(v, dict): + snapshots_list.append(v) + else: + snapshots_list.append(v.to_dict()) + _dict['snapshots'] = snapshots_list if hasattr(self, 'total_count') and self.total_count is not None: _dict['total_count'] = self.total_count return _dict @@ -56935,7 +59176,8 @@ class SnapshotPatch(): """ SnapshotPatch. - :attr str name: (optional) The user-defined name for this snapshot. + :attr str name: (optional) The name for this snapshot. The name must not be used + by another snapshot in the region. :attr List[str] user_tags: (optional) The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this snapshot. @@ -56948,7 +59190,8 @@ def __init__(self, """ Initialize a SnapshotPatch object. - :param str name: (optional) The user-defined name for this snapshot. + :param str name: (optional) The name for this snapshot. The name must not + be used by another snapshot in the region. :param List[str] user_tags: (optional) The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this snapshot. @@ -57002,8 +59245,9 @@ class SnapshotPrototype(): """ SnapshotPrototype. - :attr str name: (optional) The unique user-defined name for this snapshot. If - unspecified, the name will be a hyphenated list of randomly-selected words. + :attr str name: (optional) The name for this snapshot. The name must not be used + by another snapshot in the region. If unspecified, the name will be a hyphenated + list of randomly-selected words. :attr ResourceGroupIdentity resource_group: (optional) The resource group to use. If unspecified, the account's [default resource group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. @@ -57020,9 +59264,9 @@ def __init__(self, """ Initialize a SnapshotPrototype object. - :param str name: (optional) The unique user-defined name for this snapshot. - If unspecified, the name will be a hyphenated list of randomly-selected - words. + :param str name: (optional) The name for this snapshot. The name must not + be used by another snapshot in the region. If unspecified, the name will be + a hyphenated list of randomly-selected words. :param ResourceGroupIdentity resource_group: (optional) The resource group to use. If unspecified, the account's [default resource group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is @@ -57045,7 +59289,8 @@ class SnapshotReference(): some supplementary information. :attr str href: The URL for this snapshot. :attr str id: The unique identifier for this snapshot. - :attr str name: The user-defined name for this snapshot. + :attr str name: The name for this snapshot. The name is unique across all + snapshots in the region. :attr str resource_type: The resource type. """ @@ -57063,7 +59308,8 @@ def __init__(self, :param str crn: The CRN of this snapshot. :param str href: The URL for this snapshot. :param str id: The unique identifier for this snapshot. - :param str name: The user-defined name for this snapshot. + :param str name: The name for this snapshot. The name is unique across all + snapshots in the region. :param str resource_type: The resource type. :param SnapshotReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and provides @@ -57115,7 +59361,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'crn') and self.crn is not None: _dict['crn'] = self.crn if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -57222,7 +59471,8 @@ class Subnet(): :attr str ip_version: The IP version(s) supported by this subnet. :attr str ipv4_cidr_block: The IPv4 range of the subnet, expressed in CIDR format. - :attr str name: The user-defined name for this subnet. + :attr str name: The name for this subnet. The name is unique across all subnets + in the VPC. :attr NetworkACLReference network_acl: The network ACL for this subnet. :attr PublicGatewayReference public_gateway: (optional) The public gateway to use for internet-bound traffic for this subnet. @@ -57271,7 +59521,8 @@ def __init__(self, :param str ip_version: The IP version(s) supported by this subnet. :param str ipv4_cidr_block: The IPv4 range of the subnet, expressed in CIDR format. - :param str name: The user-defined name for this subnet. + :param str name: The name for this subnet. The name is unique across all + subnets in the VPC. :param NetworkACLReference network_acl: The network ACL for this subnet. :param ResourceGroupReference resource_group: The resource group for this subnet. @@ -57404,23 +59655,41 @@ def to_dict(self) -> Dict: if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'network_acl') and self.network_acl is not None: - _dict['network_acl'] = self.network_acl.to_dict() + if isinstance(self.network_acl, dict): + _dict['network_acl'] = self.network_acl + else: + _dict['network_acl'] = self.network_acl.to_dict() if hasattr(self, 'public_gateway') and self.public_gateway is not None: - _dict['public_gateway'] = self.public_gateway.to_dict() + if isinstance(self.public_gateway, dict): + _dict['public_gateway'] = self.public_gateway + else: + _dict['public_gateway'] = self.public_gateway.to_dict() if hasattr(self, 'resource_group') and self.resource_group is not None: - _dict['resource_group'] = self.resource_group.to_dict() + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() if hasattr(self, 'resource_type') and self.resource_type is not None: _dict['resource_type'] = self.resource_type if hasattr(self, 'routing_table') and self.routing_table is not None: - _dict['routing_table'] = self.routing_table.to_dict() + if isinstance(self.routing_table, dict): + _dict['routing_table'] = self.routing_table + else: + _dict['routing_table'] = self.routing_table.to_dict() if hasattr(self, 'status') and self.status is not None: _dict['status'] = self.status if hasattr(self, 'total_ipv4_address_count') and self.total_ipv4_address_count is not None: _dict['total_ipv4_address_count'] = self.total_ipv4_address_count if hasattr(self, 'vpc') and self.vpc is not None: - _dict['vpc'] = self.vpc.to_dict() + if isinstance(self.vpc, dict): + _dict['vpc'] = self.vpc + else: + _dict['vpc'] = self.vpc.to_dict() if hasattr(self, 'zone') and self.zone is not None: - _dict['zone'] = self.zone.to_dict() + if isinstance(self.zone, dict): + _dict['zone'] = self.zone + else: + _dict['zone'] = self.zone.to_dict() return _dict def _to_dict(self): @@ -57519,7 +59788,7 @@ def from_dict(cls, _dict: Dict) -> 'SubnetCollection': if 'next' in _dict: args['next'] = SubnetCollectionNext.from_dict(_dict.get('next')) if 'subnets' in _dict: - args['subnets'] = [Subnet.from_dict(x) for x in _dict.get('subnets')] + args['subnets'] = [Subnet.from_dict(v) for v in _dict.get('subnets')] else: raise ValueError('Required property \'subnets\' not present in SubnetCollection JSON') if 'total_count' in _dict: @@ -57537,13 +59806,25 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'first') and self.first is not None: - _dict['first'] = self.first.to_dict() + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit if hasattr(self, 'next') and self.next is not None: - _dict['next'] = self.next.to_dict() + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() if hasattr(self, 'subnets') and self.subnets is not None: - _dict['subnets'] = [x.to_dict() for x in self.subnets] + subnets_list = [] + for v in self.subnets: + if isinstance(v, dict): + subnets_list.append(v) + else: + subnets_list.append(v.to_dict()) + _dict['subnets'] = subnets_list if hasattr(self, 'total_count') and self.total_count is not None: _dict['total_count'] = self.total_count return _dict @@ -57698,8 +59979,8 @@ class SubnetPatch(): """ SubnetPatch. - :attr str name: (optional) The user-defined name for this subnet. Names must be - unique within the VPC the subnet resides in. + :attr str name: (optional) The name for this subnet. The name must not be used + by another subnet in the VPC. :attr NetworkACLIdentity network_acl: (optional) The network ACL to use for this subnet. :attr SubnetPublicGatewayPatch public_gateway: (optional) The public gateway to @@ -57719,8 +60000,8 @@ def __init__(self, """ Initialize a SubnetPatch object. - :param str name: (optional) The user-defined name for this subnet. Names - must be unique within the VPC the subnet resides in. + :param str name: (optional) The name for this subnet. The name must not be + used by another subnet in the VPC. :param NetworkACLIdentity network_acl: (optional) The network ACL to use for this subnet. :param SubnetPublicGatewayPatch public_gateway: (optional) The public @@ -57800,9 +60081,9 @@ class SubnetPrototype(): SubnetPrototype. :attr str ip_version: (optional) The IP version(s) to support for this subnet. - :attr str name: (optional) The user-defined name for this subnet. Names must be - unique within the VPC the subnet resides in. If unspecified, the name will be a - hyphenated list of randomly-selected words. + :attr str name: (optional) The name for this subnet. The name must not be used + by another subnet in the VPC. If unspecified, the name will be a hyphenated list + of randomly-selected words. :attr NetworkACLIdentity network_acl: (optional) The network ACL to use for this subnet. :attr PublicGatewayIdentity public_gateway: (optional) The public gateway to use @@ -57834,9 +60115,9 @@ def __init__(self, :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 - must be unique within the VPC the subnet resides in. If unspecified, the - name will be a hyphenated list of randomly-selected words. + :param str name: (optional) The name for this subnet. The name must not be + used by another subnet in the VPC. If unspecified, the name will be a + hyphenated list of randomly-selected words. :param NetworkACLIdentity network_acl: (optional) The network ACL to use for this subnet. :param PublicGatewayIdentity public_gateway: (optional) The public gateway @@ -57889,7 +60170,8 @@ class SubnetReference(): some supplementary information. :attr str href: The URL for this subnet. :attr str id: The unique identifier for this subnet. - :attr str name: The user-defined name for this subnet. + :attr str name: The name for this subnet. The name is unique across all subnets + in the VPC. :attr str resource_type: The resource type. """ @@ -57907,7 +60189,8 @@ def __init__(self, :param str crn: The CRN for this subnet. :param str href: The URL for this subnet. :param str id: The unique identifier for this subnet. - :param str name: The user-defined name for this subnet. + :param str name: The name for this subnet. The name is unique across all + subnets in the VPC. :param str resource_type: The resource type. :param SubnetReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and provides @@ -57959,7 +60242,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'crn') and self.crn is not None: _dict['crn'] = self.crn if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -58239,7 +60525,8 @@ class VPC(): to use for network interfaces created in this VPC. :attr str href: The URL for this VPC. :attr str id: The unique identifier for this VPC. - :attr str name: The unique user-defined name for this VPC. + :attr str name: The name for this VPC. The name is unique across all VPCs in the + region. :attr ResourceGroupReference resource_group: The resource group for this VPC. :attr str resource_type: The resource type. :attr str status: The status of this VPC. @@ -58278,7 +60565,8 @@ def __init__(self, group to use for network interfaces created in this VPC. :param str href: The URL for this VPC. :param str id: The unique identifier for this VPC. - :param str name: The unique user-defined name for this VPC. + :param str name: The name for this VPC. The name is unique across all VPCs + in the region. :param ResourceGroupReference resource_group: The resource group for this VPC. :param str resource_type: The resource type. @@ -58320,7 +60608,7 @@ def from_dict(cls, _dict: Dict) -> 'VPC': else: raise ValueError('Required property \'crn\' not present in VPC JSON') if 'cse_source_ips' in _dict: - args['cse_source_ips'] = [VPCCSESourceIP.from_dict(x) for x in _dict.get('cse_source_ips')] + args['cse_source_ips'] = [VPCCSESourceIP.from_dict(v) for v in _dict.get('cse_source_ips')] if 'default_network_acl' in _dict: args['default_network_acl'] = NetworkACLReference.from_dict(_dict.get('default_network_acl')) else: @@ -58374,13 +60662,28 @@ def to_dict(self) -> Dict: if hasattr(self, 'crn') and self.crn is not None: _dict['crn'] = self.crn if hasattr(self, 'cse_source_ips') and self.cse_source_ips is not None: - _dict['cse_source_ips'] = [x.to_dict() for x in self.cse_source_ips] + cse_source_ips_list = [] + for v in self.cse_source_ips: + if isinstance(v, dict): + cse_source_ips_list.append(v) + else: + cse_source_ips_list.append(v.to_dict()) + _dict['cse_source_ips'] = cse_source_ips_list if hasattr(self, 'default_network_acl') and self.default_network_acl is not None: - _dict['default_network_acl'] = self.default_network_acl.to_dict() + if isinstance(self.default_network_acl, dict): + _dict['default_network_acl'] = self.default_network_acl + else: + _dict['default_network_acl'] = self.default_network_acl.to_dict() if hasattr(self, 'default_routing_table') and self.default_routing_table is not None: - _dict['default_routing_table'] = self.default_routing_table.to_dict() + if isinstance(self.default_routing_table, dict): + _dict['default_routing_table'] = self.default_routing_table + else: + _dict['default_routing_table'] = self.default_routing_table.to_dict() if hasattr(self, 'default_security_group') and self.default_security_group is not None: - _dict['default_security_group'] = self.default_security_group.to_dict() + if isinstance(self.default_security_group, dict): + _dict['default_security_group'] = self.default_security_group + else: + _dict['default_security_group'] = self.default_security_group.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: @@ -58388,7 +60691,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'resource_group') and self.resource_group is not None: - _dict['resource_group'] = self.resource_group.to_dict() + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() if hasattr(self, 'resource_type') and self.resource_type is not None: _dict['resource_type'] = self.resource_type if hasattr(self, 'status') and self.status is not None: @@ -58475,9 +60781,15 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'ip') and self.ip is not None: - _dict['ip'] = self.ip.to_dict() + if isinstance(self.ip, dict): + _dict['ip'] = self.ip + else: + _dict['ip'] = self.ip.to_dict() if hasattr(self, 'zone') and self.zone is not None: - _dict['zone'] = self.zone.to_dict() + if isinstance(self.zone, dict): + _dict['zone'] = self.zone + else: + _dict['zone'] = self.zone.to_dict() return _dict def _to_dict(self): @@ -58556,7 +60868,7 @@ def from_dict(cls, _dict: Dict) -> 'VPCCollection': else: raise ValueError('Required property \'total_count\' not present in VPCCollection JSON') if 'vpcs' in _dict: - args['vpcs'] = [VPC.from_dict(x) for x in _dict.get('vpcs')] + args['vpcs'] = [VPC.from_dict(v) for v in _dict.get('vpcs')] else: raise ValueError('Required property \'vpcs\' not present in VPCCollection JSON') return cls(**args) @@ -58570,15 +60882,27 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'first') and self.first is not None: - _dict['first'] = self.first.to_dict() + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit if hasattr(self, 'next') and self.next is not None: - _dict['next'] = self.next.to_dict() + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() if hasattr(self, 'total_count') and self.total_count is not None: _dict['total_count'] = self.total_count if hasattr(self, 'vpcs') and self.vpcs is not None: - _dict['vpcs'] = [x.to_dict() for x in self.vpcs] + vpcs_list = [] + for v in self.vpcs: + if isinstance(v, dict): + vpcs_list.append(v) + else: + vpcs_list.append(v.to_dict()) + _dict['vpcs'] = vpcs_list return _dict def _to_dict(self): @@ -58731,7 +61055,8 @@ class VPCPatch(): """ VPCPatch. - :attr str name: (optional) The unique user-defined name for this VPC. + :attr str name: (optional) The name for this VPC. The name must not be used by + another VPC in the region. """ def __init__(self, @@ -58740,7 +61065,8 @@ def __init__(self, """ Initialize a VPCPatch object. - :param str name: (optional) The unique user-defined name for this VPC. + :param str name: (optional) The name for this VPC. The name must not be + used by another VPC in the region. """ self.name = name @@ -58792,7 +61118,8 @@ class VPCReference(): some supplementary information. :attr str href: The URL for this VPC. :attr str id: The unique identifier for this VPC. - :attr str name: The unique user-defined name for this VPC. + :attr str name: The name for this VPC. The name is unique across all VPCs in the + region. :attr str resource_type: The resource type. """ @@ -58810,7 +61137,8 @@ def __init__(self, :param str crn: The CRN for this VPC. :param str href: The URL for this VPC. :param str id: The unique identifier for this VPC. - :param str name: The unique user-defined name for this VPC. + :param str name: The name for this VPC. The name is unique across all VPCs + in the region. :param str resource_type: The resource type. :param VPCReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and provides @@ -58862,7 +61190,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'crn') and self.crn is not None: _dict['crn'] = self.crn if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -58966,7 +61297,8 @@ class VPNGateway(): :attr str href: The VPN gateway's canonical URL. :attr str id: The unique identifier for this VPN gateway. :attr List[VPNGatewayMember] members: Collection of VPN gateway members. - :attr str name: The user-defined name for this VPN gateway. + :attr str name: The name for this VPN gateway. The name is unique across all VPN + gateways in the VPC. :attr ResourceGroupReference resource_group: The resource group for this VPN gateway. :attr str resource_type: The resource type. @@ -58999,7 +61331,8 @@ def __init__(self, :param str href: The VPN gateway's canonical URL. :param str id: The unique identifier for this VPN gateway. :param List[VPNGatewayMember] members: Collection of VPN gateway members. - :param str name: The user-defined name for this VPN gateway. + :param str name: The name for this VPN gateway. The name is unique across + all VPN gateways in the VPC. :param ResourceGroupReference resource_group: The resource group for this VPN gateway. :param str resource_type: The resource type. @@ -59101,20 +61434,26 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'first') and self.first is not None: - _dict['first'] = self.first.to_dict() + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit if hasattr(self, 'next') and self.next is not None: - _dict['next'] = self.next.to_dict() + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() if hasattr(self, 'total_count') and self.total_count is not None: _dict['total_count'] = self.total_count if hasattr(self, 'vpn_gateways') and self.vpn_gateways is not None: vpn_gateways_list = [] - for x in self.vpn_gateways: - if isinstance(x, dict): - vpn_gateways_list.append(x) + for v in self.vpn_gateways: + if isinstance(v, dict): + vpn_gateways_list.append(v) else: - vpn_gateways_list.append(x.to_dict()) + vpn_gateways_list.append(v.to_dict()) _dict['vpn_gateways'] = vpn_gateways_list return _dict @@ -59270,7 +61609,8 @@ class VPNGatewayConnection(): [auto-negotiation is used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ipsec-auto-negotiation-phase-2). :attr str mode: The mode of the VPN gateway. - :attr str name: The user-defined name for this VPN gateway connection. + :attr str name: The name for this VPN gateway connection. The name is unique + across all connections for the VPN gateway. :attr str peer_address: The IP address of the peer VPN gateway. :attr str psk: The preshared key. :attr str resource_type: The resource type. @@ -59307,7 +61647,8 @@ def __init__(self, :param str href: The VPN connection's canonical URL. :param str id: The unique identifier for this VPN gateway connection. :param str mode: The mode of the VPN gateway. - :param str name: The user-defined name for this VPN gateway connection. + :param str name: The name for this VPN gateway connection. The name is + unique across all connections for the VPN gateway. :param str peer_address: The IP address of the peer VPN gateway. :param str psk: The preshared key. :param str resource_type: The resource type. @@ -59390,11 +61731,11 @@ def to_dict(self) -> Dict: _dict = {} if hasattr(self, 'connections') and self.connections is not None: connections_list = [] - for x in self.connections: - if isinstance(x, dict): - connections_list.append(x) + for v in self.connections: + if isinstance(v, dict): + connections_list.append(v) else: - connections_list.append(x.to_dict()) + connections_list.append(v.to_dict()) _dict['connections'] = connections_list return _dict @@ -59803,8 +62144,8 @@ class VPNGatewayConnectionPatch(): :attr VPNGatewayConnectionIPsecPolicyPatch ipsec_policy: (optional) The IPsec policy to use. Specify `null` to remove any existing policy, [resulting in auto-negotiation](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ipsec-auto-negotiation-phase-2). - :attr str name: (optional) The user-defined name for this VPN gateway - connection. + :attr str name: (optional) The name for this VPN gateway connection. The name + must not be used by another connection for the VPN gateway. :attr str peer_address: (optional) The IP address of the peer VPN gateway. :attr str psk: (optional) The preshared key. """ @@ -59832,8 +62173,8 @@ def __init__(self, IPsec policy to use. Specify `null` to remove any existing policy, [resulting in auto-negotiation](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ipsec-auto-negotiation-phase-2). - :param str name: (optional) The user-defined name for this VPN gateway - connection. + :param str name: (optional) The name for this VPN gateway connection. The + name must not be used by another connection for the VPN gateway. :param str peer_address: (optional) The IP address of the peer VPN gateway. :param str psk: (optional) The preshared key. """ @@ -59910,8 +62251,9 @@ class VPNGatewayConnectionPrototype(): :attr VPNGatewayConnectionIPsecPolicyPrototype ipsec_policy: (optional) The IPsec policy to use. If unspecified, [auto-negotiation will be used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ipsec-auto-negotiation-phase-2). - :attr str name: (optional) The user-defined name for this VPN gateway - connection. + :attr str name: (optional) The name for this VPN gateway connection. The name + must not be used by another connection for the VPN gateway. If unspecified, the + name will be a hyphenated list of randomly-selected words. :attr str peer_address: The IP address of the peer VPN gateway. :attr str psk: The preshared key. """ @@ -59940,8 +62282,9 @@ def __init__(self, :param VPNGatewayConnectionIPsecPolicyPrototype ipsec_policy: (optional) The IPsec policy to use. If unspecified, [auto-negotiation will be used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ipsec-auto-negotiation-phase-2). - :param str name: (optional) The user-defined name for this VPN gateway - connection. + :param str name: (optional) The name for this VPN gateway connection. The + name must not be used by another connection for the VPN gateway. 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(['VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype', 'VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype'])) @@ -59956,7 +62299,8 @@ class VPNGatewayConnectionReference(): some supplementary information. :attr str href: The VPN connection's canonical URL. :attr str id: The unique identifier for this VPN gateway connection. - :attr str name: The user-defined name for this VPN connection. + :attr str name: The name for this VPN gateway connection. The name is unique + across all connections for the VPN gateway. :attr str resource_type: The resource type. """ @@ -59972,7 +62316,8 @@ def __init__(self, :param str href: The VPN connection's canonical URL. :param str id: The unique identifier for this VPN gateway connection. - :param str name: The user-defined name for this VPN connection. + :param str name: The name for this VPN gateway connection. The name is + unique across all connections for the VPN gateway. :param str resource_type: The resource type. :param VPNGatewayConnectionReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and @@ -60018,7 +62363,10 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -60156,7 +62504,10 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'public_ip') and self.public_ip is not None: - _dict['public_ip'] = self.public_ip.to_dict() + if isinstance(self.public_ip, dict): + _dict['public_ip'] = self.public_ip + else: + _dict['public_ip'] = self.public_ip.to_dict() if hasattr(self, 'status') and self.status is not None: _dict['status'] = self.status return _dict @@ -60252,9 +62603,15 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'private_ip') and self.private_ip is not None: - _dict['private_ip'] = self.private_ip.to_dict() + if isinstance(self.private_ip, dict): + _dict['private_ip'] = self.private_ip + else: + _dict['private_ip'] = self.private_ip.to_dict() if hasattr(self, 'public_ip') and self.public_ip is not None: - _dict['public_ip'] = self.public_ip.to_dict() + if isinstance(self.public_ip, dict): + _dict['public_ip'] = self.public_ip + else: + _dict['public_ip'] = self.public_ip.to_dict() if hasattr(self, 'role') and self.role is not None: _dict['role'] = self.role if hasattr(self, 'status') and self.status is not None: @@ -60301,7 +62658,8 @@ class VPNGatewayPatch(): """ VPNGatewayPatch. - :attr str name: (optional) The user-defined name for this VPN gateway. + :attr str name: (optional) The name for this VPN gateway. The name must not be + used by another VPN gateway in the VPC. """ def __init__(self, @@ -60310,7 +62668,8 @@ def __init__(self, """ Initialize a VPNGatewayPatch object. - :param str name: (optional) The user-defined name for this VPN gateway. + :param str name: (optional) The name for this VPN gateway. The name must + not be used by another VPN gateway in the VPC. """ self.name = name @@ -60356,7 +62715,9 @@ class VPNGatewayPrototype(): """ VPNGatewayPrototype. - :attr str name: (optional) The user-defined name for this VPN gateway. + :attr str name: (optional) The name for this VPN gateway. The name must not be + used by another VPN gateway in the VPC. If unspecified, the name will be a + hyphenated list of randomly-selected words. :attr ResourceGroupIdentity resource_group: (optional) The resource group to use. If unspecified, the account's [default resource group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. @@ -60372,7 +62733,9 @@ def __init__(self, Initialize a VPNGatewayPrototype object. :param SubnetIdentity subnet: Identifies a subnet by a unique property. - :param str name: (optional) The user-defined name for this VPN gateway. + :param str name: (optional) The name for this VPN gateway. The name must + not be used by another VPN gateway in the VPC. If unspecified, the name + will be a hyphenated list of randomly-selected words. :param ResourceGroupIdentity resource_group: (optional) The resource group to use. If unspecified, the account's [default resource group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is @@ -60480,7 +62843,8 @@ class VPNServer(): :attr str href: The URL for this VPN server. :attr str id: The unique identifier for this VPN server. :attr str lifecycle_state: The lifecycle state of the VPN server. - :attr str name: The unique user-defined name for this VPN server. + :attr str name: The name for this VPN server. The name is unique across all VPN + servers in the VPC. :attr int port: The port number used by this VPN server. :attr List[ReservedIPReference] private_ips: The reserved IPs bound to this VPN server. @@ -60563,7 +62927,8 @@ def __init__(self, :param str href: The URL for this VPN server. :param str id: The unique identifier for this VPN server. :param str lifecycle_state: The lifecycle state of the VPN server. - :param str name: The unique user-defined name for this VPN server. + :param str name: The name for this VPN server. The name is unique across + all VPN servers in the VPC. :param int port: The port number used by this VPN server. :param List[ReservedIPReference] private_ips: The reserved IPs bound to this VPN server. @@ -60623,7 +62988,7 @@ def from_dict(cls, _dict: Dict) -> 'VPNServer': else: raise ValueError('Required property \'client_auto_delete_timeout\' not present in VPNServer JSON') if 'client_dns_server_ips' in _dict: - args['client_dns_server_ips'] = [IP.from_dict(x) for x in _dict.get('client_dns_server_ips')] + args['client_dns_server_ips'] = [IP.from_dict(v) for v in _dict.get('client_dns_server_ips')] else: raise ValueError('Required property \'client_dns_server_ips\' not present in VPNServer JSON') if 'client_idle_timeout' in _dict: @@ -60675,7 +63040,7 @@ def from_dict(cls, _dict: Dict) -> 'VPNServer': else: raise ValueError('Required property \'port\' not present in VPNServer JSON') if 'private_ips' in _dict: - args['private_ips'] = [ReservedIPReference.from_dict(x) for x in _dict.get('private_ips')] + args['private_ips'] = [ReservedIPReference.from_dict(v) for v in _dict.get('private_ips')] else: raise ValueError('Required property \'private_ips\' not present in VPNServer JSON') if 'protocol' in _dict: @@ -60691,11 +63056,11 @@ def from_dict(cls, _dict: Dict) -> 'VPNServer': else: raise ValueError('Required property \'resource_type\' not present in VPNServer JSON') if 'security_groups' in _dict: - args['security_groups'] = [SecurityGroupReference.from_dict(x) for x in _dict.get('security_groups')] + args['security_groups'] = [SecurityGroupReference.from_dict(v) for v in _dict.get('security_groups')] else: raise ValueError('Required property \'security_groups\' not present in VPNServer JSON') if 'subnets' in _dict: - args['subnets'] = [SubnetReference.from_dict(x) for x in _dict.get('subnets')] + args['subnets'] = [SubnetReference.from_dict(v) for v in _dict.get('subnets')] else: raise ValueError('Required property \'subnets\' not present in VPNServer JSON') if 'vpc' in _dict: @@ -60713,21 +63078,30 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'certificate') and self.certificate is not None: - _dict['certificate'] = self.certificate.to_dict() + if isinstance(self.certificate, dict): + _dict['certificate'] = self.certificate + else: + _dict['certificate'] = self.certificate.to_dict() if hasattr(self, 'client_authentication') and self.client_authentication is not None: client_authentication_list = [] - for x in self.client_authentication: - if isinstance(x, dict): - client_authentication_list.append(x) + for v in self.client_authentication: + if isinstance(v, dict): + client_authentication_list.append(v) else: - client_authentication_list.append(x.to_dict()) + client_authentication_list.append(v.to_dict()) _dict['client_authentication'] = client_authentication_list if hasattr(self, 'client_auto_delete') and self.client_auto_delete is not None: _dict['client_auto_delete'] = self.client_auto_delete if hasattr(self, 'client_auto_delete_timeout') and self.client_auto_delete_timeout is not None: _dict['client_auto_delete_timeout'] = self.client_auto_delete_timeout if hasattr(self, 'client_dns_server_ips') and self.client_dns_server_ips is not None: - _dict['client_dns_server_ips'] = [x.to_dict() for x in self.client_dns_server_ips] + client_dns_server_ips_list = [] + for v in self.client_dns_server_ips: + if isinstance(v, dict): + client_dns_server_ips_list.append(v) + else: + client_dns_server_ips_list.append(v.to_dict()) + _dict['client_dns_server_ips'] = client_dns_server_ips_list if hasattr(self, 'client_idle_timeout') and self.client_idle_timeout is not None: _dict['client_idle_timeout'] = self.client_idle_timeout if hasattr(self, 'client_ip_pool') and self.client_ip_pool is not None: @@ -60753,19 +63127,43 @@ def to_dict(self) -> Dict: if hasattr(self, 'port') and self.port is not None: _dict['port'] = self.port if hasattr(self, 'private_ips') and self.private_ips is not None: - _dict['private_ips'] = [x.to_dict() for x in self.private_ips] + private_ips_list = [] + for v in self.private_ips: + if isinstance(v, dict): + private_ips_list.append(v) + else: + private_ips_list.append(v.to_dict()) + _dict['private_ips'] = private_ips_list if hasattr(self, 'protocol') and self.protocol is not None: _dict['protocol'] = self.protocol if hasattr(self, 'resource_group') and self.resource_group is not None: - _dict['resource_group'] = self.resource_group.to_dict() + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() if hasattr(self, 'resource_type') and self.resource_type is not None: _dict['resource_type'] = self.resource_type if hasattr(self, 'security_groups') and self.security_groups is not None: - _dict['security_groups'] = [x.to_dict() for x in self.security_groups] + security_groups_list = [] + for v in self.security_groups: + if isinstance(v, dict): + security_groups_list.append(v) + else: + security_groups_list.append(v.to_dict()) + _dict['security_groups'] = security_groups_list if hasattr(self, 'subnets') and self.subnets is not None: - _dict['subnets'] = [x.to_dict() for x in self.subnets] + subnets_list = [] + for v in self.subnets: + if isinstance(v, dict): + subnets_list.append(v) + else: + subnets_list.append(v.to_dict()) + _dict['subnets'] = subnets_list if hasattr(self, 'vpc') and self.vpc is not None: - _dict['vpc'] = self.vpc.to_dict() + if isinstance(self.vpc, dict): + _dict['vpc'] = self.vpc + else: + _dict['vpc'] = self.vpc.to_dict() return _dict def _to_dict(self): @@ -61073,7 +63471,10 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'client_ip') and self.client_ip is not None: - _dict['client_ip'] = self.client_ip.to_dict() + if isinstance(self.client_ip, dict): + _dict['client_ip'] = self.client_ip + else: + _dict['client_ip'] = self.client_ip.to_dict() if hasattr(self, 'common_name') and self.common_name is not None: _dict['common_name'] = self.common_name if hasattr(self, 'created_at') and self.created_at is not None: @@ -61085,7 +63486,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'id') and self.id is not None: _dict['id'] = self.id if hasattr(self, 'remote_ip') and self.remote_ip is not None: - _dict['remote_ip'] = self.remote_ip.to_dict() + if isinstance(self.remote_ip, dict): + _dict['remote_ip'] = self.remote_ip + else: + _dict['remote_ip'] = self.remote_ip.to_dict() if hasattr(self, 'remote_port') and self.remote_port is not None: _dict['remote_port'] = self.remote_port if hasattr(self, 'resource_type') and self.resource_type is not None: @@ -61181,7 +63585,7 @@ def from_dict(cls, _dict: Dict) -> 'VPNServerClientCollection': """Initialize a VPNServerClientCollection object from a json dictionary.""" args = {} if 'clients' in _dict: - args['clients'] = [VPNServerClient.from_dict(x) for x in _dict.get('clients')] + args['clients'] = [VPNServerClient.from_dict(v) for v in _dict.get('clients')] else: raise ValueError('Required property \'clients\' not present in VPNServerClientCollection JSON') if 'first' in _dict: @@ -61209,13 +63613,25 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'clients') and self.clients is not None: - _dict['clients'] = [x.to_dict() for x in self.clients] + clients_list = [] + for v in self.clients: + if isinstance(v, dict): + clients_list.append(v) + else: + clients_list.append(v.to_dict()) + _dict['clients'] = clients_list if hasattr(self, 'first') and self.first is not None: - _dict['first'] = self.first.to_dict() + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit if hasattr(self, 'next') and self.next is not None: - _dict['next'] = self.next.to_dict() + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() if hasattr(self, 'total_count') and self.total_count is not None: _dict['total_count'] = self.total_count return _dict @@ -61410,7 +63826,7 @@ def from_dict(cls, _dict: Dict) -> 'VPNServerCollection': else: raise ValueError('Required property \'total_count\' not present in VPNServerCollection JSON') if 'vpn_servers' in _dict: - args['vpn_servers'] = [VPNServer.from_dict(x) for x in _dict.get('vpn_servers')] + args['vpn_servers'] = [VPNServer.from_dict(v) for v in _dict.get('vpn_servers')] else: raise ValueError('Required property \'vpn_servers\' not present in VPNServerCollection JSON') return cls(**args) @@ -61424,15 +63840,27 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'first') and self.first is not None: - _dict['first'] = self.first.to_dict() + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit if hasattr(self, 'next') and self.next is not None: - _dict['next'] = self.next.to_dict() + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() if hasattr(self, 'total_count') and self.total_count is not None: _dict['total_count'] = self.total_count if hasattr(self, 'vpn_servers') and self.vpn_servers is not None: - _dict['vpn_servers'] = [x.to_dict() for x in self.vpn_servers] + vpn_servers_list = [] + for v in self.vpn_servers: + if isinstance(v, dict): + vpn_servers_list.append(v) + else: + vpn_servers_list.append(v.to_dict()) + _dict['vpn_servers'] = vpn_servers_list return _dict def _to_dict(self): @@ -61595,8 +64023,8 @@ class VPNServerPatch(): maximum number of concurrent connections is recommended. :attr bool enable_split_tunneling: (optional) Indicates whether the split tunneling is enabled on this VPN server. - :attr str name: (optional) The user-defined name for this VPN server. Names must - be unique within the VPC this VPN server is serving. + :attr str name: (optional) The name for this VPN server. The name must not be + used by another VPN server in the VPC. :attr int port: (optional) The port number used by this VPN server. :attr str protocol: (optional) The transport protocol used by this VPN server. :attr List[SubnetIdentity] subnets: (optional) The subnets to provision this VPN @@ -61645,8 +64073,8 @@ def __init__(self, maximum number of concurrent connections is recommended. :param bool enable_split_tunneling: (optional) Indicates whether the split tunneling is enabled on this VPN server. - :param str name: (optional) The user-defined name for this VPN server. - Names must be unique within the VPC this VPN server is serving. + :param str name: (optional) The name for this VPN server. The name must not + be used by another VPN server in the VPC. :param int port: (optional) The port number used by this VPN server. :param str protocol: (optional) The transport protocol used by this VPN server. @@ -61671,9 +64099,9 @@ def from_dict(cls, _dict: Dict) -> 'VPNServerPatch': if 'certificate' in _dict: args['certificate'] = _dict.get('certificate') if 'client_authentication' in _dict: - args['client_authentication'] = [VPNServerAuthenticationPrototype.from_dict(x) for x in _dict.get('client_authentication')] + args['client_authentication'] = [VPNServerAuthenticationPrototype.from_dict(v) for v in _dict.get('client_authentication')] if 'client_dns_server_ips' in _dict: - args['client_dns_server_ips'] = [IP.from_dict(x) for x in _dict.get('client_dns_server_ips')] + args['client_dns_server_ips'] = [IP.from_dict(v) for v in _dict.get('client_dns_server_ips')] if 'client_idle_timeout' in _dict: args['client_idle_timeout'] = _dict.get('client_idle_timeout') if 'client_ip_pool' in _dict: @@ -61704,9 +64132,21 @@ def to_dict(self) -> Dict: else: _dict['certificate'] = self.certificate.to_dict() if hasattr(self, 'client_authentication') and self.client_authentication is not None: - _dict['client_authentication'] = [x.to_dict() for x in self.client_authentication] + client_authentication_list = [] + for v in self.client_authentication: + if isinstance(v, dict): + client_authentication_list.append(v) + else: + client_authentication_list.append(v.to_dict()) + _dict['client_authentication'] = client_authentication_list if hasattr(self, 'client_dns_server_ips') and self.client_dns_server_ips is not None: - _dict['client_dns_server_ips'] = [x.to_dict() for x in self.client_dns_server_ips] + client_dns_server_ips_list = [] + for v in self.client_dns_server_ips: + if isinstance(v, dict): + client_dns_server_ips_list.append(v) + else: + client_dns_server_ips_list.append(v.to_dict()) + _dict['client_dns_server_ips'] = client_dns_server_ips_list if hasattr(self, 'client_idle_timeout') and self.client_idle_timeout is not None: _dict['client_idle_timeout'] = self.client_idle_timeout if hasattr(self, 'client_ip_pool') and self.client_ip_pool is not None: @@ -61721,11 +64161,11 @@ def to_dict(self) -> Dict: _dict['protocol'] = self.protocol 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) + for v in self.subnets: + if isinstance(v, dict): + subnets_list.append(v) else: - subnets_list.append(x.to_dict()) + subnets_list.append(v.to_dict()) _dict['subnets'] = subnets_list return _dict @@ -61831,7 +64271,8 @@ class VPNServerRoute(): :attr str href: The URL for this VPN route. :attr str id: The unique identifier for this VPN route. :attr str lifecycle_state: The lifecycle state of the VPN route. - :attr str name: The user-defined name for this VPN route. + :attr str name: The name for this VPN route. The name is unique across all + routes for a VPN server. :attr str resource_type: The resource type. """ @@ -61865,7 +64306,8 @@ def __init__(self, :param str href: The URL for this VPN route. :param str id: The unique identifier for this VPN route. :param str lifecycle_state: The lifecycle state of the VPN route. - :param str name: The user-defined name for this VPN route. + :param str name: The name for this VPN route. The name is unique across all + routes for a VPN server. :param str resource_type: The resource type. """ self.action = action @@ -62052,7 +64494,7 @@ def from_dict(cls, _dict: Dict) -> 'VPNServerRouteCollection': if 'next' in _dict: args['next'] = VPNServerRouteCollectionNext.from_dict(_dict.get('next')) if 'routes' in _dict: - args['routes'] = [VPNServerRoute.from_dict(x) for x in _dict.get('routes')] + args['routes'] = [VPNServerRoute.from_dict(v) for v in _dict.get('routes')] else: raise ValueError('Required property \'routes\' not present in VPNServerRouteCollection JSON') if 'total_count' in _dict: @@ -62070,13 +64512,25 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'first') and self.first is not None: - _dict['first'] = self.first.to_dict() + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit if hasattr(self, 'next') and self.next is not None: - _dict['next'] = self.next.to_dict() + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() if hasattr(self, 'routes') and self.routes is not None: - _dict['routes'] = [x.to_dict() for x in self.routes] + routes_list = [] + for v in self.routes: + if isinstance(v, dict): + routes_list.append(v) + else: + routes_list.append(v.to_dict()) + _dict['routes'] = routes_list if hasattr(self, 'total_count') and self.total_count is not None: _dict['total_count'] = self.total_count return _dict @@ -62216,8 +64670,8 @@ class VPNServerRoutePatch(): """ VPNServerRoutePatch. - :attr str name: (optional) The user-defined name for this VPN route. Names must - be unique within the VPN server the VPN route resides in. + :attr str name: (optional) The name for this VPN server route. The name must not + be used by another route for the VPN server. """ def __init__(self, @@ -62226,8 +64680,8 @@ def __init__(self, """ Initialize a VPNServerRoutePatch object. - :param str name: (optional) The user-defined name for this VPN route. Names - must be unique within the VPN server the VPN route resides in. + :param str name: (optional) The name for this VPN server route. The name + must not be used by another route for the VPN server. """ self.name = name @@ -62290,11 +64744,27 @@ class Volume(): wrap the data encryption key for the volume. This property will be present for volumes with an `encryption` type of `user_managed`. + :attr List[VolumeHealthReason] health_reasons: The reasons for the current + `health_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 health_state: The health of this resource. + - `ok`: No abnormal behavior detected + - `degraded`: Experiencing compromised performance, capacity, or connectivity + - `faulted`: Completely unreachable, inoperative, or otherwise entirely + incapacitated + - `inapplicable`: The health state does not apply because of the current + lifecycle state. A resource with a lifecycle state of `failed` or `deleting` + will have a health state of `inapplicable`. A `pending` resource may also have + this state. :attr str href: The URL for this volume. :attr str id: The unique identifier for this volume. :attr int iops: 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: The unique user-defined name for this volume. + :attr str name: The name for this volume. The name is unique across all volumes + in the region. :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. @@ -62335,6 +64805,8 @@ def __init__(self, created_at: datetime, crn: str, encryption: str, + health_reasons: List['VolumeHealthReason'], + health_state: str, href: str, id: str, iops: int, @@ -62367,12 +64839,29 @@ def __init__(self, :param datetime created_at: The date and time that the volume was created. :param str crn: The CRN for this volume. :param str encryption: The type of encryption used on the volume. + :param List[VolumeHealthReason] health_reasons: The reasons for the current + `health_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 health_state: The health of this resource. + - `ok`: No abnormal behavior detected + - `degraded`: Experiencing compromised performance, capacity, or + connectivity + - `faulted`: Completely unreachable, inoperative, or otherwise entirely + incapacitated + - `inapplicable`: The health state does not apply because of the current + lifecycle state. A resource with a lifecycle state of `failed` or + `deleting` will have a health state of `inapplicable`. A `pending` resource + may also have this state. :param str href: The URL for this volume. :param str id: The unique identifier for this volume. :param int iops: 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: The unique user-defined name for this volume. + :param str name: The name for this volume. The name is unique across all + volumes in the region. :param VolumeProfileReference profile: The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) for @@ -62418,6 +64907,8 @@ def __init__(self, self.crn = crn self.encryption = encryption self.encryption_key = encryption_key + self.health_reasons = health_reasons + self.health_state = health_state self.href = href self.id = id self.iops = iops @@ -62467,6 +64958,14 @@ def from_dict(cls, _dict: Dict) -> 'Volume': raise ValueError('Required property \'encryption\' not present in Volume JSON') if 'encryption_key' in _dict: args['encryption_key'] = EncryptionKeyReference.from_dict(_dict.get('encryption_key')) + if 'health_reasons' in _dict: + args['health_reasons'] = [VolumeHealthReason.from_dict(v) for v in _dict.get('health_reasons')] + else: + raise ValueError('Required property \'health_reasons\' not present in Volume JSON') + if 'health_state' in _dict: + args['health_state'] = _dict.get('health_state') + else: + raise ValueError('Required property \'health_state\' not present in Volume JSON') if 'href' in _dict: args['href'] = _dict.get('href') else: @@ -62502,7 +65001,7 @@ def from_dict(cls, _dict: Dict) -> 'Volume': else: raise ValueError('Required property \'status\' not present in Volume JSON') if 'status_reasons' in _dict: - args['status_reasons'] = [VolumeStatusReason.from_dict(x) for x in _dict.get('status_reasons')] + args['status_reasons'] = [VolumeStatusReason.from_dict(v) for v in _dict.get('status_reasons')] else: raise ValueError('Required property \'status_reasons\' not present in Volume JSON') if 'user_tags' in _dict: @@ -62510,7 +65009,7 @@ def from_dict(cls, _dict: Dict) -> 'Volume': else: raise ValueError('Required property \'user_tags\' not present in Volume JSON') if 'volume_attachments' in _dict: - args['volume_attachments'] = [VolumeAttachmentReferenceVolumeContext.from_dict(x) for x in _dict.get('volume_attachments')] + args['volume_attachments'] = [VolumeAttachmentReferenceVolumeContext.from_dict(v) for v in _dict.get('volume_attachments')] else: raise ValueError('Required property \'volume_attachments\' not present in Volume JSON') if 'zone' in _dict: @@ -62542,7 +65041,20 @@ def to_dict(self) -> Dict: if hasattr(self, 'encryption') and self.encryption is not None: _dict['encryption'] = self.encryption if hasattr(self, 'encryption_key') and self.encryption_key is not None: - _dict['encryption_key'] = self.encryption_key.to_dict() + if isinstance(self.encryption_key, dict): + _dict['encryption_key'] = self.encryption_key + else: + _dict['encryption_key'] = self.encryption_key.to_dict() + if hasattr(self, 'health_reasons') and self.health_reasons is not None: + health_reasons_list = [] + for v in self.health_reasons: + if isinstance(v, dict): + health_reasons_list.append(v) + else: + health_reasons_list.append(v.to_dict()) + _dict['health_reasons'] = health_reasons_list + if hasattr(self, 'health_state') and self.health_state is not None: + _dict['health_state'] = self.health_state if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -62552,25 +65064,55 @@ def to_dict(self) -> Dict: if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'operating_system') and self.operating_system is not None: - _dict['operating_system'] = self.operating_system.to_dict() + if isinstance(self.operating_system, dict): + _dict['operating_system'] = self.operating_system + else: + _dict['operating_system'] = self.operating_system.to_dict() if hasattr(self, 'profile') and self.profile is not None: - _dict['profile'] = self.profile.to_dict() + 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 isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() if hasattr(self, 'source_image') and self.source_image is not None: - _dict['source_image'] = self.source_image.to_dict() + if isinstance(self.source_image, dict): + _dict['source_image'] = self.source_image + else: + _dict['source_image'] = self.source_image.to_dict() if hasattr(self, 'source_snapshot') and self.source_snapshot is not None: - _dict['source_snapshot'] = self.source_snapshot.to_dict() + if isinstance(self.source_snapshot, dict): + _dict['source_snapshot'] = self.source_snapshot + else: + _dict['source_snapshot'] = self.source_snapshot.to_dict() if hasattr(self, 'status') and self.status is not None: _dict['status'] = self.status if hasattr(self, 'status_reasons') and self.status_reasons is not None: - _dict['status_reasons'] = [x.to_dict() for x in self.status_reasons] + status_reasons_list = [] + for v in self.status_reasons: + if isinstance(v, dict): + status_reasons_list.append(v) + else: + status_reasons_list.append(v.to_dict()) + _dict['status_reasons'] = status_reasons_list if hasattr(self, 'user_tags') and self.user_tags is not None: _dict['user_tags'] = self.user_tags if hasattr(self, 'volume_attachments') and self.volume_attachments is not None: - _dict['volume_attachments'] = [x.to_dict() for x in self.volume_attachments] + volume_attachments_list = [] + for v in self.volume_attachments: + if isinstance(v, dict): + volume_attachments_list.append(v) + else: + volume_attachments_list.append(v.to_dict()) + _dict['volume_attachments'] = volume_attachments_list if hasattr(self, 'zone') and self.zone is not None: - _dict['zone'] = self.zone.to_dict() + if isinstance(self.zone, dict): + _dict['zone'] = self.zone + else: + _dict['zone'] = self.zone.to_dict() return _dict def _to_dict(self): @@ -62599,6 +65141,23 @@ class EncryptionEnum(str, Enum): USER_MANAGED = 'user_managed' + class HealthStateEnum(str, Enum): + """ + The health of this resource. + - `ok`: No abnormal behavior detected + - `degraded`: Experiencing compromised performance, capacity, or connectivity + - `faulted`: Completely unreachable, inoperative, or otherwise entirely + incapacitated + - `inapplicable`: The health state does not apply because of the current lifecycle + state. A resource with a lifecycle state of `failed` or `deleting` will have a + health state of `inapplicable`. A `pending` resource may also have this state. + """ + DEGRADED = 'degraded' + FAULTED = 'faulted' + INAPPLICABLE = 'inapplicable' + OK = 'ok' + + class StatusEnum(str, Enum): """ The status of the volume. @@ -62623,15 +65182,16 @@ class VolumeAttachment(): volume when attached to this instance. This may be lower than the volume bandwidth depending on the configuration of the instance. :attr datetime created_at: The date and time that the volume was attached. - :attr bool delete_volume_on_instance_delete: If set to true, when deleting the - instance the volume will also be deleted. + :attr bool delete_volume_on_instance_delete: Indicates whether deleting the + instance will also delete the attached volume. :attr 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`. :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 str name: The name for this volume attachment. The name is unique across + all volume attachments on the instance. :attr str status: The status of this volume attachment. :attr str type: The type of volume attachment. :attr VolumeReference volume: (optional) The attached volume. @@ -62657,11 +65217,12 @@ def __init__(self, the volume when attached to this instance. This may be lower than the volume bandwidth depending on the configuration of the instance. :param datetime created_at: The date and time that the volume was attached. - :param bool delete_volume_on_instance_delete: If set to true, when deleting - the instance the volume will also be deleted. + :param bool delete_volume_on_instance_delete: Indicates whether deleting + the instance will also delete the attached volume. :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 str name: The name for this volume attachment. The name is unique + across all volume attachments on the instance. :param str status: The status of this volume attachment. :param str type: The type of volume attachment. :param VolumeAttachmentDevice device: (optional) Information about how the @@ -62739,7 +65300,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'delete_volume_on_instance_delete') and self.delete_volume_on_instance_delete is not None: _dict['delete_volume_on_instance_delete'] = self.delete_volume_on_instance_delete if hasattr(self, 'device') and self.device is not None: - _dict['device'] = self.device.to_dict() + if isinstance(self.device, dict): + _dict['device'] = self.device + else: + _dict['device'] = self.device.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: @@ -62751,7 +65315,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'type') and self.type is not None: _dict['type'] = self.type if hasattr(self, 'volume') and self.volume is not None: - _dict['volume'] = self.volume.to_dict() + if isinstance(self.volume, dict): + _dict['volume'] = self.volume + else: + _dict['volume'] = self.volume.to_dict() return _dict def _to_dict(self): @@ -62813,7 +65380,7 @@ def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentCollection': """Initialize a VolumeAttachmentCollection object from a json dictionary.""" args = {} if 'volume_attachments' in _dict: - args['volume_attachments'] = [VolumeAttachment.from_dict(x) for x in _dict.get('volume_attachments')] + args['volume_attachments'] = [VolumeAttachment.from_dict(v) for v in _dict.get('volume_attachments')] else: raise ValueError('Required property \'volume_attachments\' not present in VolumeAttachmentCollection JSON') return cls(**args) @@ -62827,7 +65394,13 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'volume_attachments') and self.volume_attachments is not None: - _dict['volume_attachments'] = [x.to_dict() for x in self.volume_attachments] + volume_attachments_list = [] + for v in self.volume_attachments: + if isinstance(v, dict): + volume_attachments_list.append(v) + else: + volume_attachments_list.append(v.to_dict()) + _dict['volume_attachments'] = volume_attachments_list return _dict def _to_dict(self): @@ -62909,10 +65482,10 @@ class VolumeAttachmentPatch(): """ VolumeAttachmentPatch. - :attr bool delete_volume_on_instance_delete: (optional) If set to true, when - deleting the instance the volume will also be deleted. - :attr str name: (optional) The user-defined name for this volume attachment. - Names must be unique within the instance the volume attachment resides in. + :attr bool delete_volume_on_instance_delete: (optional) Indicates whether + deleting the instance will also delete the attached volume. + :attr str name: (optional) The name for this volume attachment. The name must + not be used by another volume attachment on the instance. """ def __init__(self, @@ -62922,11 +65495,10 @@ def __init__(self, """ Initialize a VolumeAttachmentPatch object. - :param bool delete_volume_on_instance_delete: (optional) If set to true, - when deleting the instance the volume will also be deleted. - :param str name: (optional) The user-defined name for this volume - attachment. Names must be unique within the instance the volume attachment - resides in. + :param bool delete_volume_on_instance_delete: (optional) Indicates whether + deleting the instance will also delete the attached volume. + :param str name: (optional) The name for this volume attachment. The name + must not be used by another volume attachment on the instance. """ self.delete_volume_on_instance_delete = delete_volume_on_instance_delete self.name = name @@ -62973,55 +65545,56 @@ def __ne__(self, other: 'VolumeAttachmentPatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class VolumeAttachmentPrototypeInstanceByImageContext(): +class VolumeAttachmentPrototype(): """ - VolumeAttachmentPrototypeInstanceByImageContext. + VolumeAttachmentPrototype. - :attr bool delete_volume_on_instance_delete: (optional) If set to true, when - deleting the instance the volume will also be deleted. - :attr str name: (optional) The user-defined name for this volume attachment. - Names must be unique within the instance the volume attachment resides in. - :attr VolumePrototypeInstanceByImageContext volume: A prototype object for a new - volume. + :attr bool delete_volume_on_instance_delete: (optional) Indicates whether + deleting the instance will also delete the attached volume. + :attr str name: (optional) The name for this volume attachment. The name must + not be used by another volume attachment on the instance. If unspecified, the + name will be a hyphenated list of randomly-selected words. + :attr VolumeAttachmentPrototypeVolume volume: An existing volume to attach to + the instance, or a prototype object for a new volume. """ def __init__(self, - volume: 'VolumePrototypeInstanceByImageContext', + volume: 'VolumeAttachmentPrototypeVolume', *, delete_volume_on_instance_delete: bool = None, name: str = None) -> None: """ - Initialize a VolumeAttachmentPrototypeInstanceByImageContext object. + Initialize a VolumeAttachmentPrototype object. - :param VolumePrototypeInstanceByImageContext volume: A prototype object for - a new volume. - :param bool delete_volume_on_instance_delete: (optional) If set to true, - when deleting the instance the volume will also be deleted. - :param str name: (optional) The user-defined name for this volume - attachment. Names must be unique within the instance the volume attachment - resides in. + :param VolumeAttachmentPrototypeVolume volume: An existing volume to attach + to the instance, or a prototype object for a new volume. + :param bool delete_volume_on_instance_delete: (optional) Indicates whether + deleting the instance will also delete the attached volume. + :param str name: (optional) The name for this volume attachment. The name + must not be used by another volume attachment on the instance. If + unspecified, the name will be a hyphenated list of randomly-selected words. """ self.delete_volume_on_instance_delete = delete_volume_on_instance_delete self.name = name self.volume = volume @classmethod - def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentPrototypeInstanceByImageContext': - """Initialize a VolumeAttachmentPrototypeInstanceByImageContext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentPrototype': + """Initialize a VolumeAttachmentPrototype object from a json dictionary.""" args = {} if 'delete_volume_on_instance_delete' in _dict: args['delete_volume_on_instance_delete'] = _dict.get('delete_volume_on_instance_delete') if 'name' in _dict: args['name'] = _dict.get('name') if 'volume' in _dict: - args['volume'] = VolumePrototypeInstanceByImageContext.from_dict(_dict.get('volume')) + args['volume'] = _dict.get('volume') else: - raise ValueError('Required property \'volume\' not present in VolumeAttachmentPrototypeInstanceByImageContext JSON') + raise ValueError('Required property \'volume\' not present in VolumeAttachmentPrototype JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VolumeAttachmentPrototypeInstanceByImageContext object from a json dictionary.""" + """Initialize a VolumeAttachmentPrototype object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -63032,7 +65605,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'volume') and self.volume is not None: - _dict['volume'] = self.volume.to_dict() + if isinstance(self.volume, dict): + _dict['volume'] = self.volume + else: + _dict['volume'] = self.volume.to_dict() return _dict def _to_dict(self): @@ -63040,68 +65616,69 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VolumeAttachmentPrototypeInstanceByImageContext object.""" + """Return a `str` version of this VolumeAttachmentPrototype object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VolumeAttachmentPrototypeInstanceByImageContext') -> bool: + def __eq__(self, other: 'VolumeAttachmentPrototype') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'VolumeAttachmentPrototypeInstanceByImageContext') -> bool: + def __ne__(self, other: 'VolumeAttachmentPrototype') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class VolumeAttachmentPrototypeInstanceBySourceSnapshotContext(): +class VolumeAttachmentPrototypeInstanceByImageContext(): """ - VolumeAttachmentPrototypeInstanceBySourceSnapshotContext. + VolumeAttachmentPrototypeInstanceByImageContext. - :attr bool delete_volume_on_instance_delete: (optional) If set to true, when - deleting the instance the volume will also be deleted. - :attr str name: (optional) The user-defined name for this volume attachment. - Names must be unique within the instance the volume attachment resides in. - :attr VolumePrototypeInstanceBySourceSnapshotContext volume: A prototype object - for a new volume from a snapshot. + :attr bool delete_volume_on_instance_delete: (optional) Indicates whether + deleting the instance will also delete the attached volume. + :attr str name: (optional) The name for this volume attachment. The name must + not be used by another volume attachment on the instance. If unspecified, the + name will be a hyphenated list of randomly-selected words. + :attr VolumePrototypeInstanceByImageContext volume: A prototype object for a new + volume. """ def __init__(self, - volume: 'VolumePrototypeInstanceBySourceSnapshotContext', + volume: 'VolumePrototypeInstanceByImageContext', *, delete_volume_on_instance_delete: bool = None, name: str = None) -> None: """ - Initialize a VolumeAttachmentPrototypeInstanceBySourceSnapshotContext object. + Initialize a VolumeAttachmentPrototypeInstanceByImageContext object. - :param VolumePrototypeInstanceBySourceSnapshotContext volume: A prototype - object for a new volume from a snapshot. - :param bool delete_volume_on_instance_delete: (optional) If set to true, - when deleting the instance the volume will also be deleted. - :param str name: (optional) The user-defined name for this volume - attachment. Names must be unique within the instance the volume attachment - resides in. + :param VolumePrototypeInstanceByImageContext volume: A prototype object for + a new volume. + :param bool delete_volume_on_instance_delete: (optional) Indicates whether + deleting the instance will also delete the attached volume. + :param str name: (optional) The name for this volume attachment. The name + must not be used by another volume attachment on the instance. If + unspecified, the name will be a hyphenated list of randomly-selected words. """ self.delete_volume_on_instance_delete = delete_volume_on_instance_delete self.name = name self.volume = volume @classmethod - def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentPrototypeInstanceBySourceSnapshotContext': - """Initialize a VolumeAttachmentPrototypeInstanceBySourceSnapshotContext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentPrototypeInstanceByImageContext': + """Initialize a VolumeAttachmentPrototypeInstanceByImageContext object from a json dictionary.""" args = {} if 'delete_volume_on_instance_delete' in _dict: args['delete_volume_on_instance_delete'] = _dict.get('delete_volume_on_instance_delete') if 'name' in _dict: args['name'] = _dict.get('name') if 'volume' in _dict: - args['volume'] = VolumePrototypeInstanceBySourceSnapshotContext.from_dict(_dict.get('volume')) + args['volume'] = VolumePrototypeInstanceByImageContext.from_dict(_dict.get('volume')) else: - raise ValueError('Required property \'volume\' not present in VolumeAttachmentPrototypeInstanceBySourceSnapshotContext JSON') + raise ValueError('Required property \'volume\' not present in VolumeAttachmentPrototypeInstanceByImageContext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VolumeAttachmentPrototypeInstanceBySourceSnapshotContext object from a json dictionary.""" + """Initialize a VolumeAttachmentPrototypeInstanceByImageContext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -63112,7 +65689,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'volume') and self.volume is not None: - _dict['volume'] = self.volume.to_dict() + if isinstance(self.volume, dict): + _dict['volume'] = self.volume + else: + _dict['volume'] = self.volume.to_dict() return _dict def _to_dict(self): @@ -63120,68 +65700,69 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VolumeAttachmentPrototypeInstanceBySourceSnapshotContext object.""" + """Return a `str` version of this VolumeAttachmentPrototypeInstanceByImageContext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VolumeAttachmentPrototypeInstanceBySourceSnapshotContext') -> bool: + def __eq__(self, other: 'VolumeAttachmentPrototypeInstanceByImageContext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'VolumeAttachmentPrototypeInstanceBySourceSnapshotContext') -> bool: + def __ne__(self, other: 'VolumeAttachmentPrototypeInstanceByImageContext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class VolumeAttachmentPrototypeInstanceContext(): +class VolumeAttachmentPrototypeInstanceBySourceSnapshotContext(): """ - VolumeAttachmentPrototypeInstanceContext. + VolumeAttachmentPrototypeInstanceBySourceSnapshotContext. - :attr bool delete_volume_on_instance_delete: (optional) If set to true, when - deleting the instance the volume will also be deleted. - :attr str name: (optional) The user-defined name for this volume attachment. - Names must be unique within the instance the volume attachment resides in. - :attr VolumeAttachmentVolumePrototypeInstanceContext volume: An existing volume - to attach to the instance, or a prototype object for a new volume. + :attr bool delete_volume_on_instance_delete: (optional) Indicates whether + deleting the instance will also delete the attached volume. + :attr str name: (optional) The name for this volume attachment. The name must + not be used by another volume attachment on the instance. If unspecified, the + name will be a hyphenated list of randomly-selected words. + :attr VolumePrototypeInstanceBySourceSnapshotContext volume: A prototype object + for a new volume from a snapshot. """ def __init__(self, - volume: 'VolumeAttachmentVolumePrototypeInstanceContext', + volume: 'VolumePrototypeInstanceBySourceSnapshotContext', *, delete_volume_on_instance_delete: bool = None, name: str = None) -> None: """ - Initialize a VolumeAttachmentPrototypeInstanceContext object. + Initialize a VolumeAttachmentPrototypeInstanceBySourceSnapshotContext object. - :param VolumeAttachmentVolumePrototypeInstanceContext volume: An existing - volume to attach to the instance, or a prototype object for a new volume. - :param bool delete_volume_on_instance_delete: (optional) If set to true, - when deleting the instance the volume will also be deleted. - :param str name: (optional) The user-defined name for this volume - attachment. Names must be unique within the instance the volume attachment - resides in. + :param VolumePrototypeInstanceBySourceSnapshotContext volume: A prototype + object for a new volume from a snapshot. + :param bool delete_volume_on_instance_delete: (optional) Indicates whether + deleting the instance will also delete the attached volume. + :param str name: (optional) The name for this volume attachment. The name + must not be used by another volume attachment on the instance. If + unspecified, the name will be a hyphenated list of randomly-selected words. """ self.delete_volume_on_instance_delete = delete_volume_on_instance_delete self.name = name self.volume = volume @classmethod - def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentPrototypeInstanceContext': - """Initialize a VolumeAttachmentPrototypeInstanceContext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentPrototypeInstanceBySourceSnapshotContext': + """Initialize a VolumeAttachmentPrototypeInstanceBySourceSnapshotContext object from a json dictionary.""" args = {} if 'delete_volume_on_instance_delete' in _dict: args['delete_volume_on_instance_delete'] = _dict.get('delete_volume_on_instance_delete') if 'name' in _dict: args['name'] = _dict.get('name') if 'volume' in _dict: - args['volume'] = _dict.get('volume') + args['volume'] = VolumePrototypeInstanceBySourceSnapshotContext.from_dict(_dict.get('volume')) else: - raise ValueError('Required property \'volume\' not present in VolumeAttachmentPrototypeInstanceContext JSON') + raise ValueError('Required property \'volume\' not present in VolumeAttachmentPrototypeInstanceBySourceSnapshotContext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VolumeAttachmentPrototypeInstanceContext object from a json dictionary.""" + """Initialize a VolumeAttachmentPrototypeInstanceBySourceSnapshotContext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -63203,16 +65784,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VolumeAttachmentPrototypeInstanceContext object.""" + """Return a `str` version of this VolumeAttachmentPrototypeInstanceBySourceSnapshotContext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VolumeAttachmentPrototypeInstanceContext') -> bool: + def __eq__(self, other: 'VolumeAttachmentPrototypeInstanceBySourceSnapshotContext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'VolumeAttachmentPrototypeInstanceContext') -> bool: + def __ne__(self, other: 'VolumeAttachmentPrototypeInstanceBySourceSnapshotContext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -63245,7 +65826,8 @@ class VolumeAttachmentReferenceInstanceContext(): `attached`. :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 str name: The name for this volume attachment. The name is unique across + all volume attachments on the instance. :attr VolumeReference volume: (optional) The attached volume. This property will be absent if the volume has not yet been provisioned. """ @@ -63263,7 +65845,8 @@ def __init__(self, :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 str name: The name for this volume attachment. The name is unique + across all volume attachments on the instance. :param VolumeAttachmentReferenceInstanceContextDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and provides @@ -63315,9 +65898,15 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'device') and self.device is not None: - _dict['device'] = self.device.to_dict() + if isinstance(self.device, dict): + _dict['device'] = self.device + else: + _dict['device'] = self.device.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: @@ -63325,7 +65914,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'volume') and self.volume is not None: - _dict['volume'] = self.volume.to_dict() + if isinstance(self.volume, dict): + _dict['volume'] = self.volume + else: + _dict['volume'] = self.volume.to_dict() return _dict def _to_dict(self): @@ -63407,8 +65999,8 @@ class VolumeAttachmentReferenceVolumeContext(): """ VolumeAttachmentReferenceVolumeContext. - :attr bool delete_volume_on_instance_delete: If set to true, when deleting the - instance the volume will also be deleted. + :attr bool delete_volume_on_instance_delete: Indicates whether deleting the + instance will also delete the attached volume. :attr VolumeAttachmentReferenceVolumeContextDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and provides @@ -63420,7 +66012,8 @@ class VolumeAttachmentReferenceVolumeContext(): :attr str href: The URL for this volume attachment. :attr str id: The unique identifier for this volume attachment. :attr InstanceReference instance: The attached instance. - :attr str name: The user-defined name for this volume attachment. + :attr str name: The name for this volume attachment. The name is unique across + all volume attachments on the instance. :attr str type: The type of volume attachment. """ @@ -63437,12 +66030,13 @@ def __init__(self, """ Initialize a VolumeAttachmentReferenceVolumeContext object. - :param bool delete_volume_on_instance_delete: If set to true, when deleting - the instance the volume will also be deleted. + :param bool delete_volume_on_instance_delete: Indicates whether deleting + the instance will also delete the attached volume. :param str href: The URL for this volume attachment. :param str id: The unique identifier for this volume attachment. :param InstanceReference instance: The attached instance. - :param str name: The user-defined name for this volume attachment. + :param str name: The name for this volume attachment. The name is unique + across all volume attachments on the instance. :param str type: The type of volume attachment. :param VolumeAttachmentReferenceVolumeContextDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, @@ -63507,15 +66101,24 @@ def to_dict(self) -> Dict: if hasattr(self, 'delete_volume_on_instance_delete') and self.delete_volume_on_instance_delete is not None: _dict['delete_volume_on_instance_delete'] = self.delete_volume_on_instance_delete if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'device') and self.device is not None: - _dict['device'] = self.device.to_dict() + if isinstance(self.device, dict): + _dict['device'] = self.device + else: + _dict['device'] = self.device.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, 'instance') and self.instance is not None: - _dict['instance'] = self.instance.to_dict() + if isinstance(self.instance, dict): + _dict['instance'] = self.instance + else: + _dict['instance'] = self.instance.to_dict() if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'type') and self.type is not None: @@ -63605,21 +66208,6 @@ def __ne__(self, other: 'VolumeAttachmentReferenceVolumeContextDeleted') -> bool """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class VolumeAttachmentVolumePrototypeInstanceContext(): - """ - An existing volume to attach to the instance, or a prototype object for a new volume. - - """ - - def __init__(self) -> None: - """ - Initialize a VolumeAttachmentVolumePrototypeInstanceContext object. - - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentity', 'VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContext'])) - raise Exception(msg) - class VolumeCollection(): """ VolumeCollection. @@ -63670,7 +66258,7 @@ def from_dict(cls, _dict: Dict) -> 'VolumeCollection': if 'next' in _dict: args['next'] = VolumeCollectionNext.from_dict(_dict.get('next')) if 'volumes' in _dict: - args['volumes'] = [Volume.from_dict(x) for x in _dict.get('volumes')] + args['volumes'] = [Volume.from_dict(v) for v in _dict.get('volumes')] else: raise ValueError('Required property \'volumes\' not present in VolumeCollection JSON') return cls(**args) @@ -63684,13 +66272,25 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'first') and self.first is not None: - _dict['first'] = self.first.to_dict() + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit if hasattr(self, 'next') and self.next is not None: - _dict['next'] = self.next.to_dict() + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() if hasattr(self, 'volumes') and self.volumes is not None: - _dict['volumes'] = [x.to_dict() for x in self.volumes] + volumes_list = [] + for v in self.volumes: + if isinstance(v, dict): + volumes_list.append(v) + else: + volumes_list.append(v.to_dict()) + _dict['volumes'] = volumes_list return _dict def _to_dict(self): @@ -63824,6 +66424,92 @@ def __ne__(self, other: 'VolumeCollectionNext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other +class VolumeHealthReason(): + """ + VolumeHealthReason. + + :attr str code: A snake case string succinctly identifying the reason for this + health state. + :attr str message: An explanation of the reason for this health state. + :attr str more_info: (optional) Link to documentation about the reason for this + health state. + """ + + def __init__(self, + code: str, + message: str, + *, + more_info: str = None) -> None: + """ + Initialize a VolumeHealthReason object. + + :param str code: A snake case string succinctly identifying the reason for + this health state. + :param str message: An explanation of the reason for this health state. + :param str more_info: (optional) Link to documentation about the reason for + this health state. + """ + self.code = code + self.message = message + self.more_info = more_info + + @classmethod + def from_dict(cls, _dict: Dict) -> 'VolumeHealthReason': + """Initialize a VolumeHealthReason object from a json dictionary.""" + args = {} + if 'code' in _dict: + args['code'] = _dict.get('code') + else: + raise ValueError('Required property \'code\' not present in VolumeHealthReason JSON') + if 'message' in _dict: + args['message'] = _dict.get('message') + else: + raise ValueError('Required property \'message\' not present in VolumeHealthReason JSON') + if 'more_info' in _dict: + args['more_info'] = _dict.get('more_info') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a VolumeHealthReason object from 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 VolumeHealthReason object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'VolumeHealthReason') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'VolumeHealthReason') -> 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 health state. + """ + INITIALIZING_FROM_SNAPSHOT = 'initializing_from_snapshot' + + class VolumeIdentity(): """ Identifies a volume by a unique property. @@ -63854,7 +66540,8 @@ class VolumePatch(): for the volume. Applicable only to volumes using a profile `family` of `custom`. The volume must be attached as a data volume to a running virtual server instance. - :attr str name: (optional) The unique user-defined name for this volume. + :attr str name: (optional) The name for this volume. The name must not be used + by another volume in the region. :attr VolumeProfileIdentity profile: (optional) The profile to use for this volume. The requested profile must be in the same `family` as the current profile. The volume must be attached as a data volume to @@ -63887,7 +66574,8 @@ def __init__(self, use for the volume. Applicable only to volumes using a profile `family` of `custom`. The volume must be attached as a data volume to a running virtual server instance. - :param str name: (optional) The unique user-defined name for this volume. + :param str name: (optional) The name for this volume. The name must not be + used by another volume in the region. :param VolumeProfileIdentity profile: (optional) The profile to use for this volume. The requested profile must be in the same `family` as the current profile. The volume must be attached as a data @@ -64113,7 +66801,7 @@ def from_dict(cls, _dict: Dict) -> 'VolumeProfileCollection': if 'next' in _dict: args['next'] = VolumeProfileCollectionNext.from_dict(_dict.get('next')) if 'profiles' in _dict: - args['profiles'] = [VolumeProfile.from_dict(x) for x in _dict.get('profiles')] + args['profiles'] = [VolumeProfile.from_dict(v) for v in _dict.get('profiles')] else: raise ValueError('Required property \'profiles\' not present in VolumeProfileCollection JSON') if 'total_count' in _dict: @@ -64131,13 +66819,25 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'first') and self.first is not None: - _dict['first'] = self.first.to_dict() + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit if hasattr(self, 'next') and self.next is not None: - _dict['next'] = self.next.to_dict() + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() if hasattr(self, 'profiles') and self.profiles is not None: - _dict['profiles'] = [x.to_dict() for x in self.profiles] + profiles_list = [] + for v in self.profiles: + if isinstance(v, dict): + profiles_list.append(v) + else: + profiles_list.append(v.to_dict()) + _dict['profiles'] = profiles_list if hasattr(self, 'total_count') and self.total_count is not None: _dict['total_count'] = self.total_count return _dict @@ -64360,7 +67060,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 str name: (optional) The name for this volume. The name must not be used + by another volume in the region. If unspecified, the name will be a hyphenated + list of randomly-selected words. :attr VolumeProfileIdentity profile: The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to use for this volume. @@ -64392,7 +67094,9 @@ def __init__(self, :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 str name: (optional) The name for this volume. The name must not be + used by another volume in the region. If unspecified, the name will be a + hyphenated list of randomly-selected words. :param ResourceGroupIdentity resource_group: (optional) The resource group to use. If unspecified, the account's [default resource group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is @@ -64418,7 +67122,9 @@ class VolumePrototypeInstanceByImageContext(): 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 str name: (optional) The name for this volume. The name must not be used + by another volume in the region. If unspecified, the name will be a hyphenated + list of randomly-selected words. :attr VolumeProfileIdentity profile: The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to use for this volume. @@ -64454,7 +67160,9 @@ def __init__(self, :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 str name: (optional) The name for this volume. The name must not be + used by another volume in the region. If unspecified, the name will be a + hyphenated list of randomly-selected words. :param List[str] user_tags: (optional) The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this volume. @@ -64545,7 +67253,9 @@ class VolumePrototypeInstanceBySourceSnapshotContext(): 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 str name: (optional) The name for this volume. The name must not be used + by another volume in the region. If unspecified, the name will be a hyphenated + list of randomly-selected words. :attr VolumeProfileIdentity profile: The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to use for this volume. @@ -64586,7 +67296,9 @@ def __init__(self, :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 str name: (optional) The name for this volume. The name must not be + used by another volume in the region. If unspecified, the name will be a + hyphenated list of randomly-selected words. :param List[str] user_tags: (optional) The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this volume. @@ -64684,7 +67396,8 @@ class VolumeReference(): some supplementary information. :attr str href: The URL for this volume. :attr str id: The unique identifier for this volume. - :attr str name: The unique user-defined name for this volume. + :attr str name: The name for this volume. The name is unique across all volumes + in the region. """ def __init__(self, @@ -64700,7 +67413,8 @@ def __init__(self, :param str crn: The CRN for this volume. :param str href: The URL for this volume. :param str id: The unique identifier for this volume. - :param str name: The unique user-defined name for this volume. + :param str name: The name for this volume. The name is unique across all + volumes in the region. :param VolumeReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and provides some supplementary information. @@ -64746,7 +67460,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'crn') and self.crn is not None: _dict['crn'] = self.crn if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -64977,7 +67694,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'region') and self.region is not None: - _dict['region'] = self.region.to_dict() + if isinstance(self.region, dict): + _dict['region'] = self.region + else: + _dict['region'] = self.region.to_dict() if hasattr(self, 'status') and self.status is not None: _dict['status'] = self.status return _dict @@ -65030,7 +67750,7 @@ def from_dict(cls, _dict: Dict) -> 'ZoneCollection': """Initialize a ZoneCollection object from a json dictionary.""" args = {} if 'zones' in _dict: - args['zones'] = [Zone.from_dict(x) for x in _dict.get('zones')] + args['zones'] = [Zone.from_dict(v) for v in _dict.get('zones')] else: raise ValueError('Required property \'zones\' not present in ZoneCollection JSON') return cls(**args) @@ -65044,7 +67764,13 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'zones') and self.zones is not None: - _dict['zones'] = [x.to_dict() for x in self.zones] + zones_list = [] + for v in self.zones: + if isinstance(v, dict): + zones_list.append(v) + else: + zones_list.append(v.to_dict()) + _dict['zones'] = zones_list return _dict def _to_dict(self): @@ -65146,6 +67872,111 @@ def __ne__(self, other: 'ZoneReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other +class BackupPolicyJobSourceVolumeReference(BackupPolicyJobSource): + """ + BackupPolicyJobSourceVolumeReference. + + :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 + some supplementary information. + :attr str href: The URL for this volume. + :attr str id: The unique identifier for this volume. + :attr str name: The name for this volume. The name is unique across all volumes + in the region. + """ + + def __init__(self, + crn: str, + href: str, + id: str, + name: str, + *, + deleted: 'VolumeReferenceDeleted' = None) -> None: + """ + Initialize a BackupPolicyJobSourceVolumeReference object. + + :param str crn: The CRN for this volume. + :param str href: The URL for this volume. + :param str id: The unique identifier for this volume. + :param str name: The name for this volume. The name is unique across all + volumes in the region. + :param VolumeReferenceDeleted deleted: (optional) If present, this property + indicates the referenced resource has been deleted, and provides + some supplementary information. + """ + # pylint: disable=super-init-not-called + self.crn = crn + self.deleted = deleted + self.href = href + self.id = id + self.name = name + + @classmethod + def from_dict(cls, _dict: Dict) -> 'BackupPolicyJobSourceVolumeReference': + """Initialize a BackupPolicyJobSourceVolumeReference object from a json dictionary.""" + args = {} + if 'crn' in _dict: + args['crn'] = _dict.get('crn') + else: + raise ValueError('Required property \'crn\' not present in BackupPolicyJobSourceVolumeReference JSON') + if 'deleted' in _dict: + args['deleted'] = VolumeReferenceDeleted.from_dict(_dict.get('deleted')) + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in BackupPolicyJobSourceVolumeReference JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in BackupPolicyJobSourceVolumeReference JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in BackupPolicyJobSourceVolumeReference JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a BackupPolicyJobSourceVolumeReference object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn + if hasattr(self, 'deleted') and self.deleted is not None: + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + 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 BackupPolicyJobSourceVolumeReference object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'BackupPolicyJobSourceVolumeReference') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'BackupPolicyJobSourceVolumeReference') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + class BareMetalServerBootTargetBareMetalServerDiskReference(BareMetalServerBootTarget): """ BareMetalServerBootTargetBareMetalServerDiskReference. @@ -65155,7 +67986,8 @@ class BareMetalServerBootTargetBareMetalServerDiskReference(BareMetalServerBootT 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. - :attr str name: The user-defined name for this disk. + :attr str name: The name for this bare metal server disk. The name is unique + across all disks on the bare metal server. :attr str resource_type: The resource type. """ @@ -65171,7 +68003,8 @@ 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 name: The user-defined name for this disk. + :param str name: The name for this bare metal server disk. The name is + unique across all disks on the bare metal server. :param str resource_type: The resource type. :param BareMetalServerDiskReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and @@ -65218,7 +68051,10 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -65321,7 +68157,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'encrypted_password') and self.encrypted_password is not None: _dict['encrypted_password'] = str(base64.b64encode(self.encrypted_password), 'utf-8') if hasattr(self, 'encryption_key') and self.encryption_key is not None: - _dict['encryption_key'] = self.encryption_key.to_dict() + if isinstance(self.encryption_key, dict): + _dict['encryption_key'] = self.encryption_key + else: + _dict['encryption_key'] = self.encryption_key.to_dict() if hasattr(self, 'resource_type') and self.resource_type is not None: _dict['resource_type'] = self.resource_type if hasattr(self, 'username') and self.username is not None: @@ -65377,7 +68216,7 @@ class BareMetalServerNetworkInterfaceByHiperSocket(BareMetalServerNetworkInterfa :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 str name: The 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. @@ -65430,7 +68269,7 @@ def __init__(self, :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 str name: The 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. @@ -65480,7 +68319,7 @@ def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfaceByHiperSocket 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')] + args['floating_ips'] = [FloatingIPReference.from_dict(v) for v in _dict.get('floating_ips')] if 'href' in _dict: args['href'] = _dict.get('href') else: @@ -65510,7 +68349,7 @@ def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfaceByHiperSocket 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')] + args['security_groups'] = [SecurityGroupReference.from_dict(v) for v in _dict.get('security_groups')] else: raise ValueError('Required property \'security_groups\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON') if 'status' in _dict: @@ -65546,7 +68385,13 @@ def to_dict(self) -> Dict: 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] + floating_ips_list = [] + for v in self.floating_ips: + if isinstance(v, dict): + floating_ips_list.append(v) + else: + floating_ips_list.append(v.to_dict()) + _dict['floating_ips'] = floating_ips_list if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -65558,15 +68403,27 @@ def to_dict(self) -> Dict: 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 isinstance(self.primary_ip, dict): + _dict['primary_ip'] = self.primary_ip + else: + _dict['primary_ip'] = self.primary_ip.to_dict() if hasattr(self, 'resource_type') and self.resource_type is not None: _dict['resource_type'] = self.resource_type if hasattr(self, 'security_groups') and self.security_groups is not None: - _dict['security_groups'] = [x.to_dict() for x in self.security_groups] + security_groups_list = [] + for v in self.security_groups: + if isinstance(v, dict): + security_groups_list.append(v) + else: + security_groups_list.append(v.to_dict()) + _dict['security_groups'] = security_groups_list if hasattr(self, '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 isinstance(self.subnet, dict): + _dict['subnet'] = self.subnet + else: + _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: @@ -65649,7 +68506,7 @@ class BareMetalServerNetworkInterfaceByPCI(BareMetalServerNetworkInterface): :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 str name: The 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. @@ -65709,7 +68566,7 @@ def __init__(self, :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 str name: The 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. @@ -65766,7 +68623,7 @@ def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfaceByPCI': else: raise ValueError('Required property \'enable_infrastructure_nat\' not present in BareMetalServerNetworkInterfaceByPCI JSON') if 'floating_ips' in _dict: - args['floating_ips'] = [FloatingIPReference.from_dict(x) for x in _dict.get('floating_ips')] + args['floating_ips'] = [FloatingIPReference.from_dict(v) for v in _dict.get('floating_ips')] if 'href' in _dict: args['href'] = _dict.get('href') else: @@ -65796,7 +68653,7 @@ def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfaceByPCI': else: raise ValueError('Required property \'resource_type\' not present in BareMetalServerNetworkInterfaceByPCI JSON') if 'security_groups' in _dict: - args['security_groups'] = [SecurityGroupReference.from_dict(x) for x in _dict.get('security_groups')] + args['security_groups'] = [SecurityGroupReference.from_dict(v) for v in _dict.get('security_groups')] else: raise ValueError('Required property \'security_groups\' not present in BareMetalServerNetworkInterfaceByPCI JSON') if 'status' in _dict: @@ -65836,7 +68693,13 @@ def to_dict(self) -> Dict: 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] + floating_ips_list = [] + for v in self.floating_ips: + if isinstance(v, dict): + floating_ips_list.append(v) + else: + floating_ips_list.append(v.to_dict()) + _dict['floating_ips'] = floating_ips_list if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -65848,15 +68711,27 @@ def to_dict(self) -> Dict: 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 isinstance(self.primary_ip, dict): + _dict['primary_ip'] = self.primary_ip + else: + _dict['primary_ip'] = self.primary_ip.to_dict() if hasattr(self, 'resource_type') and self.resource_type is not None: _dict['resource_type'] = self.resource_type if hasattr(self, 'security_groups') and self.security_groups is not None: - _dict['security_groups'] = [x.to_dict() for x in self.security_groups] + security_groups_list = [] + for v in self.security_groups: + if isinstance(v, dict): + security_groups_list.append(v) + else: + security_groups_list.append(v.to_dict()) + _dict['security_groups'] = security_groups_list if hasattr(self, '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 isinstance(self.subnet, dict): + _dict['subnet'] = self.subnet + else: + _dict['subnet'] = self.subnet.to_dict() if hasattr(self, 'type') and self.type is not None: _dict['type'] = self.type if hasattr(self, 'allowed_vlans') and self.allowed_vlans is not None: @@ -65945,7 +68820,7 @@ class BareMetalServerNetworkInterfaceByVLAN(BareMetalServerNetworkInterface): :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 str name: The 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. @@ -66011,7 +68886,7 @@ def __init__(self, :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 str name: The 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. @@ -66074,7 +68949,7 @@ def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfaceByVLAN': else: raise ValueError('Required property \'enable_infrastructure_nat\' not present in BareMetalServerNetworkInterfaceByVLAN JSON') if 'floating_ips' in _dict: - args['floating_ips'] = [FloatingIPReference.from_dict(x) for x in _dict.get('floating_ips')] + args['floating_ips'] = [FloatingIPReference.from_dict(v) for v in _dict.get('floating_ips')] if 'href' in _dict: args['href'] = _dict.get('href') else: @@ -66104,7 +68979,7 @@ def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfaceByVLAN': else: raise ValueError('Required property \'resource_type\' not present in BareMetalServerNetworkInterfaceByVLAN JSON') if 'security_groups' in _dict: - args['security_groups'] = [SecurityGroupReference.from_dict(x) for x in _dict.get('security_groups')] + args['security_groups'] = [SecurityGroupReference.from_dict(v) for v in _dict.get('security_groups')] else: raise ValueError('Required property \'security_groups\' not present in BareMetalServerNetworkInterfaceByVLAN JSON') if 'status' in _dict: @@ -66148,7 +69023,13 @@ def to_dict(self) -> Dict: 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] + floating_ips_list = [] + for v in self.floating_ips: + if isinstance(v, dict): + floating_ips_list.append(v) + else: + floating_ips_list.append(v.to_dict()) + _dict['floating_ips'] = floating_ips_list if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -66160,15 +69041,27 @@ def to_dict(self) -> Dict: 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 isinstance(self.primary_ip, dict): + _dict['primary_ip'] = self.primary_ip + else: + _dict['primary_ip'] = self.primary_ip.to_dict() if hasattr(self, 'resource_type') and self.resource_type is not None: _dict['resource_type'] = self.resource_type if hasattr(self, 'security_groups') and self.security_groups is not None: - _dict['security_groups'] = [x.to_dict() for x in self.security_groups] + security_groups_list = [] + for v in self.security_groups: + if isinstance(v, dict): + security_groups_list.append(v) + else: + security_groups_list.append(v.to_dict()) + _dict['security_groups'] = security_groups_list if hasattr(self, '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 isinstance(self.subnet, dict): + _dict['subnet'] = self.subnet + else: + _dict['subnet'] = self.subnet.to_dict() if hasattr(self, 'type') and self.type is not None: _dict['type'] = self.type if hasattr(self, 'allow_interface_to_float') and self.allow_interface_to_float is not None: @@ -66251,8 +69144,8 @@ class BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByH - 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 + :attr str name: (optional) The name for this network interface. The name must + not be used by another network interface on the bare metal server. If unspecified, the name will be a hyphenated list of randomly-selected words. :attr NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP address to bind to the network interface. This can be specified using an existing @@ -66301,10 +69194,9 @@ def __init__(self, - 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 str name: (optional) The name for this network interface. The name + must not be used by another network interface on the bare metal server. If + unspecified, the name will be a hyphenated list of randomly-selected words. :param NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP address to bind to the network interface. This can be specified using an existing reserved IP, or a prototype object for a new reserved IP. @@ -66370,11 +69262,11 @@ def to_dict(self) -> Dict: _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) + for v in self.security_groups: + if isinstance(v, dict): + security_groups_list.append(v) else: - security_groups_list.append(x.to_dict()) + security_groups_list.append(v.to_dict()) _dict['security_groups'] = security_groups_list if hasattr(self, 'subnet') and self.subnet is not None: if isinstance(self.subnet, dict): @@ -66429,8 +69321,8 @@ class BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByP - 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 + :attr str name: (optional) The name for this network interface. The name must + not be used by another network interface on the bare metal server. If unspecified, the name will be a hyphenated list of randomly-selected words. :attr NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP address to bind to the network interface. This can be specified using an existing @@ -66490,10 +69382,9 @@ def __init__(self, - 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 str name: (optional) The name for this network interface. The name + must not be used by another network interface on the bare metal server. If + unspecified, the name will be a hyphenated list of randomly-selected words. :param NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP address to bind to the network interface. This can be specified using an existing reserved IP, or a prototype object for a new reserved IP. @@ -66564,11 +69455,11 @@ def to_dict(self) -> Dict: _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) + for v in self.security_groups: + if isinstance(v, dict): + security_groups_list.append(v) else: - security_groups_list.append(x.to_dict()) + security_groups_list.append(v.to_dict()) _dict['security_groups'] = security_groups_list if hasattr(self, 'subnet') and self.subnet is not None: if isinstance(self.subnet, dict): @@ -66629,8 +69520,8 @@ class BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByV - 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 + :attr str name: (optional) The name for this network interface. The name must + not be used by another network interface on the bare metal server. If unspecified, the name will be a hyphenated list of randomly-selected words. :attr NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP address to bind to the network interface. This can be specified using an existing @@ -66698,10 +69589,9 @@ def __init__(self, - 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 str name: (optional) The name for this network interface. The name + must not be used by another network interface on the bare metal server. If + unspecified, the name will be a hyphenated list of randomly-selected words. :param NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP address to bind to the network interface. This can be specified using an existing reserved IP, or a prototype object for a new reserved IP. @@ -66780,11 +69670,11 @@ def to_dict(self) -> Dict: _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) + for v in self.security_groups: + if isinstance(v, dict): + security_groups_list.append(v) else: - security_groups_list.append(x.to_dict()) + security_groups_list.append(v.to_dict()) _dict['security_groups'] = security_groups_list if hasattr(self, 'subnet') and self.subnet is not None: if isinstance(self.subnet, dict): @@ -70365,8 +73255,9 @@ class DedicatedHostPrototypeDedicatedHostByGroup(DedicatedHostPrototype): :attr bool instance_placement_enabled: (optional) If set to true, instances can 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 str name: (optional) The name for this dedicated host. The name must not + be used by another dedicated host in the region. If unspecified, the name will + be a hyphenated list of randomly-selected words. :attr DedicatedHostProfileIdentity profile: The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) to use for this dedicated host. @@ -70392,9 +73283,9 @@ def __init__(self, dedicated host. :param bool instance_placement_enabled: (optional) If set to true, instances can be placed on this dedicated host. - :param 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. + :param str name: (optional) The name for this dedicated host. The name must + not be used by another dedicated host in the region. If unspecified, the + name will be a hyphenated list of randomly-selected words. :param ResourceGroupIdentity resource_group: (optional) """ # pylint: disable=super-init-not-called @@ -70477,8 +73368,9 @@ class DedicatedHostPrototypeDedicatedHostByZone(DedicatedHostPrototype): :attr bool instance_placement_enabled: (optional) If set to true, instances can 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 str name: (optional) The name for this dedicated host. The name must not + be used by another dedicated host in the region. If unspecified, the name will + be a hyphenated list of randomly-selected words. :attr DedicatedHostProfileIdentity profile: The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) to use for this dedicated host. @@ -70504,9 +73396,9 @@ def __init__(self, :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. - :param 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. + :param str name: (optional) The name for this dedicated host. The name must + not be used by another dedicated host in the region. If unspecified, the + name will be a hyphenated list of randomly-selected words. :param ResourceGroupIdentity resource_group: (optional) :param DedicatedHostGroupPrototypeDedicatedHostByZoneContext group: (optional) @@ -70564,7 +73456,10 @@ def to_dict(self) -> Dict: else: _dict['resource_group'] = self.resource_group.to_dict() if hasattr(self, 'group') and self.group is not None: - _dict['group'] = self.group.to_dict() + if isinstance(self.group, dict): + _dict['group'] = self.group + else: + _dict['group'] = self.group.to_dict() if hasattr(self, 'zone') and self.zone is not None: if isinstance(self.zone, dict): _dict['zone'] = self.zone @@ -70682,10 +73577,10 @@ class EndpointGatewayReservedIPReservedIPPrototypeTargetContext(EndpointGatewayR :attr bool auto_delete: (optional) Indicates whether this reserved IP member will be automatically deleted when either `target` is deleted, or the reserved IP is unbound. - :attr str name: (optional) The user-defined name for this reserved IP. If - unspecified, the name will be a hyphenated list of randomly-selected words. - Names must be unique within the subnet the reserved IP resides in. Names - beginning with `ibm-` are reserved for provider-owned resources. + :attr str name: (optional) The name for this reserved IP. The name must not be + used by another reserved IP in the subnet. Names starting with `ibm-` are + reserved for provider-owned resources, and are not allowed. If unspecified, the + name will be a hyphenated list of randomly-selected words. :attr SubnetIdentity subnet: The subnet in which to create this reserved IP. """ @@ -70707,10 +73602,10 @@ def __init__(self, :param bool auto_delete: (optional) Indicates whether this reserved IP member will be automatically deleted when either `target` is deleted, or the reserved IP is unbound. - :param str name: (optional) The user-defined name for this reserved IP. If + :param str name: (optional) The name for this reserved IP. The name must + not be used by another reserved IP in the subnet. Names starting with + `ibm-` are reserved for provider-owned resources, and are not allowed. If unspecified, the name will be a hyphenated list of randomly-selected words. - Names must be unique within the subnet the reserved IP resides in. Names - beginning with `ibm-` are reserved for provider-owned resources. """ # pylint: disable=super-init-not-called self.address = address @@ -71097,8 +73992,9 @@ class FloatingIPPrototypeFloatingIPByTarget(FloatingIPPrototype): """ FloatingIPPrototypeFloatingIPByTarget. - :attr str name: (optional) The unique user-defined name for this floating IP. If - unspecified, the name will be a hyphenated list of randomly-selected words. + :attr str name: (optional) The name for this floating IP. The name must not be + used by another floating IP in the region. If unspecified, the name will be a + hyphenated list of randomly-selected words. :attr ResourceGroupIdentity resource_group: (optional) :attr FloatingIPByTargetNetworkInterfaceIdentity target: The network interface this floating IP is to be bound to. @@ -71114,9 +74010,9 @@ def __init__(self, :param FloatingIPByTargetNetworkInterfaceIdentity target: The network interface this floating IP is to be bound to. - :param str name: (optional) The unique user-defined name for this floating - IP. If unspecified, the name will be a hyphenated list of randomly-selected - words. + :param str name: (optional) The name for this floating IP. The name must + not be used by another floating IP in the region. If unspecified, the name + will be a hyphenated list of randomly-selected words. :param ResourceGroupIdentity resource_group: (optional) """ # pylint: disable=super-init-not-called @@ -71182,8 +74078,9 @@ class FloatingIPPrototypeFloatingIPByZone(FloatingIPPrototype): """ FloatingIPPrototypeFloatingIPByZone. - :attr str name: (optional) The unique user-defined name for this floating IP. If - unspecified, the name will be a hyphenated list of randomly-selected words. + :attr str name: (optional) The name for this floating IP. The name must not be + used by another floating IP in the region. If unspecified, the name will be a + hyphenated list of randomly-selected words. :attr ResourceGroupIdentity resource_group: (optional) :attr ZoneIdentity zone: The zone this floating IP will reside in. """ @@ -71197,9 +74094,9 @@ def __init__(self, Initialize a FloatingIPPrototypeFloatingIPByZone object. :param ZoneIdentity zone: The zone this floating IP will reside in. - :param str name: (optional) The unique user-defined name for this floating - IP. If unspecified, the name will be a hyphenated list of randomly-selected - words. + :param str name: (optional) The name for this floating IP. The name must + not be used by another floating IP in the region. If unspecified, the name + will be a hyphenated list of randomly-selected words. :param ResourceGroupIdentity resource_group: (optional) """ # pylint: disable=super-init-not-called @@ -71384,7 +74281,7 @@ class FloatingIPTargetNetworkInterfaceReference(FloatingIPTarget): some supplementary information. :attr str href: The URL for this network interface. :attr str id: The unique identifier for this network interface. - :attr str name: The user-defined name for this network interface. + :attr str name: The name for this network interface. :attr ReservedIPReference primary_ip: :attr str resource_type: The resource type. """ @@ -71402,7 +74299,7 @@ def __init__(self, :param str href: The URL for this network interface. :param str id: The unique identifier for this network interface. - :param str name: The user-defined name for this network interface. + :param str name: The name for this network interface. :param ReservedIPReference primary_ip: :param str resource_type: The resource type. :param NetworkInterfaceReferenceDeleted deleted: (optional) If present, @@ -71455,7 +74352,10 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -71463,7 +74363,10 @@ def to_dict(self) -> Dict: 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: - _dict['primary_ip'] = self.primary_ip.to_dict() + if isinstance(self.primary_ip, dict): + _dict['primary_ip'] = self.primary_ip + else: + _dict['primary_ip'] = self.primary_ip.to_dict() if hasattr(self, 'resource_type') and self.resource_type is not None: _dict['resource_type'] = self.resource_type return _dict @@ -71503,7 +74406,8 @@ class FloatingIPTargetPublicGatewayReference(FloatingIPTarget): some supplementary information. :attr str href: The URL for this public gateway. :attr str id: The unique identifier for this public gateway. - :attr str name: The user-defined name for this public gateway. + :attr str name: The name for this public gateway. The name is unique across all + public gateways in the VPC. :attr str resource_type: The resource type. """ @@ -71521,7 +74425,8 @@ def __init__(self, :param str crn: The CRN for this public gateway. :param str href: The URL for this public gateway. :param str id: The unique identifier for this public gateway. - :param str name: The user-defined name for this public gateway. + :param str name: The name for this public gateway. The name is unique + across all public gateways in the VPC. :param str resource_type: The resource type. :param PublicGatewayReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and provides @@ -71574,7 +74479,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'crn') and self.crn is not None: _dict['crn'] = self.crn if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -71684,8 +74592,8 @@ class FlowLogCollectorTargetInstanceReference(FlowLogCollectorTarget): some supplementary information. :attr str href: The URL for this virtual server instance. :attr str id: The unique identifier for this virtual server instance. - :attr str name: The user-defined name for this virtual server instance (and - default system hostname). + :attr str name: The name for this virtual server instance. The name is unique + across all virtual server instances in the region. """ def __init__(self, @@ -71701,8 +74609,8 @@ def __init__(self, :param str crn: The CRN for this virtual server instance. :param str href: The URL for this virtual server instance. :param str id: The unique identifier for this virtual server instance. - :param str name: The user-defined name for this virtual server instance - (and default system hostname). + :param str name: The name for this virtual server instance. The name is + unique across all virtual server instances in the region. :param InstanceReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and provides some supplementary information. @@ -71749,7 +74657,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'crn') and self.crn is not None: _dict['crn'] = self.crn if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -71786,7 +74697,7 @@ class FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext(FlowLogCollec some supplementary information. :attr str href: The URL for this network interface. :attr str id: The unique identifier for this network interface. - :attr str name: The user-defined name for this network interface. + :attr str name: The name for this network interface. :attr str resource_type: The resource type. """ @@ -71802,7 +74713,7 @@ def __init__(self, :param str href: The URL for this network interface. :param str id: The unique identifier for this network interface. - :param str name: The user-defined name for this network interface. + :param str name: The 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, @@ -71849,7 +74760,10 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -71895,7 +74809,8 @@ class FlowLogCollectorTargetSubnetReference(FlowLogCollectorTarget): some supplementary information. :attr str href: The URL for this subnet. :attr str id: The unique identifier for this subnet. - :attr str name: The user-defined name for this subnet. + :attr str name: The name for this subnet. The name is unique across all subnets + in the VPC. :attr str resource_type: The resource type. """ @@ -71913,7 +74828,8 @@ def __init__(self, :param str crn: The CRN for this subnet. :param str href: The URL for this subnet. :param str id: The unique identifier for this subnet. - :param str name: The user-defined name for this subnet. + :param str name: The name for this subnet. The name is unique across all + subnets in the VPC. :param str resource_type: The resource type. :param SubnetReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and provides @@ -71966,7 +74882,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'crn') and self.crn is not None: _dict['crn'] = self.crn if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -72012,7 +74931,8 @@ class FlowLogCollectorTargetVPCReference(FlowLogCollectorTarget): some supplementary information. :attr str href: The URL for this VPC. :attr str id: The unique identifier for this VPC. - :attr str name: The unique user-defined name for this VPC. + :attr str name: The name for this VPC. The name is unique across all VPCs in the + region. :attr str resource_type: The resource type. """ @@ -72030,7 +74950,8 @@ def __init__(self, :param str crn: The CRN for this VPC. :param str href: The URL for this VPC. :param str id: The unique identifier for this VPC. - :param str name: The unique user-defined name for this VPC. + :param str name: The name for this VPC. The name is unique across all VPCs + in the region. :param str resource_type: The resource type. :param VPCReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and provides @@ -72083,7 +75004,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'crn') and self.crn is not None: _dict['crn'] = self.crn if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -72294,8 +75218,9 @@ class ImagePrototypeImageByFile(ImagePrototype): """ ImagePrototypeImageByFile. - :attr str name: (optional) The unique user-defined name for this image. Names - starting with `ibm-` are not allowed. If unspecified, the name will be a + :attr str name: (optional) The name for this image. The name must not be used by + another image in the region. Names starting with `ibm-` are reserved for + system-provided images, and are not allowed. If unspecified, the name will be a hyphenated list of randomly-selected words. :attr ResourceGroupIdentity resource_group: (optional) :attr str encrypted_data_key: (optional) A base64-encoded, encrypted @@ -72338,9 +75263,10 @@ def __init__(self, system](https://cloud.ibm.com/apidocs/vpc#list-operating-systems) included in this image. - :param str name: (optional) The unique user-defined name for this image. - Names starting with `ibm-` are not allowed. If unspecified, the name will - be a hyphenated list of randomly-selected words. + :param str name: (optional) The name for this image. The name must not be + used by another image in the region. Names starting with `ibm-` are + reserved for system-provided images, and are not allowed. If unspecified, + the name will be a hyphenated list of randomly-selected words. :param ResourceGroupIdentity resource_group: (optional) :param str encrypted_data_key: (optional) A base64-encoded, encrypted representation of the key that was used to encrypt the data for this image. @@ -72413,7 +75339,10 @@ def to_dict(self) -> Dict: else: _dict['encryption_key'] = self.encryption_key.to_dict() if hasattr(self, 'file') and self.file is not None: - _dict['file'] = self.file.to_dict() + if isinstance(self.file, dict): + _dict['file'] = self.file + else: + _dict['file'] = self.file.to_dict() if hasattr(self, 'operating_system') and self.operating_system is not None: if isinstance(self.operating_system, dict): _dict['operating_system'] = self.operating_system @@ -72443,8 +75372,9 @@ class ImagePrototypeImageBySourceVolume(ImagePrototype): """ ImagePrototypeImageBySourceVolume. - :attr str name: (optional) The unique user-defined name for this image. Names - starting with `ibm-` are not allowed. If unspecified, the name will be a + :attr str name: (optional) The name for this image. The name must not be used by + another image in the region. Names starting with `ibm-` are reserved for + system-provided images, and are not allowed. If unspecified, the name will be a hyphenated list of randomly-selected words. :attr ResourceGroupIdentity resource_group: (optional) :attr EncryptionKeyIdentity encryption_key: (optional) The root key used to wrap @@ -72473,9 +75403,10 @@ def __init__(self, operating system information. - Not be `active` or `busy`. During image creation, the specified volume may briefly become `busy`. - :param str name: (optional) The unique user-defined name for this image. - Names starting with `ibm-` are not allowed. If unspecified, the name will - be a hyphenated list of randomly-selected words. + :param str name: (optional) The name for this image. The name must not be + used by another image in the region. Names starting with `ibm-` are + reserved for system-provided images, and are not allowed. If unspecified, + the name will be a hyphenated list of randomly-selected words. :param ResourceGroupIdentity resource_group: (optional) :param EncryptionKeyIdentity encryption_key: (optional) The root key used to wrap the system-generated data encryption key for the image. @@ -72682,9 +75613,9 @@ class InstanceGroupManagerActionPrototypeScheduledActionPrototype(InstanceGroupM """ InstanceGroupManagerActionPrototypeScheduledActionPrototype. - :attr str name: (optional) The user-defined name for this instance group manager - action. Names must be unique within the instance group manager. If unspecified, - the name will be a hyphenated list of randomly-selected words. + :attr str name: (optional) The name for this instance group manager action. The + name must not be used by another action for the instance group manager. If + unspecified, the name will be a hyphenated list of randomly-selected words. """ def __init__(self, @@ -72693,9 +75624,10 @@ def __init__(self, """ Initialize a InstanceGroupManagerActionPrototypeScheduledActionPrototype object. - :param str name: (optional) The user-defined name for this instance group - manager action. Names must be unique within the instance group manager. If - unspecified, the name will be a hyphenated list of randomly-selected words. + :param str name: (optional) The name for this instance group manager + action. The name must not be used by another action for the instance group + manager. If unspecified, the name will be a hyphenated list of + randomly-selected words. """ # pylint: disable=super-init-not-called msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( @@ -72718,7 +75650,8 @@ class InstanceGroupManagerActionScheduledAction(InstanceGroupManagerAction): action was created. :attr str href: The URL for this instance group manager action. :attr str id: The unique identifier for this instance group manager action. - :attr str name: The user-defined name for this instance group manager action. + :attr str name: The name for this instance group manager action. The name is + unique across all actions for the instance group manager. :attr str resource_type: The resource type. :attr str status: The status of the instance group action - `active`: Action is ready to be run @@ -72768,8 +75701,8 @@ def __init__(self, :param str href: The URL for this instance group manager action. :param str id: The unique identifier for this instance group manager action. - :param str name: The user-defined name for this instance group manager - action. + :param str name: The name for this instance group manager action. The name + is unique across all actions for the instance group manager. :param str resource_type: The resource type. :param str status: The status of the instance group action - `active`: Action is ready to be run @@ -72836,7 +75769,8 @@ class InstanceGroupManagerAutoScale(InstanceGroupManager): :attr str id: The unique identifier for this instance group manager. :attr bool management_enabled: Indicates whether this manager will control the instance group. - :attr str name: The user-defined name for this instance group manager. + :attr str name: The name for this instance group manager. The name is unique + across all managers for the instance group. :attr datetime updated_at: The date and time that the instance group manager was updated. :attr int aggregation_window: The time window in seconds to aggregate metrics @@ -72874,7 +75808,8 @@ def __init__(self, :param str id: The unique identifier for this instance group manager. :param bool management_enabled: Indicates whether this manager will control the instance group. - :param str name: The user-defined name for this instance group manager. + :param str name: The name for this instance group manager. The name is + unique across all managers for the instance group. :param datetime updated_at: The date and time that the instance group manager was updated. :param int aggregation_window: The time window in seconds to aggregate @@ -72952,7 +75887,7 @@ def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerAutoScale': else: raise ValueError('Required property \'min_membership_count\' not present in InstanceGroupManagerAutoScale JSON') if 'policies' in _dict: - args['policies'] = [InstanceGroupManagerPolicyReference.from_dict(x) for x in _dict.get('policies')] + args['policies'] = [InstanceGroupManagerPolicyReference.from_dict(v) for v in _dict.get('policies')] else: raise ValueError('Required property \'policies\' not present in InstanceGroupManagerAutoScale JSON') return cls(**args) @@ -72988,7 +75923,13 @@ def to_dict(self) -> Dict: if hasattr(self, 'min_membership_count') and self.min_membership_count is not None: _dict['min_membership_count'] = self.min_membership_count if hasattr(self, 'policies') and self.policies is not None: - _dict['policies'] = [x.to_dict() for x in self.policies] + policies_list = [] + for v in self.policies: + if isinstance(v, dict): + policies_list.append(v) + else: + policies_list.append(v.to_dict()) + _dict['policies'] = policies_list return _dict def _to_dict(self): @@ -73020,9 +75961,9 @@ class InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototy """ InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype. - :attr str name: (optional) The user-defined name for this instance group manager - policy. Names must be unique within the instance group manager. If unspecified, - the name will be a hyphenated list of randomly-selected words. + :attr str name: (optional) The name for this instance group manager policy. The + name must not be used by another policy for the instance group manager. If + unspecified, the name will be a hyphenated list of randomly-selected words. :attr str metric_type: The type of metric to be evaluated. :attr int metric_value: The metric value to be evaluated. :attr str policy_type: The type of policy for the instance group. @@ -73040,9 +75981,10 @@ def __init__(self, :param str metric_type: The type of metric to be evaluated. :param int metric_value: The metric value to be evaluated. :param str policy_type: The type of policy for the instance group. - :param str name: (optional) The user-defined name for this instance group - manager policy. Names must be unique within the instance group manager. If - unspecified, the name will be a hyphenated list of randomly-selected words. + :param str name: (optional) The name for this instance group manager + policy. The name must not be used by another policy for the instance group + manager. If unspecified, the name will be a hyphenated list of + randomly-selected words. """ # pylint: disable=super-init-not-called self.name = name @@ -73131,7 +76073,8 @@ class InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy(InstanceGroupMa policy was created. :attr str href: The URL for this instance group manager policy. :attr str id: The unique identifier for this instance group manager policy. - :attr str name: The user-defined name for this instance group manager policy. + :attr str name: The name for this instance group manager policy. The name is + unique across all policies for the instance group manager. :attr datetime updated_at: The date and time that the instance group manager policy was updated. :attr str metric_type: The type of metric to be evaluated. @@ -73156,8 +76099,8 @@ def __init__(self, :param str href: The URL for this instance group manager policy. :param str id: The unique identifier for this instance group manager policy. - :param str name: The user-defined name for this instance group manager - policy. + :param str name: The name for this instance group manager policy. The name + is unique across all policies for the instance group manager. :param datetime updated_at: The date and time that the instance group manager policy was updated. :param str metric_type: The type of metric to be evaluated. @@ -73279,8 +76222,8 @@ class InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype(Instan :attr bool management_enabled: (optional) Indicates whether this manager will control the instance group. - :attr str name: (optional) The user-defined name for this instance group - manager. Names must be unique within the instance group. If unspecified, the + :attr str name: (optional) The name for this instance group manager. The name + must not be used by another manager for the instance group. If unspecified, the name will be a hyphenated list of randomly-selected words. :attr int aggregation_window: (optional) The time window in seconds to aggregate metrics prior to evaluation. @@ -73310,9 +76253,9 @@ def __init__(self, instance group. :param bool management_enabled: (optional) Indicates whether this manager will control the instance group. - :param str name: (optional) The user-defined name for this instance group - manager. Names must be unique within the instance group. If unspecified, - the name will be a hyphenated list of randomly-selected words. + :param str name: (optional) The name for this instance group manager. The + name must not be used by another manager for the instance group. If + unspecified, the name will be a hyphenated list of randomly-selected words. :param int aggregation_window: (optional) The time window in seconds to aggregate metrics prior to evaluation. :param int cooldown: (optional) The duration of time in seconds to pause @@ -73408,8 +76351,8 @@ class InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype(Instan :attr bool management_enabled: (optional) Indicates whether this manager will control the instance group. - :attr str name: (optional) The user-defined name for this instance group - manager. Names must be unique within the instance group. If unspecified, the + :attr str name: (optional) The name for this instance group manager. The name + must not be used by another manager for the instance group. If unspecified, the name will be a hyphenated list of randomly-selected words. :attr str manager_type: The type of instance group manager. """ @@ -73425,9 +76368,9 @@ def __init__(self, :param str manager_type: The type of instance group manager. :param bool management_enabled: (optional) Indicates whether this manager will control the instance group. - :param str name: (optional) The user-defined name for this instance group - manager. Names must be unique within the instance group. If unspecified, - the name will be a hyphenated list of randomly-selected words. + :param str name: (optional) The name for this instance group manager. The + name must not be used by another manager for the instance group. If + unspecified, the name will be a hyphenated list of randomly-selected words. """ # pylint: disable=super-init-not-called self.management_enabled = management_enabled @@ -73499,7 +76442,8 @@ class InstanceGroupManagerScheduled(InstanceGroupManager): :attr str id: The unique identifier for this instance group manager. :attr bool management_enabled: Indicates whether this manager will control the instance group. - :attr str name: The user-defined name for this instance group manager. + :attr str name: The name for this instance group manager. The name is unique + across all managers for the instance group. :attr datetime updated_at: The date and time that the instance group manager was updated. :attr List[InstanceGroupManagerActionReference] actions: The actions of the @@ -73525,7 +76469,8 @@ def __init__(self, :param str id: The unique identifier for this instance group manager. :param bool management_enabled: Indicates whether this manager will control the instance group. - :param str name: The user-defined name for this instance group manager. + :param str name: The name for this instance group manager. The name is + unique across all managers for the instance group. :param datetime updated_at: The date and time that the instance group manager was updated. :param List[InstanceGroupManagerActionReference] actions: The actions of @@ -73571,7 +76516,7 @@ def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerScheduled': else: raise ValueError('Required property \'updated_at\' not present in InstanceGroupManagerScheduled JSON') if 'actions' in _dict: - args['actions'] = [InstanceGroupManagerActionReference.from_dict(x) for x in _dict.get('actions')] + args['actions'] = [InstanceGroupManagerActionReference.from_dict(v) for v in _dict.get('actions')] else: raise ValueError('Required property \'actions\' not present in InstanceGroupManagerScheduled JSON') if 'manager_type' in _dict: @@ -73601,7 +76546,13 @@ def to_dict(self) -> Dict: if hasattr(self, 'updated_at') and self.updated_at is not None: _dict['updated_at'] = datetime_to_string(self.updated_at) if hasattr(self, 'actions') and self.actions is not None: - _dict['actions'] = [x.to_dict() for x in self.actions] + actions_list = [] + for v in self.actions: + if isinstance(v, dict): + actions_list.append(v) + else: + actions_list.append(v.to_dict()) + _dict['actions'] = actions_list if hasattr(self, 'manager_type') and self.manager_type is not None: _dict['manager_type'] = self.manager_type return _dict @@ -73640,7 +76591,8 @@ class InstanceGroupManagerScheduledActionManagerAutoScale(InstanceGroupManagerSc some supplementary information. :attr str href: The URL for this instance group manager. :attr str id: The unique identifier for this instance group manager. - :attr str name: The user-defined name for this instance group manager. + :attr str name: The name for this instance group manager. The name is unique + across all managers for the instance group. :attr int max_membership_count: (optional) The desired maximum number of instance group members at the scheduled time. :attr int min_membership_count: (optional) The desired minimum number of @@ -73660,7 +76612,8 @@ def __init__(self, :param str href: The URL for this instance group manager. :param str id: The unique identifier for this instance group manager. - :param str name: The user-defined name for this instance group manager. + :param str name: The name for this instance group manager. The name is + unique across all managers for the instance group. :param InstanceGroupManagerReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and provides @@ -73711,7 +76664,10 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -73978,7 +76934,8 @@ class InstancePlacementTargetDedicatedHostGroupReference(InstancePlacementTarget some supplementary information. :attr str href: The URL for this dedicated host group. :attr str id: The unique identifier for this dedicated host group. - :attr str name: The unique user-defined name for this dedicated host group. + :attr str name: The name for this dedicated host group. The name is unique + across all dedicated host groups in the region. :attr str resource_type: The resource type. """ @@ -73996,8 +76953,8 @@ def __init__(self, :param str crn: The CRN for this dedicated host group. :param str href: The URL for this dedicated host group. :param str id: The unique identifier for this dedicated host group. - :param str name: The unique user-defined name for this dedicated host - group. + :param str name: The name for this dedicated host group. The name is unique + across all dedicated host groups in the region. :param str resource_type: The resource type. :param DedicatedHostGroupReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and @@ -74051,7 +77008,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'crn') and self.crn is not None: _dict['crn'] = self.crn if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -74097,7 +77057,8 @@ class InstancePlacementTargetDedicatedHostReference(InstancePlacementTarget): some supplementary information. :attr str href: The URL for this dedicated host. :attr str id: The unique identifier for this dedicated host. - :attr str name: The unique user-defined name for this dedicated host. + :attr str name: The name for this dedicated host. The name is unique across all + dedicated hosts in the region. :attr str resource_type: The resource type. """ @@ -74115,7 +77076,8 @@ def __init__(self, :param str crn: The CRN for this dedicated host. :param str href: The URL for this dedicated host. :param str id: The unique identifier for this dedicated host. - :param str name: The unique user-defined name for this dedicated host. + :param str name: The name for this dedicated host. The name is unique + across all dedicated hosts in the region. :param str resource_type: The resource type. :param DedicatedHostReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and provides @@ -74168,7 +77130,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'crn') and self.crn is not None: _dict['crn'] = self.crn if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -74214,7 +77179,8 @@ class InstancePlacementTargetPlacementGroupReference(InstancePlacementTarget): some supplementary information. :attr str href: The URL for this placement group. :attr str id: The unique identifier for this placement group. - :attr str name: The user-defined name for this placement group. + :attr str name: The name for this placement group. The name is unique across all + placement groups in the region. :attr str resource_type: The resource type. """ @@ -74232,7 +77198,8 @@ def __init__(self, :param str crn: The CRN for this placement group. :param str href: The URL for this placement group. :param str id: The unique identifier for this placement group. - :param str name: The user-defined name for this placement group. + :param str name: The name for this placement group. The name is unique + across all placement groups in the region. :param str resource_type: The resource type. :param PlacementGroupReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and provides @@ -74285,7 +77252,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'crn') and self.crn is not None: _dict['crn'] = self.crn if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -77230,9 +80200,10 @@ class InstancePrototypeInstanceByCatalogOffering(InstancePrototype): 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 str name: (optional) The name for this virtual server instance. The name + must not be used by another virtual server instance in the region. If + unspecified, the name will be a hyphenated list of randomly-selected words. + The system hostname will be based on this name. :attr List[NetworkInterfacePrototype] network_interfaces: (optional) The additional network interfaces to create for the virtual server instance. :attr InstancePlacementTargetPrototype placement_target: (optional) The @@ -77249,9 +80220,8 @@ class InstancePrototypeInstanceByCatalogOffering(InstancePrototype): :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 List[VolumeAttachmentPrototype] 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. @@ -77288,7 +80258,7 @@ def __init__(self, resource_group: 'ResourceGroupIdentity' = None, total_volume_bandwidth: int = None, user_data: str = None, - volume_attachments: List['VolumeAttachmentPrototypeInstanceContext'] = None, + volume_attachments: List['VolumeAttachmentPrototype'] = None, vpc: 'VPCIdentity' = None, boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceByImageContext' = None) -> None: """ @@ -77335,9 +80305,10 @@ def __init__(self, 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 str name: (optional) The name for this virtual server instance. The + name must not be used by another virtual server instance in the region. If + unspecified, the name will be a hyphenated list of randomly-selected words. + The system hostname will be based on this name. :param List[NetworkInterfacePrototype] network_interfaces: (optional) The additional network interfaces to create for the virtual server instance. :param InstancePlacementTargetPrototype placement_target: (optional) The @@ -77354,9 +80325,8 @@ def __init__(self, :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 List[VolumeAttachmentPrototype] 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. @@ -77398,7 +80368,7 @@ def from_dict(cls, _dict: Dict) -> 'InstancePrototypeInstanceByCatalogOffering': 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')] + args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(v) for v in _dict.get('network_interfaces')] if 'placement_target' in _dict: args['placement_target'] = _dict.get('placement_target') if 'profile' in _dict: @@ -77410,7 +80380,7 @@ def from_dict(cls, _dict: Dict) -> 'InstancePrototypeInstanceByCatalogOffering': 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')] + args['volume_attachments'] = [VolumeAttachmentPrototype.from_dict(v) for v in _dict.get('volume_attachments')] if 'vpc' in _dict: args['vpc'] = _dict.get('vpc') if 'boot_volume_attachment' in _dict: @@ -77438,23 +80408,38 @@ 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 isinstance(self.availability_policy, dict): + _dict['availability_policy'] = self.availability_policy + else: + _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 isinstance(self.default_trusted_profile, dict): + _dict['default_trusted_profile'] = self.default_trusted_profile + else: + _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) + for v in self.keys: + if isinstance(v, dict): + keys_list.append(v) else: - keys_list.append(x.to_dict()) + keys_list.append(v.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 isinstance(self.metadata_service, dict): + _dict['metadata_service'] = self.metadata_service + else: + _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] + network_interfaces_list = [] + for v in self.network_interfaces: + if isinstance(v, dict): + network_interfaces_list.append(v) + else: + network_interfaces_list.append(v.to_dict()) + _dict['network_interfaces'] = network_interfaces_list if hasattr(self, 'placement_target') and self.placement_target is not None: if isinstance(self.placement_target, dict): _dict['placement_target'] = self.placement_target @@ -77475,21 +80460,33 @@ def to_dict(self) -> Dict: 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] + volume_attachments_list = [] + for v in self.volume_attachments: + if isinstance(v, dict): + volume_attachments_list.append(v) + else: + volume_attachments_list.append(v.to_dict()) + _dict['volume_attachments'] = volume_attachments_list 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 isinstance(self.boot_volume_attachment, dict): + _dict['boot_volume_attachment'] = self.boot_volume_attachment + else: + _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 isinstance(self.primary_network_interface, dict): + _dict['primary_network_interface'] = self.primary_network_interface + else: + _dict['primary_network_interface'] = self.primary_network_interface.to_dict() if hasattr(self, 'zone') and self.zone is not None: if isinstance(self.zone, dict): _dict['zone'] = self.zone @@ -77543,9 +80540,10 @@ class InstancePrototypeInstanceByImage(InstancePrototype): 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 str name: (optional) The name for this virtual server instance. The name + must not be used by another virtual server instance in the region. If + unspecified, the name will be a hyphenated list of randomly-selected words. + The system hostname will be based on this name. :attr List[NetworkInterfacePrototype] network_interfaces: (optional) The additional network interfaces to create for the virtual server instance. :attr InstancePlacementTargetPrototype placement_target: (optional) The @@ -77562,9 +80560,8 @@ class InstancePrototypeInstanceByImage(InstancePrototype): :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 List[VolumeAttachmentPrototype] 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. @@ -77593,7 +80590,7 @@ def __init__(self, resource_group: 'ResourceGroupIdentity' = None, total_volume_bandwidth: int = None, user_data: str = None, - volume_attachments: List['VolumeAttachmentPrototypeInstanceContext'] = None, + volume_attachments: List['VolumeAttachmentPrototype'] = None, vpc: 'VPCIdentity' = None, boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceByImageContext' = None) -> None: """ @@ -77631,9 +80628,10 @@ def __init__(self, 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 str name: (optional) The name for this virtual server instance. The + name must not be used by another virtual server instance in the region. If + unspecified, the name will be a hyphenated list of randomly-selected words. + The system hostname will be based on this name. :param List[NetworkInterfacePrototype] network_interfaces: (optional) The additional network interfaces to create for the virtual server instance. :param InstancePlacementTargetPrototype placement_target: (optional) The @@ -77650,9 +80648,8 @@ def __init__(self, :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 List[VolumeAttachmentPrototype] 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. @@ -77694,7 +80691,7 @@ def from_dict(cls, _dict: Dict) -> 'InstancePrototypeInstanceByImage': 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')] + args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(v) for v in _dict.get('network_interfaces')] if 'placement_target' in _dict: args['placement_target'] = _dict.get('placement_target') if 'profile' in _dict: @@ -77706,7 +80703,7 @@ def from_dict(cls, _dict: Dict) -> 'InstancePrototypeInstanceByImage': 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')] + args['volume_attachments'] = [VolumeAttachmentPrototype.from_dict(v) for v in _dict.get('volume_attachments')] if 'vpc' in _dict: args['vpc'] = _dict.get('vpc') if 'boot_volume_attachment' in _dict: @@ -77734,23 +80731,38 @@ 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 isinstance(self.availability_policy, dict): + _dict['availability_policy'] = self.availability_policy + else: + _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 isinstance(self.default_trusted_profile, dict): + _dict['default_trusted_profile'] = self.default_trusted_profile + else: + _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) + for v in self.keys: + if isinstance(v, dict): + keys_list.append(v) else: - keys_list.append(x.to_dict()) + keys_list.append(v.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 isinstance(self.metadata_service, dict): + _dict['metadata_service'] = self.metadata_service + else: + _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] + network_interfaces_list = [] + for v in self.network_interfaces: + if isinstance(v, dict): + network_interfaces_list.append(v) + else: + network_interfaces_list.append(v.to_dict()) + _dict['network_interfaces'] = network_interfaces_list if hasattr(self, 'placement_target') and self.placement_target is not None: if isinstance(self.placement_target, dict): _dict['placement_target'] = self.placement_target @@ -77771,21 +80783,33 @@ def to_dict(self) -> Dict: 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] + volume_attachments_list = [] + for v in self.volume_attachments: + if isinstance(v, dict): + volume_attachments_list.append(v) + else: + volume_attachments_list.append(v.to_dict()) + _dict['volume_attachments'] = volume_attachments_list 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 isinstance(self.boot_volume_attachment, dict): + _dict['boot_volume_attachment'] = self.boot_volume_attachment + else: + _dict['boot_volume_attachment'] = self.boot_volume_attachment.to_dict() if hasattr(self, 'image') and self.image is not None: if isinstance(self.image, dict): _dict['image'] = self.image else: _dict['image'] = self.image.to_dict() if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None: - _dict['primary_network_interface'] = self.primary_network_interface.to_dict() + if isinstance(self.primary_network_interface, dict): + _dict['primary_network_interface'] = self.primary_network_interface + else: + _dict['primary_network_interface'] = self.primary_network_interface.to_dict() if hasattr(self, 'zone') and self.zone is not None: if isinstance(self.zone, dict): _dict['zone'] = self.zone @@ -77839,9 +80863,10 @@ class InstancePrototypeInstanceBySourceSnapshot(InstancePrototype): 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 str name: (optional) The name for this virtual server instance. The name + must not be used by another virtual server instance in the region. If + unspecified, the name will be a hyphenated list of randomly-selected words. + The system hostname will be based on this name. :attr List[NetworkInterfacePrototype] network_interfaces: (optional) The additional network interfaces to create for the virtual server instance. :attr InstancePlacementTargetPrototype placement_target: (optional) The @@ -77858,9 +80883,8 @@ class InstancePrototypeInstanceBySourceSnapshot(InstancePrototype): :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 List[VolumeAttachmentPrototype] 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. @@ -77888,7 +80912,7 @@ def __init__(self, resource_group: 'ResourceGroupIdentity' = None, total_volume_bandwidth: int = None, user_data: str = None, - volume_attachments: List['VolumeAttachmentPrototypeInstanceContext'] = None, + volume_attachments: List['VolumeAttachmentPrototype'] = None, vpc: 'VPCIdentity' = None) -> None: """ Initialize a InstancePrototypeInstanceBySourceSnapshot object. @@ -77926,9 +80950,10 @@ def __init__(self, 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 str name: (optional) The name for this virtual server instance. The + name must not be used by another virtual server instance in the region. If + unspecified, the name will be a hyphenated list of randomly-selected words. + The system hostname will be based on this name. :param List[NetworkInterfacePrototype] network_interfaces: (optional) The additional network interfaces to create for the virtual server instance. :param InstancePlacementTargetPrototype placement_target: (optional) The @@ -77945,9 +80970,8 @@ def __init__(self, :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 List[VolumeAttachmentPrototype] 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. @@ -77985,7 +81009,7 @@ def from_dict(cls, _dict: Dict) -> 'InstancePrototypeInstanceBySourceSnapshot': 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')] + args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(v) for v in _dict.get('network_interfaces')] if 'placement_target' in _dict: args['placement_target'] = _dict.get('placement_target') if 'profile' in _dict: @@ -77997,7 +81021,7 @@ def from_dict(cls, _dict: Dict) -> 'InstancePrototypeInstanceBySourceSnapshot': 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')] + args['volume_attachments'] = [VolumeAttachmentPrototype.from_dict(v) for v in _dict.get('volume_attachments')] if 'vpc' in _dict: args['vpc'] = _dict.get('vpc') if 'boot_volume_attachment' in _dict: @@ -78023,23 +81047,38 @@ 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 isinstance(self.availability_policy, dict): + _dict['availability_policy'] = self.availability_policy + else: + _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 isinstance(self.default_trusted_profile, dict): + _dict['default_trusted_profile'] = self.default_trusted_profile + else: + _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) + for v in self.keys: + if isinstance(v, dict): + keys_list.append(v) else: - keys_list.append(x.to_dict()) + keys_list.append(v.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 isinstance(self.metadata_service, dict): + _dict['metadata_service'] = self.metadata_service + else: + _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] + network_interfaces_list = [] + for v in self.network_interfaces: + if isinstance(v, dict): + network_interfaces_list.append(v) + else: + network_interfaces_list.append(v.to_dict()) + _dict['network_interfaces'] = network_interfaces_list if hasattr(self, 'placement_target') and self.placement_target is not None: if isinstance(self.placement_target, dict): _dict['placement_target'] = self.placement_target @@ -78060,16 +81099,28 @@ def to_dict(self) -> Dict: 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] + volume_attachments_list = [] + for v in self.volume_attachments: + if isinstance(v, dict): + volume_attachments_list.append(v) + else: + volume_attachments_list.append(v.to_dict()) + _dict['volume_attachments'] = volume_attachments_list 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 isinstance(self.boot_volume_attachment, dict): + _dict['boot_volume_attachment'] = self.boot_volume_attachment + else: + _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 isinstance(self.primary_network_interface, dict): + _dict['primary_network_interface'] = self.primary_network_interface + else: + _dict['primary_network_interface'] = self.primary_network_interface.to_dict() if hasattr(self, 'zone') and self.zone is not None: if isinstance(self.zone, dict): _dict['zone'] = self.zone @@ -78123,9 +81174,10 @@ class InstancePrototypeInstanceBySourceTemplate(InstancePrototype): 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 str name: (optional) The name for this virtual server instance. The name + must not be used by another virtual server instance in the region. If + unspecified, the name will be a hyphenated list of randomly-selected words. + The system hostname will be based on this name. :attr List[NetworkInterfacePrototype] network_interfaces: (optional) The additional network interfaces to create for the virtual server instance. :attr InstancePlacementTargetPrototype placement_target: (optional) The @@ -78142,9 +81194,8 @@ class InstancePrototypeInstanceBySourceTemplate(InstancePrototype): :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 List[VolumeAttachmentPrototype] 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. @@ -78183,7 +81234,7 @@ def __init__(self, resource_group: 'ResourceGroupIdentity' = None, total_volume_bandwidth: int = None, user_data: str = None, - volume_attachments: List['VolumeAttachmentPrototypeInstanceContext'] = None, + volume_attachments: List['VolumeAttachmentPrototype'] = None, vpc: 'VPCIdentity' = None, boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceByImageContext' = None, catalog_offering: 'InstanceCatalogOfferingPrototype' = None, @@ -78221,9 +81272,10 @@ def __init__(self, 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 str name: (optional) The name for this virtual server instance. The + name must not be used by another virtual server instance in the region. If + unspecified, the name will be a hyphenated list of randomly-selected words. + The system hostname will be based on this name. :param List[NetworkInterfacePrototype] network_interfaces: (optional) The additional network interfaces to create for the virtual server instance. :param InstancePlacementTargetPrototype placement_target: (optional) The @@ -78240,9 +81292,8 @@ def __init__(self, :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 List[VolumeAttachmentPrototype] 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. @@ -78303,7 +81354,7 @@ def from_dict(cls, _dict: Dict) -> 'InstancePrototypeInstanceBySourceTemplate': 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')] + args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(v) for v in _dict.get('network_interfaces')] if 'placement_target' in _dict: args['placement_target'] = _dict.get('placement_target') if 'profile' in _dict: @@ -78315,7 +81366,7 @@ def from_dict(cls, _dict: Dict) -> 'InstancePrototypeInstanceBySourceTemplate': 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')] + args['volume_attachments'] = [VolumeAttachmentPrototype.from_dict(v) for v in _dict.get('volume_attachments')] if 'vpc' in _dict: args['vpc'] = _dict.get('vpc') if 'boot_volume_attachment' in _dict: @@ -78343,23 +81394,38 @@ 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 isinstance(self.availability_policy, dict): + _dict['availability_policy'] = self.availability_policy + else: + _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 isinstance(self.default_trusted_profile, dict): + _dict['default_trusted_profile'] = self.default_trusted_profile + else: + _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) + for v in self.keys: + if isinstance(v, dict): + keys_list.append(v) else: - keys_list.append(x.to_dict()) + keys_list.append(v.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 isinstance(self.metadata_service, dict): + _dict['metadata_service'] = self.metadata_service + else: + _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] + network_interfaces_list = [] + for v in self.network_interfaces: + if isinstance(v, dict): + network_interfaces_list.append(v) + else: + network_interfaces_list.append(v.to_dict()) + _dict['network_interfaces'] = network_interfaces_list if hasattr(self, 'placement_target') and self.placement_target is not None: if isinstance(self.placement_target, dict): _dict['placement_target'] = self.placement_target @@ -78380,14 +81446,23 @@ def to_dict(self) -> Dict: 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] + volume_attachments_list = [] + for v in self.volume_attachments: + if isinstance(v, dict): + volume_attachments_list.append(v) + else: + volume_attachments_list.append(v.to_dict()) + _dict['volume_attachments'] = volume_attachments_list 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 isinstance(self.boot_volume_attachment, dict): + _dict['boot_volume_attachment'] = self.boot_volume_attachment + else: + _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 @@ -78399,7 +81474,10 @@ def to_dict(self) -> Dict: else: _dict['image'] = self.image.to_dict() if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None: - _dict['primary_network_interface'] = self.primary_network_interface.to_dict() + if isinstance(self.primary_network_interface, dict): + _dict['primary_network_interface'] = self.primary_network_interface + else: + _dict['primary_network_interface'] = self.primary_network_interface.to_dict() if hasattr(self, 'source_template') and self.source_template is not None: if isinstance(self.source_template, dict): _dict['source_template'] = self.source_template @@ -78629,9 +81707,9 @@ class InstanceTemplatePrototypeInstanceByCatalogOffering(InstanceTemplatePrototy 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 str name: (optional) The name for this instance template. The name must + not be used by another instance template in the region. 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 @@ -78648,9 +81726,8 @@ class InstanceTemplatePrototypeInstanceByCatalogOffering(InstanceTemplatePrototy :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 List[VolumeAttachmentPrototype] 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. @@ -78687,7 +81764,7 @@ def __init__(self, resource_group: 'ResourceGroupIdentity' = None, total_volume_bandwidth: int = None, user_data: str = None, - volume_attachments: List['VolumeAttachmentPrototypeInstanceContext'] = None, + volume_attachments: List['VolumeAttachmentPrototype'] = None, vpc: 'VPCIdentity' = None, boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceByImageContext' = None) -> None: """ @@ -78734,9 +81811,9 @@ def __init__(self, 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 str name: (optional) The name for this instance template. The name + must not be used by another instance template in the region. 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 @@ -78753,9 +81830,8 @@ def __init__(self, :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 List[VolumeAttachmentPrototype] 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. @@ -78797,7 +81873,7 @@ def from_dict(cls, _dict: Dict) -> 'InstanceTemplatePrototypeInstanceByCatalogOf 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')] + args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(v) for v in _dict.get('network_interfaces')] if 'placement_target' in _dict: args['placement_target'] = _dict.get('placement_target') if 'profile' in _dict: @@ -78809,7 +81885,7 @@ def from_dict(cls, _dict: Dict) -> 'InstanceTemplatePrototypeInstanceByCatalogOf 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')] + args['volume_attachments'] = [VolumeAttachmentPrototype.from_dict(v) for v in _dict.get('volume_attachments')] if 'vpc' in _dict: args['vpc'] = _dict.get('vpc') if 'boot_volume_attachment' in _dict: @@ -78837,23 +81913,38 @@ 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 isinstance(self.availability_policy, dict): + _dict['availability_policy'] = self.availability_policy + else: + _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 isinstance(self.default_trusted_profile, dict): + _dict['default_trusted_profile'] = self.default_trusted_profile + else: + _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) + for v in self.keys: + if isinstance(v, dict): + keys_list.append(v) else: - keys_list.append(x.to_dict()) + keys_list.append(v.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 isinstance(self.metadata_service, dict): + _dict['metadata_service'] = self.metadata_service + else: + _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] + network_interfaces_list = [] + for v in self.network_interfaces: + if isinstance(v, dict): + network_interfaces_list.append(v) + else: + network_interfaces_list.append(v.to_dict()) + _dict['network_interfaces'] = network_interfaces_list if hasattr(self, 'placement_target') and self.placement_target is not None: if isinstance(self.placement_target, dict): _dict['placement_target'] = self.placement_target @@ -78874,21 +81965,33 @@ def to_dict(self) -> Dict: 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] + volume_attachments_list = [] + for v in self.volume_attachments: + if isinstance(v, dict): + volume_attachments_list.append(v) + else: + volume_attachments_list.append(v.to_dict()) + _dict['volume_attachments'] = volume_attachments_list 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 isinstance(self.boot_volume_attachment, dict): + _dict['boot_volume_attachment'] = self.boot_volume_attachment + else: + _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 isinstance(self.primary_network_interface, dict): + _dict['primary_network_interface'] = self.primary_network_interface + else: + _dict['primary_network_interface'] = self.primary_network_interface.to_dict() if hasattr(self, 'zone') and self.zone is not None: if isinstance(self.zone, dict): _dict['zone'] = self.zone @@ -78942,9 +82045,9 @@ class InstanceTemplatePrototypeInstanceByImage(InstanceTemplatePrototype): 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 str name: (optional) The name for this instance template. The name must + not be used by another instance template in the region. 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 @@ -78961,9 +82064,8 @@ class InstanceTemplatePrototypeInstanceByImage(InstanceTemplatePrototype): :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 List[VolumeAttachmentPrototype] 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. @@ -78992,7 +82094,7 @@ def __init__(self, resource_group: 'ResourceGroupIdentity' = None, total_volume_bandwidth: int = None, user_data: str = None, - volume_attachments: List['VolumeAttachmentPrototypeInstanceContext'] = None, + volume_attachments: List['VolumeAttachmentPrototype'] = None, vpc: 'VPCIdentity' = None, boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceByImageContext' = None) -> None: """ @@ -79030,9 +82132,9 @@ def __init__(self, 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 str name: (optional) The name for this instance template. The name + must not be used by another instance template in the region. 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 @@ -79049,9 +82151,8 @@ def __init__(self, :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 List[VolumeAttachmentPrototype] 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. @@ -79093,7 +82194,7 @@ def from_dict(cls, _dict: Dict) -> 'InstanceTemplatePrototypeInstanceByImage': 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')] + args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(v) for v in _dict.get('network_interfaces')] if 'placement_target' in _dict: args['placement_target'] = _dict.get('placement_target') if 'profile' in _dict: @@ -79105,7 +82206,7 @@ def from_dict(cls, _dict: Dict) -> 'InstanceTemplatePrototypeInstanceByImage': 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')] + args['volume_attachments'] = [VolumeAttachmentPrototype.from_dict(v) for v in _dict.get('volume_attachments')] if 'vpc' in _dict: args['vpc'] = _dict.get('vpc') if 'boot_volume_attachment' in _dict: @@ -79133,23 +82234,38 @@ 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 isinstance(self.availability_policy, dict): + _dict['availability_policy'] = self.availability_policy + else: + _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 isinstance(self.default_trusted_profile, dict): + _dict['default_trusted_profile'] = self.default_trusted_profile + else: + _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) + for v in self.keys: + if isinstance(v, dict): + keys_list.append(v) else: - keys_list.append(x.to_dict()) + keys_list.append(v.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 isinstance(self.metadata_service, dict): + _dict['metadata_service'] = self.metadata_service + else: + _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] + network_interfaces_list = [] + for v in self.network_interfaces: + if isinstance(v, dict): + network_interfaces_list.append(v) + else: + network_interfaces_list.append(v.to_dict()) + _dict['network_interfaces'] = network_interfaces_list if hasattr(self, 'placement_target') and self.placement_target is not None: if isinstance(self.placement_target, dict): _dict['placement_target'] = self.placement_target @@ -79170,21 +82286,33 @@ def to_dict(self) -> Dict: 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] + volume_attachments_list = [] + for v in self.volume_attachments: + if isinstance(v, dict): + volume_attachments_list.append(v) + else: + volume_attachments_list.append(v.to_dict()) + _dict['volume_attachments'] = volume_attachments_list 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 isinstance(self.boot_volume_attachment, dict): + _dict['boot_volume_attachment'] = self.boot_volume_attachment + else: + _dict['boot_volume_attachment'] = self.boot_volume_attachment.to_dict() if hasattr(self, 'image') and self.image is not None: if isinstance(self.image, dict): _dict['image'] = self.image else: _dict['image'] = self.image.to_dict() if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None: - _dict['primary_network_interface'] = self.primary_network_interface.to_dict() + if isinstance(self.primary_network_interface, dict): + _dict['primary_network_interface'] = self.primary_network_interface + else: + _dict['primary_network_interface'] = self.primary_network_interface.to_dict() if hasattr(self, 'zone') and self.zone is not None: if isinstance(self.zone, dict): _dict['zone'] = self.zone @@ -79238,9 +82366,9 @@ class InstanceTemplatePrototypeInstanceBySourceSnapshot(InstanceTemplatePrototyp 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 str name: (optional) The name for this instance template. The name must + not be used by another instance template in the region. 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 @@ -79257,9 +82385,8 @@ class InstanceTemplatePrototypeInstanceBySourceSnapshot(InstanceTemplatePrototyp :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 List[VolumeAttachmentPrototype] 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. @@ -79287,7 +82414,7 @@ def __init__(self, resource_group: 'ResourceGroupIdentity' = None, total_volume_bandwidth: int = None, user_data: str = None, - volume_attachments: List['VolumeAttachmentPrototypeInstanceContext'] = None, + volume_attachments: List['VolumeAttachmentPrototype'] = None, vpc: 'VPCIdentity' = None) -> None: """ Initialize a InstanceTemplatePrototypeInstanceBySourceSnapshot object. @@ -79325,9 +82452,9 @@ def __init__(self, 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 str name: (optional) The name for this instance template. The name + must not be used by another instance template in the region. 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 @@ -79344,9 +82471,8 @@ def __init__(self, :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 List[VolumeAttachmentPrototype] 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. @@ -79384,7 +82510,7 @@ def from_dict(cls, _dict: Dict) -> 'InstanceTemplatePrototypeInstanceBySourceSna 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')] + args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(v) for v in _dict.get('network_interfaces')] if 'placement_target' in _dict: args['placement_target'] = _dict.get('placement_target') if 'profile' in _dict: @@ -79396,7 +82522,7 @@ def from_dict(cls, _dict: Dict) -> 'InstanceTemplatePrototypeInstanceBySourceSna 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')] + args['volume_attachments'] = [VolumeAttachmentPrototype.from_dict(v) for v in _dict.get('volume_attachments')] if 'vpc' in _dict: args['vpc'] = _dict.get('vpc') if 'boot_volume_attachment' in _dict: @@ -79422,23 +82548,38 @@ 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 isinstance(self.availability_policy, dict): + _dict['availability_policy'] = self.availability_policy + else: + _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 isinstance(self.default_trusted_profile, dict): + _dict['default_trusted_profile'] = self.default_trusted_profile + else: + _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) + for v in self.keys: + if isinstance(v, dict): + keys_list.append(v) else: - keys_list.append(x.to_dict()) + keys_list.append(v.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 isinstance(self.metadata_service, dict): + _dict['metadata_service'] = self.metadata_service + else: + _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] + network_interfaces_list = [] + for v in self.network_interfaces: + if isinstance(v, dict): + network_interfaces_list.append(v) + else: + network_interfaces_list.append(v.to_dict()) + _dict['network_interfaces'] = network_interfaces_list if hasattr(self, 'placement_target') and self.placement_target is not None: if isinstance(self.placement_target, dict): _dict['placement_target'] = self.placement_target @@ -79459,16 +82600,28 @@ def to_dict(self) -> Dict: 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] + volume_attachments_list = [] + for v in self.volume_attachments: + if isinstance(v, dict): + volume_attachments_list.append(v) + else: + volume_attachments_list.append(v.to_dict()) + _dict['volume_attachments'] = volume_attachments_list 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 isinstance(self.boot_volume_attachment, dict): + _dict['boot_volume_attachment'] = self.boot_volume_attachment + else: + _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 isinstance(self.primary_network_interface, dict): + _dict['primary_network_interface'] = self.primary_network_interface + else: + _dict['primary_network_interface'] = self.primary_network_interface.to_dict() if hasattr(self, 'zone') and self.zone is not None: if isinstance(self.zone, dict): _dict['zone'] = self.zone @@ -79522,9 +82675,9 @@ class InstanceTemplatePrototypeInstanceBySourceTemplate(InstanceTemplatePrototyp 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 str name: (optional) The name for this instance template. The name must + not be used by another instance template in the region. 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 @@ -79541,9 +82694,8 @@ class InstanceTemplatePrototypeInstanceBySourceTemplate(InstanceTemplatePrototyp :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 List[VolumeAttachmentPrototype] 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. @@ -79582,7 +82734,7 @@ def __init__(self, resource_group: 'ResourceGroupIdentity' = None, total_volume_bandwidth: int = None, user_data: str = None, - volume_attachments: List['VolumeAttachmentPrototypeInstanceContext'] = None, + volume_attachments: List['VolumeAttachmentPrototype'] = None, vpc: 'VPCIdentity' = None, boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceByImageContext' = None, catalog_offering: 'InstanceCatalogOfferingPrototype' = None, @@ -79620,9 +82772,9 @@ def __init__(self, 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 str name: (optional) The name for this instance template. The name + must not be used by another instance template in the region. 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 @@ -79639,9 +82791,8 @@ def __init__(self, :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 List[VolumeAttachmentPrototype] 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. @@ -79702,7 +82853,7 @@ def from_dict(cls, _dict: Dict) -> 'InstanceTemplatePrototypeInstanceBySourceTem 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')] + args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(v) for v in _dict.get('network_interfaces')] if 'placement_target' in _dict: args['placement_target'] = _dict.get('placement_target') if 'profile' in _dict: @@ -79714,7 +82865,7 @@ def from_dict(cls, _dict: Dict) -> 'InstanceTemplatePrototypeInstanceBySourceTem 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')] + args['volume_attachments'] = [VolumeAttachmentPrototype.from_dict(v) for v in _dict.get('volume_attachments')] if 'vpc' in _dict: args['vpc'] = _dict.get('vpc') if 'boot_volume_attachment' in _dict: @@ -79742,23 +82893,38 @@ 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 isinstance(self.availability_policy, dict): + _dict['availability_policy'] = self.availability_policy + else: + _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 isinstance(self.default_trusted_profile, dict): + _dict['default_trusted_profile'] = self.default_trusted_profile + else: + _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) + for v in self.keys: + if isinstance(v, dict): + keys_list.append(v) else: - keys_list.append(x.to_dict()) + keys_list.append(v.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 isinstance(self.metadata_service, dict): + _dict['metadata_service'] = self.metadata_service + else: + _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] + network_interfaces_list = [] + for v in self.network_interfaces: + if isinstance(v, dict): + network_interfaces_list.append(v) + else: + network_interfaces_list.append(v.to_dict()) + _dict['network_interfaces'] = network_interfaces_list if hasattr(self, 'placement_target') and self.placement_target is not None: if isinstance(self.placement_target, dict): _dict['placement_target'] = self.placement_target @@ -79779,14 +82945,23 @@ def to_dict(self) -> Dict: 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] + volume_attachments_list = [] + for v in self.volume_attachments: + if isinstance(v, dict): + volume_attachments_list.append(v) + else: + volume_attachments_list.append(v.to_dict()) + _dict['volume_attachments'] = volume_attachments_list 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 isinstance(self.boot_volume_attachment, dict): + _dict['boot_volume_attachment'] = self.boot_volume_attachment + else: + _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 @@ -79798,7 +82973,10 @@ def to_dict(self) -> Dict: else: _dict['image'] = self.image.to_dict() if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None: - _dict['primary_network_interface'] = self.primary_network_interface.to_dict() + if isinstance(self.primary_network_interface, dict): + _dict['primary_network_interface'] = self.primary_network_interface + else: + _dict['primary_network_interface'] = self.primary_network_interface.to_dict() if hasattr(self, 'source_template') and self.source_template is not None: if isinstance(self.source_template, dict): _dict['source_template'] = self.source_template @@ -79862,7 +83040,8 @@ class InstanceTemplateInstanceByCatalogOffering(InstanceTemplate): 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 str name: The name for this instance template. The name is unique across + all instance templates in the region. :attr List[NetworkInterfacePrototype] network_interfaces: (optional) The additional network interfaces to create for the virtual server instance. :attr InstancePlacementTargetPrototype placement_target: (optional) The @@ -79880,9 +83059,8 @@ class InstanceTemplateInstanceByCatalogOffering(InstanceTemplate): :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 List[VolumeAttachmentPrototype] 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. @@ -79923,7 +83101,7 @@ def __init__(self, profile: 'InstanceProfileIdentity' = None, total_volume_bandwidth: int = None, user_data: str = None, - volume_attachments: List['VolumeAttachmentPrototypeInstanceContext'] = None, + volume_attachments: List['VolumeAttachmentPrototype'] = None, vpc: 'VPCIdentity' = None, boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceByImageContext' = None) -> None: """ @@ -79934,7 +83112,8 @@ def __init__(self, :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 str name: The name for this instance template. The name is unique + across all instance templates in the region. :param ResourceGroupReference resource_group: The resource group for this instance template. :param InstanceCatalogOfferingPrototype catalog_offering: The @@ -79993,9 +83172,8 @@ def __init__(self, :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 List[VolumeAttachmentPrototype] 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. @@ -80059,7 +83237,7 @@ def from_dict(cls, _dict: Dict) -> 'InstanceTemplateInstanceByCatalogOffering': else: 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')] + args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(v) for v in _dict.get('network_interfaces')] if 'placement_target' in _dict: args['placement_target'] = _dict.get('placement_target') if 'profile' in _dict: @@ -80073,7 +83251,7 @@ def from_dict(cls, _dict: Dict) -> 'InstanceTemplateInstanceByCatalogOffering': 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')] + args['volume_attachments'] = [VolumeAttachmentPrototype.from_dict(v) for v in _dict.get('volume_attachments')] if 'vpc' in _dict: args['vpc'] = _dict.get('vpc') if 'boot_volume_attachment' in _dict: @@ -80101,31 +83279,46 @@ 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 isinstance(self.availability_policy, dict): + _dict['availability_policy'] = self.availability_policy + else: + _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 isinstance(self.default_trusted_profile, dict): + _dict['default_trusted_profile'] = self.default_trusted_profile + else: + _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) + for v in self.keys: + if isinstance(v, dict): + keys_list.append(v) else: - keys_list.append(x.to_dict()) + keys_list.append(v.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 isinstance(self.metadata_service, dict): + _dict['metadata_service'] = self.metadata_service + else: + _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] + network_interfaces_list = [] + for v in self.network_interfaces: + if isinstance(v, dict): + network_interfaces_list.append(v) + else: + network_interfaces_list.append(v.to_dict()) + _dict['network_interfaces'] = network_interfaces_list if hasattr(self, 'placement_target') and self.placement_target is not None: if isinstance(self.placement_target, dict): _dict['placement_target'] = self.placement_target @@ -80137,27 +83330,42 @@ def to_dict(self) -> Dict: 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 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] + volume_attachments_list = [] + for v in self.volume_attachments: + if isinstance(v, dict): + volume_attachments_list.append(v) + else: + volume_attachments_list.append(v.to_dict()) + _dict['volume_attachments'] = volume_attachments_list 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 isinstance(self.boot_volume_attachment, dict): + _dict['boot_volume_attachment'] = self.boot_volume_attachment + else: + _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 isinstance(self.primary_network_interface, dict): + _dict['primary_network_interface'] = self.primary_network_interface + else: + _dict['primary_network_interface'] = self.primary_network_interface.to_dict() if hasattr(self, 'zone') and self.zone is not None: if isinstance(self.zone, dict): _dict['zone'] = self.zone @@ -80216,7 +83424,8 @@ class InstanceTemplateInstanceByImage(InstanceTemplate): 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 str name: The name for this instance template. The name is unique across + all instance templates in the region. :attr List[NetworkInterfacePrototype] network_interfaces: (optional) The additional network interfaces to create for the virtual server instance. :attr InstancePlacementTargetPrototype placement_target: (optional) The @@ -80234,9 +83443,8 @@ class InstanceTemplateInstanceByImage(InstanceTemplate): :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 List[VolumeAttachmentPrototype] 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. @@ -80269,7 +83477,7 @@ def __init__(self, profile: 'InstanceProfileIdentity' = None, total_volume_bandwidth: int = None, user_data: str = None, - volume_attachments: List['VolumeAttachmentPrototypeInstanceContext'] = None, + volume_attachments: List['VolumeAttachmentPrototype'] = None, vpc: 'VPCIdentity' = None, boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceByImageContext' = None) -> None: """ @@ -80280,7 +83488,8 @@ def __init__(self, :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 str name: The name for this instance template. The name is unique + across all instance templates in the region. :param ResourceGroupReference resource_group: The resource group for this instance template. :param ImageIdentity image: The image to use when provisioning the virtual @@ -80330,9 +83539,8 @@ def __init__(self, :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 List[VolumeAttachmentPrototype] 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. @@ -80396,7 +83604,7 @@ def from_dict(cls, _dict: Dict) -> 'InstanceTemplateInstanceByImage': 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')] + args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(v) for v in _dict.get('network_interfaces')] if 'placement_target' in _dict: args['placement_target'] = _dict.get('placement_target') if 'profile' in _dict: @@ -80410,7 +83618,7 @@ def from_dict(cls, _dict: Dict) -> 'InstanceTemplateInstanceByImage': 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')] + args['volume_attachments'] = [VolumeAttachmentPrototype.from_dict(v) for v in _dict.get('volume_attachments')] if 'vpc' in _dict: args['vpc'] = _dict.get('vpc') if 'boot_volume_attachment' in _dict: @@ -80438,31 +83646,46 @@ 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 isinstance(self.availability_policy, dict): + _dict['availability_policy'] = self.availability_policy + else: + _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 isinstance(self.default_trusted_profile, dict): + _dict['default_trusted_profile'] = self.default_trusted_profile + else: + _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) + for v in self.keys: + if isinstance(v, dict): + keys_list.append(v) else: - keys_list.append(x.to_dict()) + keys_list.append(v.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 isinstance(self.metadata_service, dict): + _dict['metadata_service'] = self.metadata_service + else: + _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] + network_interfaces_list = [] + for v in self.network_interfaces: + if isinstance(v, dict): + network_interfaces_list.append(v) + else: + network_interfaces_list.append(v.to_dict()) + _dict['network_interfaces'] = network_interfaces_list if hasattr(self, 'placement_target') and self.placement_target is not None: if isinstance(self.placement_target, dict): _dict['placement_target'] = self.placement_target @@ -80474,27 +83697,42 @@ def to_dict(self) -> Dict: 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 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] + volume_attachments_list = [] + for v in self.volume_attachments: + if isinstance(v, dict): + volume_attachments_list.append(v) + else: + volume_attachments_list.append(v.to_dict()) + _dict['volume_attachments'] = volume_attachments_list 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 isinstance(self.boot_volume_attachment, dict): + _dict['boot_volume_attachment'] = self.boot_volume_attachment + else: + _dict['boot_volume_attachment'] = self.boot_volume_attachment.to_dict() if hasattr(self, 'image') and self.image is not None: if isinstance(self.image, dict): _dict['image'] = self.image else: _dict['image'] = self.image.to_dict() if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None: - _dict['primary_network_interface'] = self.primary_network_interface.to_dict() + if isinstance(self.primary_network_interface, dict): + _dict['primary_network_interface'] = self.primary_network_interface + else: + _dict['primary_network_interface'] = self.primary_network_interface.to_dict() if hasattr(self, 'zone') and self.zone is not None: if isinstance(self.zone, dict): _dict['zone'] = self.zone @@ -80553,7 +83791,8 @@ class InstanceTemplateInstanceBySourceSnapshot(InstanceTemplate): 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 str name: The name for this instance template. The name is unique across + all instance templates in the region. :attr List[NetworkInterfacePrototype] network_interfaces: (optional) The additional network interfaces to create for the virtual server instance. :attr InstancePlacementTargetPrototype placement_target: (optional) The @@ -80571,9 +83810,8 @@ class InstanceTemplateInstanceBySourceSnapshot(InstanceTemplate): :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 List[VolumeAttachmentPrototype] 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. @@ -80605,7 +83843,7 @@ def __init__(self, profile: 'InstanceProfileIdentity' = None, total_volume_bandwidth: int = None, user_data: str = None, - volume_attachments: List['VolumeAttachmentPrototypeInstanceContext'] = None, + volume_attachments: List['VolumeAttachmentPrototype'] = None, vpc: 'VPCIdentity' = None) -> None: """ Initialize a InstanceTemplateInstanceBySourceSnapshot object. @@ -80615,7 +83853,8 @@ def __init__(self, :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 str name: The name for this instance template. The name is unique + across all instance templates in the region. :param ResourceGroupReference resource_group: The resource group for this instance template. :param VolumeAttachmentPrototypeInstanceBySourceSnapshotContext @@ -80666,9 +83905,8 @@ def __init__(self, :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 List[VolumeAttachmentPrototype] 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. @@ -80728,7 +83966,7 @@ def from_dict(cls, _dict: Dict) -> 'InstanceTemplateInstanceBySourceSnapshot': else: raise ValueError('Required property \'name\' not present in InstanceTemplateInstanceBySourceSnapshot JSON') if 'network_interfaces' in _dict: - args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(x) for x in _dict.get('network_interfaces')] + args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(v) for v in _dict.get('network_interfaces')] if 'placement_target' in _dict: args['placement_target'] = _dict.get('placement_target') if 'profile' in _dict: @@ -80742,7 +83980,7 @@ def from_dict(cls, _dict: Dict) -> 'InstanceTemplateInstanceBySourceSnapshot': 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')] + args['volume_attachments'] = [VolumeAttachmentPrototype.from_dict(v) for v in _dict.get('volume_attachments')] if 'vpc' in _dict: args['vpc'] = _dict.get('vpc') if 'boot_volume_attachment' in _dict: @@ -80768,31 +84006,46 @@ 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 isinstance(self.availability_policy, dict): + _dict['availability_policy'] = self.availability_policy + else: + _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 isinstance(self.default_trusted_profile, dict): + _dict['default_trusted_profile'] = self.default_trusted_profile + else: + _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) + for v in self.keys: + if isinstance(v, dict): + keys_list.append(v) else: - keys_list.append(x.to_dict()) + keys_list.append(v.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 isinstance(self.metadata_service, dict): + _dict['metadata_service'] = self.metadata_service + else: + _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] + network_interfaces_list = [] + for v in self.network_interfaces: + if isinstance(v, dict): + network_interfaces_list.append(v) + else: + network_interfaces_list.append(v.to_dict()) + _dict['network_interfaces'] = network_interfaces_list if hasattr(self, 'placement_target') and self.placement_target is not None: if isinstance(self.placement_target, dict): _dict['placement_target'] = self.placement_target @@ -80804,22 +84057,37 @@ def to_dict(self) -> Dict: 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 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] + volume_attachments_list = [] + for v in self.volume_attachments: + if isinstance(v, dict): + volume_attachments_list.append(v) + else: + volume_attachments_list.append(v.to_dict()) + _dict['volume_attachments'] = volume_attachments_list 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 isinstance(self.boot_volume_attachment, dict): + _dict['boot_volume_attachment'] = self.boot_volume_attachment + else: + _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 isinstance(self.primary_network_interface, dict): + _dict['primary_network_interface'] = self.primary_network_interface + else: + _dict['primary_network_interface'] = self.primary_network_interface.to_dict() if hasattr(self, 'zone') and self.zone is not None: if isinstance(self.zone, dict): _dict['zone'] = self.zone @@ -81795,7 +85063,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'http_status_code') and self.http_status_code is not None: _dict['http_status_code'] = self.http_status_code if hasattr(self, 'listener') and self.listener is not None: - _dict['listener'] = self.listener.to_dict() + if isinstance(self.listener, dict): + _dict['listener'] = self.listener + else: + _dict['listener'] = self.listener.to_dict() if hasattr(self, 'uri') and self.uri is not None: _dict['uri'] = self.uri return _dict @@ -81894,7 +85165,8 @@ class LoadBalancerListenerPolicyTargetLoadBalancerPoolReference(LoadBalancerList some supplementary information. :attr str href: The pool's canonical URL. :attr str id: The unique identifier for this load balancer pool. - :attr str name: The user-defined name for this load balancer pool. + :attr str name: The name for this load balancer pool. The name is unique across + all pools for the load balancer. """ def __init__(self, @@ -81908,7 +85180,8 @@ 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 name: The name for this load balancer pool. The name is unique + across all pools for the load balancer. :param LoadBalancerPoolReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and provides @@ -81949,7 +85222,10 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -82248,8 +85524,8 @@ class LoadBalancerPoolMemberTargetInstanceReference(LoadBalancerPoolMemberTarget some supplementary information. :attr str href: The URL for this virtual server instance. :attr str id: The unique identifier for this virtual server instance. - :attr str name: The user-defined name for this virtual server instance (and - default system hostname). + :attr str name: The name for this virtual server instance. The name is unique + across all virtual server instances in the region. """ def __init__(self, @@ -82265,8 +85541,8 @@ def __init__(self, :param str crn: The CRN for this virtual server instance. :param str href: The URL for this virtual server instance. :param str id: The unique identifier for this virtual server instance. - :param str name: The user-defined name for this virtual server instance - (and default system hostname). + :param str name: The name for this virtual server instance. The name is + unique across all virtual server instances in the region. :param InstanceReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and provides some supplementary information. @@ -82313,7 +85589,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'crn') and self.crn is not None: _dict['crn'] = self.crn if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -83045,9 +86324,9 @@ class NetworkACLPrototypeNetworkACLByRules(NetworkACLPrototype): """ NetworkACLPrototypeNetworkACLByRules. - :attr 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. + :attr str name: (optional) The name for this network ACL. The name must not be + used by another network ACL for the VPC. 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 will reside in. :attr List[NetworkACLRulePrototypeNetworkACLContext] rules: (optional) The @@ -83065,9 +86344,9 @@ def __init__(self, Initialize a NetworkACLPrototypeNetworkACLByRules object. :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. + :param str name: (optional) The name for this network ACL. The name must + not be used by another network ACL for the VPC. If unspecified, the name + will be a hyphenated list of randomly-selected words. :param ResourceGroupIdentity resource_group: (optional) :param List[NetworkACLRulePrototypeNetworkACLContext] rules: (optional) The prototype objects for rules to create along with this network ACL. If @@ -83093,7 +86372,7 @@ def from_dict(cls, _dict: Dict) -> 'NetworkACLPrototypeNetworkACLByRules': else: raise ValueError('Required property \'vpc\' not present in NetworkACLPrototypeNetworkACLByRules JSON') if 'rules' in _dict: - args['rules'] = [NetworkACLRulePrototypeNetworkACLContext.from_dict(x) for x in _dict.get('rules')] + args['rules'] = [NetworkACLRulePrototypeNetworkACLContext.from_dict(v) for v in _dict.get('rules')] return cls(**args) @classmethod @@ -83117,7 +86396,13 @@ def to_dict(self) -> Dict: else: _dict['vpc'] = self.vpc.to_dict() if hasattr(self, 'rules') and self.rules is not None: - _dict['rules'] = [x.to_dict() for x in self.rules] + rules_list = [] + for v in self.rules: + if isinstance(v, dict): + rules_list.append(v) + else: + rules_list.append(v.to_dict()) + _dict['rules'] = rules_list return _dict def _to_dict(self): @@ -83142,9 +86427,9 @@ class NetworkACLPrototypeNetworkACLBySourceNetworkACL(NetworkACLPrototype): """ NetworkACLPrototypeNetworkACLBySourceNetworkACL. - :attr 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. + :attr str name: (optional) The name for this network ACL. The name must not be + used by another network ACL for the VPC. 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 will reside in. :attr NetworkACLIdentity source_network_acl: Network ACL to copy rules from. @@ -83162,9 +86447,9 @@ def __init__(self, :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. - 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. + :param str name: (optional) The name for this network ACL. The name must + not be used by another network ACL for the VPC. If unspecified, the name + will be a hyphenated list of randomly-selected words. :param ResourceGroupIdentity resource_group: (optional) """ # pylint: disable=super-init-not-called @@ -83479,7 +86764,8 @@ class NetworkACLRuleItemNetworkACLRuleProtocolAll(NetworkACLRuleItem): :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 network ACL rule. + :attr str name: The name for this network ACL rule. The name is unique across + all rules for the network ACL. :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. @@ -83509,7 +86795,8 @@ def __init__(self, :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 network ACL rule. + :param str name: The name for this network ACL rule. The name is unique + across all rules for the network ACL. :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. @@ -83589,7 +86876,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'action') and self.action is not None: _dict['action'] = self.action if hasattr(self, 'before') and self.before is not None: - _dict['before'] = self.before.to_dict() + if isinstance(self.before, dict): + _dict['before'] = self.before + else: + _dict['before'] = self.before.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, 'destination') and self.destination is not None: @@ -83673,7 +86963,8 @@ class NetworkACLRuleItemNetworkACLRuleProtocolICMP(NetworkACLRuleItem): :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 network ACL rule. + :attr str name: The name for this network ACL rule. The name is unique across + all rules for the network ACL. :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. @@ -83709,7 +87000,8 @@ def __init__(self, :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 network ACL rule. + :param str name: The name for this network ACL rule. The name is unique + across all rules for the network ACL. :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. @@ -83799,7 +87091,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'action') and self.action is not None: _dict['action'] = self.action if hasattr(self, 'before') and self.before is not None: - _dict['before'] = self.before.to_dict() + if isinstance(self.before, dict): + _dict['before'] = self.before + else: + _dict['before'] = self.before.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, 'destination') and self.destination is not None: @@ -83887,7 +87182,8 @@ class NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP(NetworkACLRuleItem): :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 network ACL rule. + :attr str name: The name for this network ACL rule. The name is unique across + all rules for the network ACL. :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 @@ -83929,7 +87225,8 @@ def __init__(self, :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 network ACL rule. + :param str name: The name for this network ACL rule. The name is unique + across all rules for the network ACL. :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 @@ -84037,7 +87334,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'action') and self.action is not None: _dict['action'] = self.action if hasattr(self, 'before') and self.before is not None: - _dict['before'] = self.before.to_dict() + if isinstance(self.before, dict): + _dict['before'] = self.before + else: + _dict['before'] = self.before.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, 'destination') and self.destination is not None: @@ -84123,9 +87423,9 @@ class NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype :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 name: (optional) The name for this network ACL rule. The name must not + be used by another rule for the network ACL. If unspecified, the name will be a + hyphenated list of randomly-selected words. :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. @@ -84149,8 +87449,8 @@ def __init__(self, :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 + :param str name: (optional) The name for this network ACL rule. The name + must not be used by another rule for the network ACL. If unspecified, the name will be a hyphenated list of randomly-selected words. """ # pylint: disable=super-init-not-called @@ -84260,9 +87560,9 @@ class NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototyp :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 name: (optional) The name for this network ACL rule. The name must not + be used by another rule for the network ACL. If unspecified, the name will be a + hyphenated list of randomly-selected words. :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. @@ -84293,8 +87593,8 @@ def __init__(self, :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 + :param str name: (optional) The name for this network ACL rule. The name + must not be used by another rule for the network ACL. If unspecified, the name will be a hyphenated list of randomly-selected words. :param int code: (optional) The ICMP traffic code to match. If specified, `type` must also be specified. If unspecified, all codes are @@ -84419,9 +87719,9 @@ class NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPProtot :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 name: (optional) The name for this network ACL rule. The name must not + be used by another rule for the network ACL. If unspecified, the name will be a + hyphenated list of randomly-selected words. :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 @@ -84457,8 +87757,8 @@ def __init__(self, :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 + :param str name: (optional) The name for this network ACL rule. The name + must not be used by another rule for the network ACL. If unspecified, the name will be a hyphenated list of randomly-selected words. :param int destination_port_max: (optional) The inclusive upper bound of TCP/UDP destination port range. @@ -84598,9 +87898,9 @@ class NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype(NetworkACLRulePr :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 name: (optional) The name for this network ACL rule. The name must not + be used by another rule for the network ACL. If unspecified, the name will be a + hyphenated list of randomly-selected words. :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. @@ -84626,8 +87926,8 @@ def __init__(self, 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 + :param str name: (optional) The name for this network ACL rule. The name + must not be used by another rule for the network ACL. If unspecified, the name will be a hyphenated list of randomly-selected words. """ # pylint: disable=super-init-not-called @@ -84746,9 +88046,9 @@ class NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype(NetworkACLRuleP :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 name: (optional) The name for this network ACL rule. The name must not + be used by another rule for the network ACL. If unspecified, the name will be a + hyphenated list of randomly-selected words. :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. @@ -84781,8 +88081,8 @@ def __init__(self, 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 + :param str name: (optional) The name for this network ACL rule. The name + must not be used by another rule for the network ACL. If unspecified, the name will be a hyphenated list of randomly-selected words. :param int code: (optional) The ICMP traffic code to match. If specified, `type` must also be specified. If unspecified, all codes are @@ -84916,9 +88216,9 @@ class NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype(NetworkACLRul :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 name: (optional) The name for this network ACL rule. The name must not + be used by another rule for the network ACL. If unspecified, the name will be a + hyphenated list of randomly-selected words. :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 @@ -84956,8 +88256,8 @@ def __init__(self, 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 + :param str name: (optional) The name for this network ACL rule. The name + must not be used by another rule for the network ACL. If unspecified, the name will be a hyphenated list of randomly-selected words. :param int destination_port_max: (optional) The inclusive upper bound of TCP/UDP destination port range. @@ -85110,7 +88410,8 @@ class NetworkACLRuleNetworkACLRuleProtocolAll(NetworkACLRule): :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 network ACL rule. + :attr str name: The name for this network ACL rule. The name is unique across + all rules for the network ACL. :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. @@ -85140,7 +88441,8 @@ def __init__(self, :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 network ACL rule. + :param str name: The name for this network ACL rule. The name is unique + across all rules for the network ACL. :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. @@ -85219,7 +88521,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'action') and self.action is not None: _dict['action'] = self.action if hasattr(self, 'before') and self.before is not None: - _dict['before'] = self.before.to_dict() + if isinstance(self.before, dict): + _dict['before'] = self.before + else: + _dict['before'] = self.before.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, 'destination') and self.destination is not None: @@ -85302,7 +88607,8 @@ class NetworkACLRuleNetworkACLRuleProtocolICMP(NetworkACLRule): :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 network ACL rule. + :attr str name: The name for this network ACL rule. The name is unique across + all rules for the network ACL. :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. @@ -85338,7 +88644,8 @@ def __init__(self, :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 network ACL rule. + :param str name: The name for this network ACL rule. The name is unique + across all rules for the network ACL. :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. @@ -85427,7 +88734,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'action') and self.action is not None: _dict['action'] = self.action if hasattr(self, 'before') and self.before is not None: - _dict['before'] = self.before.to_dict() + if isinstance(self.before, dict): + _dict['before'] = self.before + else: + _dict['before'] = self.before.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, 'destination') and self.destination is not None: @@ -85514,7 +88824,8 @@ class NetworkACLRuleNetworkACLRuleProtocolTCPUDP(NetworkACLRule): :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 network ACL rule. + :attr str name: The name for this network ACL rule. The name is unique across + all rules for the network ACL. :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 @@ -85556,7 +88867,8 @@ def __init__(self, :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 network ACL rule. + :param str name: The name for this network ACL rule. The name is unique + across all rules for the network ACL. :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 @@ -85663,7 +88975,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'action') and self.action is not None: _dict['action'] = self.action if hasattr(self, 'before') and self.before is not None: - _dict['before'] = self.before.to_dict() + if isinstance(self.before, dict): + _dict['before'] = self.before + else: + _dict['before'] = self.before.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, 'destination') and self.destination is not None: @@ -85768,10 +89083,10 @@ class NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext(Netw :attr bool auto_delete: (optional) Indicates whether this reserved IP member will be automatically deleted when either `target` is deleted, or the reserved IP is unbound. - :attr str name: (optional) The user-defined name for this reserved IP. If - unspecified, the name will be a hyphenated list of randomly-selected words. - Names must be unique within the subnet the reserved IP resides in. Names - beginning with `ibm-` are reserved for provider-owned resources. + :attr str name: (optional) The name for this reserved IP. The name must not be + used by another reserved IP in the subnet. Names starting with `ibm-` are + reserved for provider-owned resources, and are not allowed. If unspecified, the + name will be a hyphenated list of randomly-selected words. """ def __init__(self, @@ -85789,10 +89104,10 @@ def __init__(self, :param bool auto_delete: (optional) Indicates whether this reserved IP member will be automatically deleted when either `target` is deleted, or the reserved IP is unbound. - :param str name: (optional) The user-defined name for this reserved IP. If + :param str name: (optional) The name for this reserved IP. The name must + not be used by another reserved IP in the subnet. Names starting with + `ibm-` are reserved for provider-owned resources, and are not allowed. If unspecified, the name will be a hyphenated list of randomly-selected words. - Names must be unique within the subnet the reserved IP resides in. Names - beginning with `ibm-` are reserved for provider-owned resources. """ # pylint: disable=super-init-not-called self.address = address @@ -85979,8 +89294,9 @@ class PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext(PublicGat """ PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext. - :attr str name: (optional) The unique user-defined name for this floating IP. If - unspecified, the name will be a hyphenated list of randomly-selected words. + :attr str name: (optional) The name for this floating IP. The name must not be + used by another floating IP in the region. If unspecified, the name will be a + hyphenated list of randomly-selected words. :attr ResourceGroupIdentity resource_group: (optional) The resource group to use. If unspecified, the account's [default resource group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. @@ -85993,9 +89309,9 @@ def __init__(self, """ Initialize a PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext object. - :param str name: (optional) The unique user-defined name for this floating - IP. If unspecified, the name will be a hyphenated list of randomly-selected - words. + :param str name: (optional) The name for this floating IP. The name must + not be used by another floating IP in the region. If unspecified, the name + will be a hyphenated list of randomly-selected words. :param ResourceGroupIdentity resource_group: (optional) The resource group to use. If unspecified, the account's [default resource group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is @@ -86247,7 +89563,8 @@ class ReservedIPTargetEndpointGatewayReference(ReservedIPTarget): some supplementary information. :attr str href: The URL for this endpoint gateway. :attr str id: The unique identifier for this endpoint gateway. - :attr str name: The unique user-defined name for this endpoint gateway. + :attr str name: The name for this endpoint gateway. The name is unique across + all endpoint gateways in the VPC. :attr str resource_type: The resource type. """ @@ -86265,7 +89582,8 @@ def __init__(self, :param str crn: The CRN for this endpoint gateway. :param str href: The URL for this endpoint gateway. :param str id: The unique identifier for this endpoint gateway. - :param str name: The unique user-defined name for this endpoint gateway. + :param str name: The name for this endpoint gateway. The name is unique + across all endpoint gateways in the VPC. :param str resource_type: The resource type. :param EndpointGatewayReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and provides @@ -86318,7 +89636,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'crn') and self.crn is not None: _dict['crn'] = self.crn if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -86411,7 +89732,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'crn') and self.crn is not None: _dict['crn'] = self.crn if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'resource_type') and self.resource_type is not None: _dict['resource_type'] = self.resource_type return _dict @@ -86451,7 +89775,8 @@ class ReservedIPTargetLoadBalancerReference(ReservedIPTarget): some supplementary information. :attr str href: The load balancer's canonical URL. :attr str id: The unique identifier for this load balancer. - :attr str name: The unique user-defined name for this load balancer. + :attr str name: The name for this load balancer. The name is unique across all + load balancers in the VPC. :attr str resource_type: The resource type. """ @@ -86469,7 +89794,8 @@ def __init__(self, :param str crn: The load balancer's CRN. :param str href: The load balancer's canonical URL. :param str id: The unique identifier for this load balancer. - :param str name: The unique user-defined name for this load balancer. + :param str name: The name for this load balancer. The name is unique across + all load balancers in the VPC. :param str resource_type: The resource type. :param LoadBalancerReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and provides @@ -86522,7 +89848,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'crn') and self.crn is not None: _dict['crn'] = self.crn if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -86568,7 +89897,7 @@ class ReservedIPTargetNetworkInterfaceReferenceTargetContext(ReservedIPTarget): some supplementary information. :attr str href: The URL for this network interface. :attr str id: The unique identifier for this network interface. - :attr str name: The user-defined name for this network interface. + :attr str name: The name for this network interface. :attr str resource_type: The resource type. """ @@ -86584,7 +89913,7 @@ def __init__(self, :param str href: The URL for this network interface. :param str id: The unique identifier for this network interface. - :param str name: The user-defined name for this network interface. + :param str name: The 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, @@ -86631,7 +89960,10 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -86677,7 +90009,8 @@ class ReservedIPTargetVPNGatewayReference(ReservedIPTarget): some supplementary information. :attr str href: The VPN gateway's canonical URL. :attr str id: The unique identifier for this VPN gateway. - :attr str name: The user-defined name for this VPN gateway. + :attr str name: The name for this VPN gateway. The name is unique across all VPN + gateways in the VPC. :attr str resource_type: The resource type. """ @@ -86695,7 +90028,8 @@ def __init__(self, :param str crn: The VPN gateway's CRN. :param str href: The VPN gateway's canonical URL. :param str id: The unique identifier for this VPN gateway. - :param str name: The user-defined name for this VPN gateway. + :param str name: The name for this VPN gateway. The name is unique across + all VPN gateways in the VPC. :param str resource_type: The resource type. :param VPNGatewayReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and provides @@ -86748,7 +90082,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'crn') and self.crn is not None: _dict['crn'] = self.crn if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -86794,7 +90131,8 @@ class ReservedIPTargetVPNServerReference(ReservedIPTarget): some supplementary information. :attr str href: The URL for this VPN server. :attr str id: The unique identifier for this VPN server. - :attr str name: The unique user-defined name for this VPN server. + :attr str name: The name for this VPN server. The name is unique across all VPN + servers in the VPC. :attr str resource_type: The resource type. """ @@ -86812,7 +90150,8 @@ def __init__(self, :param str crn: The CRN for this VPN server. :param str href: The URL for this VPN server. :param str id: The unique identifier for this VPN server. - :param str name: The unique user-defined name for this VPN server. + :param str name: The name for this VPN server. The name is unique across + all VPN servers in the VPC. :param str resource_type: The resource type. :param VPNServerReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and provides @@ -86865,7 +90204,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'crn') and self.crn is not None: _dict['crn'] = self.crn if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -86968,7 +90310,8 @@ class RouteCreatorVPNGatewayReference(RouteCreator): some supplementary information. :attr str href: The VPN gateway's canonical URL. :attr str id: The unique identifier for this VPN gateway. - :attr str name: The user-defined name for this VPN gateway. + :attr str name: The name for this VPN gateway. The name is unique across all VPN + gateways in the VPC. :attr str resource_type: The resource type. """ @@ -86986,7 +90329,8 @@ def __init__(self, :param str crn: The VPN gateway's CRN. :param str href: The VPN gateway's canonical URL. :param str id: The unique identifier for this VPN gateway. - :param str name: The user-defined name for this VPN gateway. + :param str name: The name for this VPN gateway. The name is unique across + all VPN gateways in the VPC. :param str resource_type: The resource type. :param VPNGatewayReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and provides @@ -87039,7 +90383,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'crn') and self.crn is not None: _dict['crn'] = self.crn if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -87085,7 +90432,8 @@ class RouteCreatorVPNServerReference(RouteCreator): some supplementary information. :attr str href: The URL for this VPN server. :attr str id: The unique identifier for this VPN server. - :attr str name: The unique user-defined name for this VPN server. + :attr str name: The name for this VPN server. The name is unique across all VPN + servers in the VPC. :attr str resource_type: The resource type. """ @@ -87103,7 +90451,8 @@ def __init__(self, :param str crn: The CRN for this VPN server. :param str href: The URL for this VPN server. :param str id: The unique identifier for this VPN server. - :param str name: The unique user-defined name for this VPN server. + :param str name: The name for this VPN server. The name is unique across + all VPN servers in the VPC. :param str resource_type: The resource type. :param VPNServerReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and provides @@ -87156,7 +90505,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'crn') and self.crn is not None: _dict['crn'] = self.crn if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -87267,7 +90619,8 @@ class RouteNextHopVPNGatewayConnectionReference(RouteNextHop): some supplementary information. :attr str href: The VPN connection's canonical URL. :attr str id: The unique identifier for this VPN gateway connection. - :attr str name: The user-defined name for this VPN connection. + :attr str name: The name for this VPN gateway connection. The name is unique + across all connections for the VPN gateway. :attr str resource_type: The resource type. """ @@ -87283,7 +90636,8 @@ def __init__(self, :param str href: The VPN connection's canonical URL. :param str id: The unique identifier for this VPN gateway connection. - :param str name: The user-defined name for this VPN connection. + :param str name: The name for this VPN gateway connection. The name is + unique across all connections for the VPN gateway. :param str resource_type: The resource type. :param VPNGatewayConnectionReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and @@ -87330,7 +90684,10 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -88624,8 +91981,8 @@ class SecurityGroupRuleRemoteSecurityGroupReference(SecurityGroupRuleRemote): some supplementary information. :attr str href: The security group's canonical URL. :attr str id: The unique identifier for this security group. - :attr str name: The user-defined name for this security group. Names must be - unique within the VPC the security group resides in. + :attr str name: The name for this security group. The name is unique across all + security groups for the VPC. """ def __init__(self, @@ -88641,8 +91998,8 @@ def __init__(self, :param str crn: The security group's CRN. :param str href: The security group's canonical URL. :param str id: The unique identifier for this security group. - :param str name: The user-defined name for this security group. Names must - be unique within the VPC the security group resides in. + :param str name: The name for this security group. The name is unique + across all security groups for the VPC. :param SecurityGroupReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and provides some supplementary information. @@ -88689,7 +92046,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'crn') and self.crn is not None: _dict['crn'] = self.crn if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -89199,7 +92559,8 @@ class SecurityGroupTargetReferenceEndpointGatewayReference(SecurityGroupTargetRe some supplementary information. :attr str href: The URL for this endpoint gateway. :attr str id: The unique identifier for this endpoint gateway. - :attr str name: The unique user-defined name for this endpoint gateway. + :attr str name: The name for this endpoint gateway. The name is unique across + all endpoint gateways in the VPC. :attr str resource_type: The resource type. """ @@ -89217,7 +92578,8 @@ def __init__(self, :param str crn: The CRN for this endpoint gateway. :param str href: The URL for this endpoint gateway. :param str id: The unique identifier for this endpoint gateway. - :param str name: The unique user-defined name for this endpoint gateway. + :param str name: The name for this endpoint gateway. The name is unique + across all endpoint gateways in the VPC. :param str resource_type: The resource type. :param EndpointGatewayReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and provides @@ -89270,7 +92632,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'crn') and self.crn is not None: _dict['crn'] = self.crn if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -89316,7 +92681,8 @@ class SecurityGroupTargetReferenceLoadBalancerReference(SecurityGroupTargetRefer some supplementary information. :attr str href: The load balancer's canonical URL. :attr str id: The unique identifier for this load balancer. - :attr str name: The unique user-defined name for this load balancer. + :attr str name: The name for this load balancer. The name is unique across all + load balancers in the VPC. :attr str resource_type: The resource type. """ @@ -89334,7 +92700,8 @@ def __init__(self, :param str crn: The load balancer's CRN. :param str href: The load balancer's canonical URL. :param str id: The unique identifier for this load balancer. - :param str name: The unique user-defined name for this load balancer. + :param str name: The name for this load balancer. The name is unique across + all load balancers in the VPC. :param str resource_type: The resource type. :param LoadBalancerReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and provides @@ -89387,7 +92754,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'crn') and self.crn is not None: _dict['crn'] = self.crn if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -89433,7 +92803,7 @@ class SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext(Securit some supplementary information. :attr str href: The URL for this network interface. :attr str id: The unique identifier for this network interface. - :attr str name: The user-defined name for this network interface. + :attr str name: The name for this network interface. :attr str resource_type: The resource type. """ @@ -89449,7 +92819,7 @@ def __init__(self, :param str href: The URL for this network interface. :param str id: The unique identifier for this network interface. - :param str name: The user-defined name for this network interface. + :param str name: The 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, @@ -89496,7 +92866,10 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -89542,7 +92915,8 @@ class SecurityGroupTargetReferenceVPNServerReference(SecurityGroupTargetReferenc some supplementary information. :attr str href: The URL for this VPN server. :attr str id: The unique identifier for this VPN server. - :attr str name: The unique user-defined name for this VPN server. + :attr str name: The name for this VPN server. The name is unique across all VPN + servers in the VPC. :attr str resource_type: The resource type. """ @@ -89560,7 +92934,8 @@ def __init__(self, :param str crn: The CRN for this VPN server. :param str href: The URL for this VPN server. :param str id: The unique identifier for this VPN server. - :param str name: The unique user-defined name for this VPN server. + :param str name: The name for this VPN server. The name is unique across + all VPN servers in the VPC. :param str resource_type: The resource type. :param VPNServerReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and provides @@ -89613,7 +92988,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'crn') and self.crn is not None: _dict['crn'] = self.crn if hasattr(self, 'deleted') and self.deleted is not None: - _dict['deleted'] = self.deleted.to_dict() + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -89824,8 +93202,9 @@ class SnapshotPrototypeSnapshotBySourceVolume(SnapshotPrototype): """ SnapshotPrototypeSnapshotBySourceVolume. - :attr str name: (optional) The unique user-defined name for this snapshot. If - unspecified, the name will be a hyphenated list of randomly-selected words. + :attr str name: (optional) The name for this snapshot. The name must not be used + by another snapshot in the region. If unspecified, the name will be a hyphenated + list of randomly-selected words. :attr ResourceGroupIdentity resource_group: (optional) :attr List[str] user_tags: (optional) The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this @@ -89844,9 +93223,9 @@ def __init__(self, :param VolumeIdentity source_volume: The volume to create this snapshot from. - :param str name: (optional) The unique user-defined name for this snapshot. - If unspecified, the name will be a hyphenated list of randomly-selected - words. + :param str name: (optional) The name for this snapshot. The name must not + be used by another snapshot in the region. If unspecified, the name will be + a hyphenated list of randomly-selected words. :param ResourceGroupIdentity resource_group: (optional) :param List[str] user_tags: (optional) The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with @@ -90092,9 +93471,9 @@ class SubnetPrototypeSubnetByCIDR(SubnetPrototype): SubnetPrototypeSubnetByCIDR. :attr str ip_version: (optional) The IP version(s) to support for this subnet. - :attr str name: (optional) The user-defined name for this subnet. Names must be - unique within the VPC the subnet resides in. If unspecified, the name will be a - hyphenated list of randomly-selected words. + :attr str name: (optional) The name for this subnet. The name must not be used + by another subnet in the VPC. If unspecified, the name will be a hyphenated list + of randomly-selected words. :attr NetworkACLIdentity network_acl: (optional) The network ACL to use for this subnet. If unspecified, the default network ACL for the VPC is used. :attr PublicGatewayIdentity public_gateway: (optional) The public gateway to use @@ -90142,9 +93521,9 @@ def __init__(self, subnet's IPv4 CIDR. :param str ip_version: (optional) The IP version(s) to support for this subnet. - :param str name: (optional) The user-defined name for this subnet. Names - must be unique within the VPC the subnet resides in. If unspecified, the - name will be a hyphenated list of randomly-selected words. + :param str name: (optional) The name for this subnet. The name must not be + used by another subnet in the VPC. If unspecified, the name will be a + hyphenated list of randomly-selected words. :param NetworkACLIdentity network_acl: (optional) The network ACL to use for this subnet. If unspecified, the default network ACL for the VPC is used. @@ -90274,9 +93653,9 @@ class SubnetPrototypeSubnetByTotalCount(SubnetPrototype): SubnetPrototypeSubnetByTotalCount. :attr str ip_version: (optional) The IP version(s) to support for this subnet. - :attr str name: (optional) The user-defined name for this subnet. Names must be - unique within the VPC the subnet resides in. If unspecified, the name will be a - hyphenated list of randomly-selected words. + :attr str name: (optional) The name for this subnet. The name must not be used + by another subnet in the VPC. If unspecified, the name will be a hyphenated list + of randomly-selected words. :attr NetworkACLIdentity network_acl: (optional) The network ACL to use for this subnet. If unspecified, the default network ACL for the VPC is used. :attr PublicGatewayIdentity public_gateway: (optional) The public gateway to use @@ -90318,9 +93697,9 @@ def __init__(self, :param ZoneIdentity zone: The zone this 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 - must be unique within the VPC the subnet resides in. If unspecified, the - name will be a hyphenated list of randomly-selected words. + :param str name: (optional) The name for this subnet. The name must not be + used by another subnet in the VPC. If unspecified, the name will be a + hyphenated list of randomly-selected words. :param NetworkACLIdentity network_acl: (optional) The network ACL to use for this subnet. If unspecified, the default network ACL for the VPC is used. @@ -91367,8 +94746,8 @@ class VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch(VPNGatew :attr VPNGatewayConnectionDPDPatch dead_peer_detection: (optional) :attr VPNGatewayConnectionIKEPolicyPatch ike_policy: (optional) :attr VPNGatewayConnectionIPsecPolicyPatch ipsec_policy: (optional) - :attr str name: (optional) The user-defined name for this VPN gateway - connection. + :attr str name: (optional) The name for this VPN gateway connection. The name + must not be used by another connection for the VPN gateway. :attr str peer_address: (optional) The IP address of the peer VPN gateway. :attr str psk: (optional) The preshared key. :attr str routing_protocol: (optional) Routing protocols are disabled for this @@ -91393,8 +94772,8 @@ def __init__(self, :param VPNGatewayConnectionDPDPatch dead_peer_detection: (optional) :param VPNGatewayConnectionIKEPolicyPatch ike_policy: (optional) :param VPNGatewayConnectionIPsecPolicyPatch ipsec_policy: (optional) - :param str name: (optional) The user-defined name for this VPN gateway - connection. + :param str name: (optional) The name for this VPN gateway connection. The + name must not be used by another connection for the VPN gateway. :param str peer_address: (optional) The IP address of the peer VPN gateway. :param str psk: (optional) The preshared key. :param str routing_protocol: (optional) Routing protocols are disabled for @@ -91443,7 +94822,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'admin_state_up') and self.admin_state_up is not None: _dict['admin_state_up'] = self.admin_state_up if hasattr(self, 'dead_peer_detection') and self.dead_peer_detection is not None: - _dict['dead_peer_detection'] = self.dead_peer_detection.to_dict() + if isinstance(self.dead_peer_detection, dict): + _dict['dead_peer_detection'] = self.dead_peer_detection + else: + _dict['dead_peer_detection'] = self.dead_peer_detection.to_dict() if hasattr(self, 'ike_policy') and self.ike_policy is not None: if isinstance(self.ike_policy, dict): _dict['ike_policy'] = self.ike_policy @@ -91509,7 +94891,8 @@ class VPNGatewayConnectionPolicyMode(VPNGatewayConnection): [auto-negotiation is used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ipsec-auto-negotiation-phase-2). :attr str mode: The mode of the VPN gateway. - :attr str name: The user-defined name for this VPN gateway connection. + :attr str name: The name for this VPN gateway connection. The name is unique + across all connections for the VPN gateway. :attr str peer_address: The IP address of the peer VPN gateway. :attr str psk: The preshared key. :attr str resource_type: The resource type. @@ -91549,7 +94932,8 @@ def __init__(self, :param str href: The VPN connection's canonical URL. :param str id: The unique identifier for this VPN gateway connection. :param str mode: The mode of the VPN gateway. - :param str name: The user-defined name for this VPN gateway connection. + :param str name: The name for this VPN gateway connection. The name is + unique across all connections for the VPN gateway. :param str peer_address: The IP address of the peer VPN gateway. :param str psk: The preshared key. :param str resource_type: The resource type. @@ -91662,15 +95046,24 @@ def to_dict(self) -> 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, 'dead_peer_detection') and self.dead_peer_detection is not None: - _dict['dead_peer_detection'] = self.dead_peer_detection.to_dict() + if isinstance(self.dead_peer_detection, dict): + _dict['dead_peer_detection'] = self.dead_peer_detection + else: + _dict['dead_peer_detection'] = self.dead_peer_detection.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, 'ike_policy') and self.ike_policy is not None: - _dict['ike_policy'] = self.ike_policy.to_dict() + if isinstance(self.ike_policy, dict): + _dict['ike_policy'] = self.ike_policy + else: + _dict['ike_policy'] = self.ike_policy.to_dict() if hasattr(self, 'ipsec_policy') and self.ipsec_policy is not None: - _dict['ipsec_policy'] = self.ipsec_policy.to_dict() + if isinstance(self.ipsec_policy, dict): + _dict['ipsec_policy'] = self.ipsec_policy + else: + _dict['ipsec_policy'] = self.ipsec_policy.to_dict() if hasattr(self, 'mode') and self.mode is not None: _dict['mode'] = self.mode if hasattr(self, 'name') and self.name is not None: @@ -91746,8 +95139,9 @@ class VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype(VPNGa :attr VPNGatewayConnectionDPDPrototype dead_peer_detection: (optional) :attr VPNGatewayConnectionIKEPolicyPrototype ike_policy: (optional) :attr VPNGatewayConnectionIPsecPolicyPrototype ipsec_policy: (optional) - :attr str name: (optional) The user-defined name for this VPN gateway - connection. + :attr str name: (optional) The name for this VPN gateway connection. The name + must not be used by another connection for the VPN gateway. If unspecified, the + name will be a hyphenated list of randomly-selected words. :attr str peer_address: The IP address of the peer VPN gateway. :attr str psk: The preshared key. :attr List[str] local_cidrs: The local CIDRs for this resource. @@ -91777,8 +95171,9 @@ def __init__(self, :param VPNGatewayConnectionDPDPrototype dead_peer_detection: (optional) :param VPNGatewayConnectionIKEPolicyPrototype ike_policy: (optional) :param VPNGatewayConnectionIPsecPolicyPrototype ipsec_policy: (optional) - :param str name: (optional) The user-defined name for this VPN gateway - connection. + :param str name: (optional) The name for this VPN gateway connection. The + name must not be used by another connection for the VPN gateway. If + unspecified, the name will be a hyphenated list of randomly-selected words. """ # pylint: disable=super-init-not-called self.admin_state_up = admin_state_up @@ -91834,7 +95229,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'admin_state_up') and self.admin_state_up is not None: _dict['admin_state_up'] = self.admin_state_up if hasattr(self, 'dead_peer_detection') and self.dead_peer_detection is not None: - _dict['dead_peer_detection'] = self.dead_peer_detection.to_dict() + if isinstance(self.dead_peer_detection, dict): + _dict['dead_peer_detection'] = self.dead_peer_detection + else: + _dict['dead_peer_detection'] = self.dead_peer_detection.to_dict() if hasattr(self, 'ike_policy') and self.ike_policy is not None: if isinstance(self.ike_policy, dict): _dict['ike_policy'] = self.ike_policy @@ -91884,8 +95282,9 @@ class VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype( :attr VPNGatewayConnectionDPDPrototype dead_peer_detection: (optional) :attr VPNGatewayConnectionIKEPolicyPrototype ike_policy: (optional) :attr VPNGatewayConnectionIPsecPolicyPrototype ipsec_policy: (optional) - :attr str name: (optional) The user-defined name for this VPN gateway - connection. + :attr str name: (optional) The name for this VPN gateway connection. The name + must not be used by another connection for the VPN gateway. If unspecified, the + name will be a hyphenated list of randomly-selected words. :attr str peer_address: The IP address of the peer VPN gateway. :attr str psk: The preshared key. :attr str routing_protocol: (optional) Routing protocols are disabled for this @@ -91912,8 +95311,9 @@ def __init__(self, :param VPNGatewayConnectionDPDPrototype dead_peer_detection: (optional) :param VPNGatewayConnectionIKEPolicyPrototype ike_policy: (optional) :param VPNGatewayConnectionIPsecPolicyPrototype ipsec_policy: (optional) - :param str name: (optional) The user-defined name for this VPN gateway - connection. + :param str name: (optional) The name for this VPN gateway connection. The + name must not be used by another connection for the VPN gateway. If + unspecified, the name will be a hyphenated list of randomly-selected words. :param str routing_protocol: (optional) Routing protocols are disabled for this VPN gateway connection. """ @@ -91964,7 +95364,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'admin_state_up') and self.admin_state_up is not None: _dict['admin_state_up'] = self.admin_state_up if hasattr(self, 'dead_peer_detection') and self.dead_peer_detection is not None: - _dict['dead_peer_detection'] = self.dead_peer_detection.to_dict() + if isinstance(self.dead_peer_detection, dict): + _dict['dead_peer_detection'] = self.dead_peer_detection + else: + _dict['dead_peer_detection'] = self.dead_peer_detection.to_dict() if hasattr(self, 'ike_policy') and self.ike_policy is not None: if isinstance(self.ike_policy, dict): _dict['ike_policy'] = self.ike_policy @@ -92030,7 +95433,8 @@ class VPNGatewayConnectionStaticRouteMode(VPNGatewayConnection): [auto-negotiation is used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ipsec-auto-negotiation-phase-2). :attr str mode: The mode of the VPN gateway. - :attr str name: The user-defined name for this VPN gateway connection. + :attr str name: The name for this VPN gateway connection. The name is unique + across all connections for the VPN gateway. :attr str peer_address: The IP address of the peer VPN gateway. :attr str psk: The preshared key. :attr str resource_type: The resource type. @@ -92072,7 +95476,8 @@ def __init__(self, :param str href: The VPN connection's canonical URL. :param str id: The unique identifier for this VPN gateway connection. :param str mode: The mode of the VPN gateway. - :param str name: The user-defined name for this VPN gateway connection. + :param str name: The name for this VPN gateway connection. The name is + unique across all connections for the VPN gateway. :param str peer_address: The IP address of the peer VPN gateway. :param str psk: The preshared key. :param str resource_type: The resource type. @@ -92168,7 +95573,7 @@ def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionStaticRouteMode': else: raise ValueError('Required property \'routing_protocol\' not present in VPNGatewayConnectionStaticRouteMode JSON') if 'tunnels' in _dict: - args['tunnels'] = [VPNGatewayConnectionStaticRouteModeTunnel.from_dict(x) for x in _dict.get('tunnels')] + args['tunnels'] = [VPNGatewayConnectionStaticRouteModeTunnel.from_dict(v) for v in _dict.get('tunnels')] else: raise ValueError('Required property \'tunnels\' not present in VPNGatewayConnectionStaticRouteMode JSON') return cls(**args) @@ -92188,15 +95593,24 @@ def to_dict(self) -> 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, 'dead_peer_detection') and self.dead_peer_detection is not None: - _dict['dead_peer_detection'] = self.dead_peer_detection.to_dict() + if isinstance(self.dead_peer_detection, dict): + _dict['dead_peer_detection'] = self.dead_peer_detection + else: + _dict['dead_peer_detection'] = self.dead_peer_detection.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, 'ike_policy') and self.ike_policy is not None: - _dict['ike_policy'] = self.ike_policy.to_dict() + if isinstance(self.ike_policy, dict): + _dict['ike_policy'] = self.ike_policy + else: + _dict['ike_policy'] = self.ike_policy.to_dict() if hasattr(self, 'ipsec_policy') and self.ipsec_policy is not None: - _dict['ipsec_policy'] = self.ipsec_policy.to_dict() + if isinstance(self.ipsec_policy, dict): + _dict['ipsec_policy'] = self.ipsec_policy + else: + _dict['ipsec_policy'] = self.ipsec_policy.to_dict() if hasattr(self, 'mode') and self.mode is not None: _dict['mode'] = self.mode if hasattr(self, 'name') and self.name is not None: @@ -92212,7 +95626,13 @@ def to_dict(self) -> Dict: if hasattr(self, 'routing_protocol') and self.routing_protocol is not None: _dict['routing_protocol'] = self.routing_protocol if hasattr(self, 'tunnels') and self.tunnels is not None: - _dict['tunnels'] = [x.to_dict() for x in self.tunnels] + tunnels_list = [] + for v in self.tunnels: + if isinstance(v, dict): + tunnels_list.append(v) + else: + tunnels_list.append(v.to_dict()) + _dict['tunnels'] = tunnels_list return _dict def _to_dict(self): @@ -92281,7 +95701,8 @@ class VPNGatewayPolicyMode(VPNGateway): :attr str href: The VPN gateway's canonical URL. :attr str id: The unique identifier for this VPN gateway. :attr List[VPNGatewayMember] members: Collection of VPN gateway members. - :attr str name: The user-defined name for this VPN gateway. + :attr str name: The name for this VPN gateway. The name is unique across all VPN + gateways in the VPC. :attr ResourceGroupReference resource_group: The resource group for this VPN gateway. :attr str resource_type: The resource type. @@ -92316,7 +95737,8 @@ def __init__(self, :param str href: The VPN gateway's canonical URL. :param str id: The unique identifier for this VPN gateway. :param List[VPNGatewayMember] members: Collection of VPN gateway members. - :param str name: The user-defined name for this VPN gateway. + :param str name: The name for this VPN gateway. The name is unique across + all VPN gateways in the VPC. :param ResourceGroupReference resource_group: The resource group for this VPN gateway. :param str resource_type: The resource type. @@ -92345,7 +95767,7 @@ def from_dict(cls, _dict: Dict) -> 'VPNGatewayPolicyMode': """Initialize a VPNGatewayPolicyMode object from a json dictionary.""" args = {} if 'connections' in _dict: - args['connections'] = [VPNGatewayConnectionReference.from_dict(x) for x in _dict.get('connections')] + args['connections'] = [VPNGatewayConnectionReference.from_dict(v) for v in _dict.get('connections')] else: raise ValueError('Required property \'connections\' not present in VPNGatewayPolicyMode JSON') if 'created_at' in _dict: @@ -92365,7 +95787,7 @@ def from_dict(cls, _dict: Dict) -> 'VPNGatewayPolicyMode': else: raise ValueError('Required property \'id\' not present in VPNGatewayPolicyMode JSON') if 'members' in _dict: - args['members'] = [VPNGatewayMember.from_dict(x) for x in _dict.get('members')] + args['members'] = [VPNGatewayMember.from_dict(v) for v in _dict.get('members')] else: raise ValueError('Required property \'members\' not present in VPNGatewayPolicyMode JSON') if 'name' in _dict: @@ -92407,7 +95829,13 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'connections') and self.connections is not None: - _dict['connections'] = [x.to_dict() for x in self.connections] + connections_list = [] + for v in self.connections: + if isinstance(v, dict): + connections_list.append(v) + else: + connections_list.append(v.to_dict()) + _dict['connections'] = connections_list 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: @@ -92417,19 +95845,34 @@ def to_dict(self) -> Dict: if hasattr(self, 'id') and self.id is not None: _dict['id'] = self.id if hasattr(self, 'members') and self.members is not None: - _dict['members'] = [x.to_dict() for x in self.members] + members_list = [] + for v in self.members: + if isinstance(v, dict): + members_list.append(v) + else: + members_list.append(v.to_dict()) + _dict['members'] = members_list if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'resource_group') and self.resource_group is not None: - _dict['resource_group'] = self.resource_group.to_dict() + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() if hasattr(self, 'resource_type') and self.resource_type is not None: _dict['resource_type'] = self.resource_type if hasattr(self, '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 isinstance(self.subnet, dict): + _dict['subnet'] = self.subnet + else: + _dict['subnet'] = self.subnet.to_dict() if hasattr(self, 'vpc') and self.vpc is not None: - _dict['vpc'] = self.vpc.to_dict() + if isinstance(self.vpc, dict): + _dict['vpc'] = self.vpc + else: + _dict['vpc'] = self.vpc.to_dict() if hasattr(self, 'mode') and self.mode is not None: _dict['mode'] = self.mode return _dict @@ -92480,7 +95923,9 @@ class VPNGatewayPrototypeVPNGatewayPolicyModePrototype(VPNGatewayPrototype): """ VPNGatewayPrototypeVPNGatewayPolicyModePrototype. - :attr str name: (optional) The user-defined name for this VPN gateway. + :attr str name: (optional) The name for this VPN gateway. The name must not be + used by another VPN gateway in the VPC. If unspecified, the name will be a + hyphenated list of randomly-selected words. :attr ResourceGroupIdentity resource_group: (optional) :attr SubnetIdentity subnet: :attr str mode: (optional) Policy mode VPN gateway. @@ -92496,7 +95941,9 @@ def __init__(self, Initialize a VPNGatewayPrototypeVPNGatewayPolicyModePrototype object. :param SubnetIdentity subnet: - :param str name: (optional) The user-defined name for this VPN gateway. + :param str name: (optional) The name for this VPN gateway. The name must + not be used by another VPN gateway in the VPC. If unspecified, the name + will be a hyphenated list of randomly-selected words. :param ResourceGroupIdentity resource_group: (optional) :param str mode: (optional) Policy mode VPN gateway. """ @@ -92575,7 +96022,9 @@ class VPNGatewayPrototypeVPNGatewayRouteModePrototype(VPNGatewayPrototype): """ VPNGatewayPrototypeVPNGatewayRouteModePrototype. - :attr str name: (optional) The user-defined name for this VPN gateway. + :attr str name: (optional) The name for this VPN gateway. The name must not be + used by another VPN gateway in the VPC. If unspecified, the name will be a + hyphenated list of randomly-selected words. :attr ResourceGroupIdentity resource_group: (optional) :attr SubnetIdentity subnet: :attr str mode: (optional) Route mode VPN gateway. @@ -92591,7 +96040,9 @@ def __init__(self, Initialize a VPNGatewayPrototypeVPNGatewayRouteModePrototype object. :param SubnetIdentity subnet: - :param str name: (optional) The user-defined name for this VPN gateway. + :param str name: (optional) The name for this VPN gateway. The name must + not be used by another VPN gateway in the VPC. If unspecified, the name + will be a hyphenated list of randomly-selected words. :param ResourceGroupIdentity resource_group: (optional) :param str mode: (optional) Route mode VPN gateway. """ @@ -92677,7 +96128,8 @@ class VPNGatewayRouteMode(VPNGateway): :attr str href: The VPN gateway's canonical URL. :attr str id: The unique identifier for this VPN gateway. :attr List[VPNGatewayMember] members: Collection of VPN gateway members. - :attr str name: The user-defined name for this VPN gateway. + :attr str name: The name for this VPN gateway. The name is unique across all VPN + gateways in the VPC. :attr ResourceGroupReference resource_group: The resource group for this VPN gateway. :attr str resource_type: The resource type. @@ -92712,7 +96164,8 @@ def __init__(self, :param str href: The VPN gateway's canonical URL. :param str id: The unique identifier for this VPN gateway. :param List[VPNGatewayMember] members: Collection of VPN gateway members. - :param str name: The user-defined name for this VPN gateway. + :param str name: The name for this VPN gateway. The name is unique across + all VPN gateways in the VPC. :param ResourceGroupReference resource_group: The resource group for this VPN gateway. :param str resource_type: The resource type. @@ -92741,7 +96194,7 @@ def from_dict(cls, _dict: Dict) -> 'VPNGatewayRouteMode': """Initialize a VPNGatewayRouteMode object from a json dictionary.""" args = {} if 'connections' in _dict: - args['connections'] = [VPNGatewayConnectionReference.from_dict(x) for x in _dict.get('connections')] + args['connections'] = [VPNGatewayConnectionReference.from_dict(v) for v in _dict.get('connections')] else: raise ValueError('Required property \'connections\' not present in VPNGatewayRouteMode JSON') if 'created_at' in _dict: @@ -92761,7 +96214,7 @@ def from_dict(cls, _dict: Dict) -> 'VPNGatewayRouteMode': else: raise ValueError('Required property \'id\' not present in VPNGatewayRouteMode JSON') if 'members' in _dict: - args['members'] = [VPNGatewayMember.from_dict(x) for x in _dict.get('members')] + args['members'] = [VPNGatewayMember.from_dict(v) for v in _dict.get('members')] else: raise ValueError('Required property \'members\' not present in VPNGatewayRouteMode JSON') if 'name' in _dict: @@ -92803,7 +96256,13 @@ def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'connections') and self.connections is not None: - _dict['connections'] = [x.to_dict() for x in self.connections] + connections_list = [] + for v in self.connections: + if isinstance(v, dict): + connections_list.append(v) + else: + connections_list.append(v.to_dict()) + _dict['connections'] = connections_list 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: @@ -92813,19 +96272,34 @@ def to_dict(self) -> Dict: if hasattr(self, 'id') and self.id is not None: _dict['id'] = self.id if hasattr(self, 'members') and self.members is not None: - _dict['members'] = [x.to_dict() for x in self.members] + members_list = [] + for v in self.members: + if isinstance(v, dict): + members_list.append(v) + else: + members_list.append(v.to_dict()) + _dict['members'] = members_list if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'resource_group') and self.resource_group is not None: - _dict['resource_group'] = self.resource_group.to_dict() + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() if hasattr(self, 'resource_type') and self.resource_type is not None: _dict['resource_type'] = self.resource_type if hasattr(self, '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 isinstance(self.subnet, dict): + _dict['subnet'] = self.subnet + else: + _dict['subnet'] = self.subnet.to_dict() if hasattr(self, 'vpc') and self.vpc is not None: - _dict['vpc'] = self.vpc.to_dict() + if isinstance(self.vpc, dict): + _dict['vpc'] = self.vpc + else: + _dict['vpc'] = self.vpc.to_dict() if hasattr(self, 'mode') and self.mode is not None: _dict['mode'] = self.mode return _dict @@ -92929,7 +96403,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'method') and self.method is not None: _dict['method'] = self.method if hasattr(self, 'client_ca') and self.client_ca is not None: - _dict['client_ca'] = self.client_ca.to_dict() + if isinstance(self.client_ca, dict): + _dict['client_ca'] = self.client_ca + else: + _dict['client_ca'] = self.client_ca.to_dict() if hasattr(self, 'crl') and self.crl is not None: _dict['crl'] = self.crl return _dict @@ -93314,7 +96791,9 @@ 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 str name: (optional) The name for this volume. The name must not be used + by another volume in the region. If unspecified, the name will be a hyphenated + list of randomly-selected words. :attr VolumeProfileIdentity profile: The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to use for this volume. @@ -93339,7 +96818,9 @@ def __init__(self, :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 str name: (optional) The name for this volume. The name must not be + used by another volume in the region. If unspecified, the name will be a + hyphenated list of randomly-selected words. :param List[str] user_tags: (optional) The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this volume. @@ -93349,63 +96830,6 @@ def __init__(self, ", ".join(['VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity', 'VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot'])) raise Exception(msg) -class VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentity(VolumeAttachmentVolumePrototypeInstanceContext): - """ - Identifies a volume by a unique property. - - """ - - def __init__(self) -> None: - """ - Initialize a VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentity object. - - """ - # pylint: disable=super-init-not-called - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById', 'VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByCRN', 'VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByHref'])) - raise Exception(msg) - -class VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContext(VolumeAttachmentVolumePrototypeInstanceContext): - """ - VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContext. - - :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](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, - user_tags: List[str] = None) -> None: - """ - Initialize a VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContext object. - - :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( - ", ".join(['VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity', 'VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot'])) - raise Exception(msg) - class VolumeIdentityByCRN(VolumeIdentity): """ VolumeIdentityByCRN. @@ -93697,7 +97121,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 str name: (optional) The name for this volume. The name must not be used + by another volume in the region. If unspecified, the name will be a hyphenated + list of randomly-selected words. :attr VolumeProfileIdentity profile: The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to use for this volume. @@ -93737,7 +97163,9 @@ def __init__(self, :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 str name: (optional) The name for this volume. The name must not be + used by another volume in the region. If unspecified, the name will be a + hyphenated list of randomly-selected words. :param ResourceGroupIdentity resource_group: (optional) :param List[str] user_tags: (optional) The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with @@ -93847,7 +97275,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 str name: (optional) The name for this volume. The name must not be used + by another volume in the region. If unspecified, the name will be a hyphenated + list of randomly-selected words. :attr VolumeProfileIdentity profile: The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to use for this volume. @@ -93890,7 +97320,9 @@ def __init__(self, :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 str name: (optional) The name for this volume. The name must not be + used by another volume in the region. If unspecified, the name will be a + hyphenated list of randomly-selected words. :param ResourceGroupIdentity resource_group: (optional) :param List[str] user_tags: (optional) The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with @@ -95020,9 +98452,9 @@ class InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec(Inst """ InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec. - :attr str name: (optional) The user-defined name for this instance group manager - action. Names must be unique within the instance group manager. If unspecified, - the name will be a hyphenated list of randomly-selected words. + :attr str name: (optional) The name for this instance group manager action. The + name must not be used by another action for the instance group manager. If + unspecified, the name will be a hyphenated list of randomly-selected words. :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. """ @@ -95034,9 +98466,10 @@ def __init__(self, """ Initialize a InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec object. - :param str name: (optional) The user-defined name for this instance group - manager action. Names must be unique within the instance group manager. If - unspecified, the name will be a hyphenated list of randomly-selected words. + :param str name: (optional) The name for this instance group manager + action. The name must not be used by another action for the instance group + manager. If unspecified, the name will be a hyphenated list of + randomly-selected words. :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 min period. @@ -95050,9 +98483,9 @@ class InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt(Instanc """ InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt. - :attr str name: (optional) The user-defined name for this instance group manager - action. Names must be unique within the instance group manager. If unspecified, - the name will be a hyphenated list of randomly-selected words. + :attr str name: (optional) The name for this instance group manager action. The + name must not be used by another action for the instance group manager. If + unspecified, the name will be a hyphenated list of randomly-selected words. :attr datetime run_at: (optional) The date and time the scheduled action will run. """ @@ -95064,9 +98497,10 @@ def __init__(self, """ Initialize a InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt object. - :param str name: (optional) The user-defined name for this instance group - manager action. Names must be unique within the instance group manager. If - unspecified, the name will be a hyphenated list of randomly-selected words. + :param str name: (optional) The name for this instance group manager + action. The name must not be used by another action for the instance group + manager. If unspecified, the name will be a hyphenated list of + randomly-selected words. :param datetime run_at: (optional) The date and time the scheduled action will run. """ @@ -95091,7 +98525,8 @@ class InstanceGroupManagerActionScheduledActionGroupTarget(InstanceGroupManagerA action was created. :attr str href: The URL for this instance group manager action. :attr str id: The unique identifier for this instance group manager action. - :attr str name: The user-defined name for this instance group manager action. + :attr str name: The name for this instance group manager action. The name is + unique across all actions for the instance group manager. :attr str resource_type: The resource type. :attr str status: The status of the instance group action - `active`: Action is ready to be run @@ -95143,8 +98578,8 @@ def __init__(self, :param str href: The URL for this instance group manager action. :param str id: The unique identifier for this instance group manager action. - :param str name: The user-defined name for this instance group manager - action. + :param str name: The name for this instance group manager action. The name + is unique across all actions for the instance group manager. :param str resource_type: The resource type. :param str status: The status of the instance group action - `active`: Action is ready to be run @@ -95274,7 +98709,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'next_run_at') and self.next_run_at is not None: _dict['next_run_at'] = datetime_to_string(self.next_run_at) if hasattr(self, 'group') and self.group is not None: - _dict['group'] = self.group.to_dict() + if isinstance(self.group, dict): + _dict['group'] = self.group + else: + _dict['group'] = self.group.to_dict() return _dict def _to_dict(self): @@ -95341,7 +98779,8 @@ class InstanceGroupManagerActionScheduledActionManagerTarget(InstanceGroupManage action was created. :attr str href: The URL for this instance group manager action. :attr str id: The unique identifier for this instance group manager action. - :attr str name: The user-defined name for this instance group manager action. + :attr str name: The name for this instance group manager action. The name is + unique across all actions for the instance group manager. :attr str resource_type: The resource type. :attr str status: The status of the instance group action - `active`: Action is ready to be run @@ -95393,8 +98832,8 @@ def __init__(self, :param str href: The URL for this instance group manager action. :param str id: The unique identifier for this instance group manager action. - :param str name: The user-defined name for this instance group manager - action. + :param str name: The name for this instance group manager action. The name + is unique across all actions for the instance group manager. :param str resource_type: The resource type. :param str status: The status of the instance group action - `active`: Action is ready to be run @@ -98134,7 +101573,9 @@ 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 str name: (optional) The name for this volume. The name must not be used + by another volume in the region. If unspecified, the name will be a hyphenated + list of randomly-selected words. :attr VolumeProfileIdentity profile: The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to use for this volume. @@ -98169,7 +101610,9 @@ def __init__(self, :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 str name: (optional) The name for this volume. The name must not be + used by another volume in the region. If unspecified, the name will be a + hyphenated list of randomly-selected words. :param List[str] user_tags: (optional) The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this volume. @@ -98260,7 +101703,9 @@ 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 str name: (optional) The name for this volume. The name must not be used + by another volume in the region. If unspecified, the name will be a hyphenated + list of randomly-selected words. :attr VolumeProfileIdentity profile: The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to use for this volume. @@ -98298,7 +101743,9 @@ def __init__(self, :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 str name: (optional) The name for this volume. The name must not be + used by another volume in the region. If unspecified, the name will be a + hyphenated list of randomly-selected words. :param List[str] user_tags: (optional) The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this volume. @@ -98396,452 +101843,13 @@ def __ne__(self, other: 'VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceC """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByCRN(VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentity): - """ - VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByCRN. - - :attr str crn: The CRN for this volume. - """ - - def __init__(self, - crn: str) -> None: - """ - Initialize a VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByCRN object. - - :param str crn: The CRN for this volume. - """ - # pylint: disable=super-init-not-called - self.crn = crn - - @classmethod - def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByCRN': - """Initialize a VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByCRN object from a json dictionary.""" - args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') - else: - raise ValueError('Required property \'crn\' not present in VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByCRN JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByCRN object from 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 VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByCRN object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByCRN') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - - def __ne__(self, other: 'VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByCRN') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - -class VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByHref(VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentity): - """ - VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByHref. - - :attr str href: The URL for this volume. - """ - - def __init__(self, - href: str) -> None: - """ - Initialize a VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByHref object. - - :param str href: The URL for this volume. - """ - # pylint: disable=super-init-not-called - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByHref': - """Initialize a VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByHref object from a json dictionary.""" - args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByHref JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByHref object from a json dictionary.""" - return cls.from_dict(_dict) - - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - return _dict - - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() - - def __str__(self) -> str: - """Return a `str` version of this VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByHref object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByHref') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - - def __ne__(self, other: 'VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByHref') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - -class VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById(VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentity): - """ - VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById. - - :attr str id: The unique identifier for this volume. - """ - - def __init__(self, - id: str) -> None: - """ - Initialize a VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById object. - - :param str id: The unique identifier for this volume. - """ - # pylint: disable=super-init-not-called - self.id = id - - @classmethod - def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById': - """Initialize a VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById object from a json dictionary.""" - args = {} - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById object from a json dictionary.""" - return cls.from_dict(_dict) - - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - return _dict - - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() - - def __str__(self) -> str: - """Return a `str` version of this VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - - def __ne__(self, other: 'VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - -class VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity(VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContext): - """ - VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity. - - :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](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. - :attr 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 `provider_managed`. - """ - - def __init__(self, - profile: 'VolumeProfileIdentity', - capacity: int, - *, - 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](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. - :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 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 - `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 - - @classmethod - def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity': - """Initialize a VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity object from a json dictionary.""" - args = {} - if 'iops' in _dict: - args['iops'] = _dict.get('iops') - if 'name' in _dict: - args['name'] = _dict.get('name') - if 'profile' in _dict: - args['profile'] = _dict.get('profile') - else: - raise ValueError('Required property \'profile\' not present in VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity JSON') - if 'user_tags' in _dict: - args['user_tags'] = _dict.get('user_tags') - if 'capacity' in _dict: - args['capacity'] = _dict.get('capacity') - else: - raise ValueError('Required property \'capacity\' not present in VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity JSON') - if 'encryption_key' in _dict: - args['encryption_key'] = _dict.get('encryption_key') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity object from a json dictionary.""" - return cls.from_dict(_dict) - - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'iops') and self.iops is not None: - _dict['iops'] = self.iops - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'profile') and self.profile is not None: - if isinstance(self.profile, dict): - _dict['profile'] = self.profile - else: - _dict['profile'] = self.profile.to_dict() - if hasattr(self, '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: - if isinstance(self.encryption_key, dict): - _dict['encryption_key'] = self.encryption_key - else: - _dict['encryption_key'] = self.encryption_key.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 VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - - def __ne__(self, other: 'VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - -class VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot(VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContext): - """ - VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot. - - :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](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 `encryption` type for the volume will be `provider_managed`. - :attr SnapshotIdentity source_snapshot: The snapshot from which to clone the - volume. - """ - - def __init__(self, - profile: 'VolumeProfileIdentity', - source_snapshot: 'SnapshotIdentity', - *, - 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](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. - If unspecified, the capacity will be the source snapshot's - `minimum_capacity`. - :param EncryptionKeyIdentity encryption_key: (optional) The root key to use - to wrap the data encryption key for the volume. - If unspecified, the `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 - - @classmethod - def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot': - """Initialize a VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot object from a json dictionary.""" - args = {} - if 'iops' in _dict: - args['iops'] = _dict.get('iops') - if 'name' in _dict: - args['name'] = _dict.get('name') - if 'profile' in _dict: - args['profile'] = _dict.get('profile') - else: - raise ValueError('Required property \'profile\' not present in 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: - args['encryption_key'] = _dict.get('encryption_key') - if 'source_snapshot' in _dict: - args['source_snapshot'] = _dict.get('source_snapshot') - else: - raise ValueError('Required property \'source_snapshot\' not present in VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot object from a json dictionary.""" - return cls.from_dict(_dict) - - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'iops') and self.iops is not None: - _dict['iops'] = self.iops - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'profile') and self.profile is not None: - if isinstance(self.profile, dict): - _dict['profile'] = self.profile - else: - _dict['profile'] = self.profile.to_dict() - if hasattr(self, '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: - if isinstance(self.encryption_key, dict): - _dict['encryption_key'] = self.encryption_key - else: - _dict['encryption_key'] = self.encryption_key.to_dict() - if hasattr(self, 'source_snapshot') and self.source_snapshot is not None: - if isinstance(self.source_snapshot, dict): - _dict['source_snapshot'] = self.source_snapshot - else: - _dict['source_snapshot'] = self.source_snapshot.to_dict() - return _dict - - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() - - def __str__(self) -> str: - """Return a `str` version of this VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - - def __ne__(self, other: 'VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - class InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup(InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec): """ InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup. - :attr str name: (optional) The user-defined name for this instance group manager - action. Names must be unique within the instance group manager. If unspecified, - the name will be a hyphenated list of randomly-selected words. + :attr str name: (optional) The name for this instance group manager action. The + name must not be used by another action for the instance group manager. If + unspecified, the name will be a hyphenated list of randomly-selected words. :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. :attr InstanceGroupManagerScheduledActionGroupPrototype group: @@ -98856,9 +101864,10 @@ def __init__(self, Initialize a InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup object. :param InstanceGroupManagerScheduledActionGroupPrototype group: - :param str name: (optional) The user-defined name for this instance group - manager action. Names must be unique within the instance group manager. If - unspecified, the name will be a hyphenated list of randomly-selected words. + :param str name: (optional) The name for this instance group manager + action. The name must not be used by another action for the instance group + manager. If unspecified, the name will be a hyphenated list of + randomly-selected words. :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 min period. @@ -98895,7 +101904,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'cron_spec') and self.cron_spec is not None: _dict['cron_spec'] = self.cron_spec if hasattr(self, 'group') and self.group is not None: - _dict['group'] = self.group.to_dict() + if isinstance(self.group, dict): + _dict['group'] = self.group + else: + _dict['group'] = self.group.to_dict() return _dict def _to_dict(self): @@ -98920,9 +101932,9 @@ class InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByMan """ InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager. - :attr str name: (optional) The user-defined name for this instance group manager - action. Names must be unique within the instance group manager. If unspecified, - the name will be a hyphenated list of randomly-selected words. + :attr str name: (optional) The name for this instance group manager action. The + name must not be used by another action for the instance group manager. If + unspecified, the name will be a hyphenated list of randomly-selected words. :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. :attr InstanceGroupManagerScheduledActionManagerPrototype manager: @@ -98937,9 +101949,10 @@ def __init__(self, Initialize a InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager object. :param InstanceGroupManagerScheduledActionManagerPrototype manager: - :param str name: (optional) The user-defined name for this instance group - manager action. Names must be unique within the instance group manager. If - unspecified, the name will be a hyphenated list of randomly-selected words. + :param str name: (optional) The name for this instance group manager + action. The name must not be used by another action for the instance group + manager. If unspecified, the name will be a hyphenated list of + randomly-selected words. :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 min period. @@ -99004,9 +102017,9 @@ class InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup( """ InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup. - :attr str name: (optional) The user-defined name for this instance group manager - action. Names must be unique within the instance group manager. If unspecified, - the name will be a hyphenated list of randomly-selected words. + :attr str name: (optional) The name for this instance group manager action. The + name must not be used by another action for the instance group manager. If + unspecified, the name will be a hyphenated list of randomly-selected words. :attr datetime run_at: (optional) The date and time the scheduled action will run. :attr InstanceGroupManagerScheduledActionGroupPrototype group: @@ -99021,9 +102034,10 @@ def __init__(self, Initialize a InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup object. :param InstanceGroupManagerScheduledActionGroupPrototype group: - :param str name: (optional) The user-defined name for this instance group - manager action. Names must be unique within the instance group manager. If - unspecified, the name will be a hyphenated list of randomly-selected words. + :param str name: (optional) The name for this instance group manager + action. The name must not be used by another action for the instance group + manager. If unspecified, the name will be a hyphenated list of + randomly-selected words. :param datetime run_at: (optional) The date and time the scheduled action will run. """ @@ -99059,7 +102073,10 @@ def to_dict(self) -> Dict: if hasattr(self, 'run_at') and self.run_at is not None: _dict['run_at'] = datetime_to_string(self.run_at) if hasattr(self, 'group') and self.group is not None: - _dict['group'] = self.group.to_dict() + if isinstance(self.group, dict): + _dict['group'] = self.group + else: + _dict['group'] = self.group.to_dict() return _dict def _to_dict(self): @@ -99084,9 +102101,9 @@ class InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManage """ InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager. - :attr str name: (optional) The user-defined name for this instance group manager - action. Names must be unique within the instance group manager. If unspecified, - the name will be a hyphenated list of randomly-selected words. + :attr str name: (optional) The name for this instance group manager action. The + name must not be used by another action for the instance group manager. If + unspecified, the name will be a hyphenated list of randomly-selected words. :attr datetime run_at: (optional) The date and time the scheduled action will run. :attr InstanceGroupManagerScheduledActionManagerPrototype manager: @@ -99101,9 +102118,10 @@ def __init__(self, Initialize a InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager object. :param InstanceGroupManagerScheduledActionManagerPrototype manager: - :param str name: (optional) The user-defined name for this instance group - manager action. Names must be unique within the instance group manager. If - unspecified, the name will be a hyphenated list of randomly-selected words. + :param str name: (optional) The name for this instance group manager + action. The name must not be used by another action for the instance group + manager. If unspecified, the name will be a hyphenated list of + randomly-selected words. :param datetime run_at: (optional) The date and time the scheduled action will run. """ @@ -100690,6 +103708,105 @@ def get_all(self) -> List[dict]: results.extend(next_page) return results +class BackupPolicyJobsPager(): + """ + BackupPolicyJobsPager can be used to simplify the use of the "list_backup_policy_jobs" method. + """ + + def __init__(self, + *, + client: VpcV1, + backup_policy_id: str, + status: str = None, + backup_policy_plan_id: str = None, + limit: int = None, + sort: str = None, + source_id: str = None, + target_snapshots_id: str = None, + target_snapshots_crn: str = None, + ) -> None: + """ + Initialize a BackupPolicyJobsPager object. + :param str backup_policy_id: The backup policy identifier. + :param str status: (optional) Filters the collection to backup policy jobs + with the specified status. + :param str backup_policy_plan_id: (optional) Filters the collection to + backup policy jobs with the backup plan with the specified 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. + :param str source_id: (optional) Filters the collection to backup policy + jobs with a source with the specified identifier. + :param str target_snapshots_id: (optional) Filters the collection to + resources with the target snapshot with the specified identifier. + :param str target_snapshots_crn: (optional) Filters the collection to + backup policy jobs with the target snapshot with the specified CRN. + """ + self._has_next = True + self._client = client + self._page_context = { 'next': None } + self._backup_policy_id = backup_policy_id + self._status = status + self._backup_policy_plan_id = backup_policy_plan_id + self._limit = limit + self._sort = sort + self._source_id = source_id + self._target_snapshots_id = target_snapshots_id + self._target_snapshots_crn = target_snapshots_crn + + 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 BackupPolicyJob. + :rtype: List[dict] + """ + if not self.has_next(): + raise StopIteration(message='No more results available') + + result = self._client.list_backup_policy_jobs( + backup_policy_id=self._backup_policy_id, + status=self._status, + backup_policy_plan_id=self._backup_policy_plan_id, + limit=self._limit, + sort=self._sort, + source_id=self._source_id, + target_snapshots_id=self._target_snapshots_id, + target_snapshots_crn=self._target_snapshots_crn, + 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('jobs') + + 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 BackupPolicyJob. + :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. diff --git a/test/integration/test_gen2.py b/test/integration/test_gen2.py index ce65e32..e156003 100644 --- a/test/integration/test_gen2.py +++ b/test/integration/test_gen2.py @@ -1032,7 +1032,6 @@ def test_get_vpn_server_client_configuration(self, createGen2Service): def test_list_vpn_server_clients(self, createGen2Service): clients = list_vpn_server_clients(createGen2Service, store['created_vpn_server']) - print(clients) store['vpnserverclientId']=clients.get_result()['clients'][0]['id'] assertListResponse(clients, 'clients') @@ -1511,6 +1510,23 @@ def test_update_backup_policy_plan(self, createGen2Service): ) assertGetPatchResponse(bckPolicyPlan) + def test_list_backup_policy_jobs(self, createGen2Service): + + bckPolicyJjobs = list_backup_policy_jobs( + createGen2Service, + store['created_backup_policy'] + ) + assertListResponse(bckPolicyJjobs, 'jobs') + store['created_backup_policy_job'] = bckPolicyJjobs.get_result()['jobs'][0]['id'] + + def test_get_backup_policy_job(self, createGen2Service): + bckPolicyjob = get_backup_policy_job( + createGen2Service, + store['created_backup_policy'], + store['created_backup_policy_job'] + ) + assertGetPatchResponse(bckPolicyjob) + def test_get_backup_policy(self, createGen2Service): bckPolicy = get_backup_policy( createGen2Service, @@ -2023,6 +2039,14 @@ def create_backup_policy(service, name): ) return response +def list_backup_policy_jobs(service, backup_policy_id): + response = service.list_backup_policy_jobs(backup_policy_id) + return response + +def get_backup_policy_job(service, backup_policy_id, job_id): + response = service.get_backup_policy_job(backup_policy_id, job_id) + return response + def list_backup_policy_plans(service, backup_policy_id, name): response = service.list_backup_policy_plans( backup_policy_id=backup_policy_id, @@ -4319,9 +4343,9 @@ def create_ike_policy(service): # resource_group_identity_model = {} # resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' - authentication_algorithm = 'md5' - dh_group = 5 - encryption_algorithm = 'triple_des' + authentication_algorithm = 'sha256' + dh_group = 14 + encryption_algorithm = 'aes128' ike_version = 1 key_lifetime = 28800 name = generate_name('ike') @@ -4365,7 +4389,7 @@ def update_ike_policy(service, id): ike_policy_patch_model = {} ike_policy_patch_model['name'] = generate_name('ike') - ike_policy_patch_model['authentication_algorithm'] = 'md5' + ike_policy_patch_model['authentication_algorithm'] = 'sha384' ike_policy_patch = ike_policy_patch_model @@ -4402,8 +4426,8 @@ def create_ipsec_policy(service): # resource_group_identity_model = {} # resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' - authentication_algorithm = 'md5' - encryption_algorithm = 'triple_des' + authentication_algorithm = 'sha384' + encryption_algorithm = 'aes192' pfs = 'disabled' key_lifetime = 3600 name = generate_name('ipsec') @@ -4449,7 +4473,7 @@ def update_ipsec_policy(service, id): i_psec_policy_patch_model = {} i_psec_policy_patch_model['name'] = generate_name('ipsec') - i_psec_policy_patch_model['authentication_algorithm'] = 'md5' + i_psec_policy_patch_model['authentication_algorithm'] = 'sha256' i_psec_policy_patch = i_psec_policy_patch_model @@ -4717,7 +4741,7 @@ def create_volume(service, zone): # volume_prototype_model['resource_group'] = resource_group_identity_model volume_prototype_model['zone'] = zone_identity_model volume_prototype_model['capacity'] = 100 - + volume_prototype_model['user_tags'] = ['my-daily-backup-policy'] volume_prototype = volume_prototype_model response = service.create_volume(volume_prototype) return response diff --git a/test/unit/test_vpc_v1.py b/test/unit/test_vpc_v1.py index ac2ac47..dac59fa 100644 --- a/test/unit/test_vpc_v1.py +++ b/test/unit/test_vpc_v1.py @@ -896,7 +896,7 @@ def test_list_vpc_address_prefixes_all_params(self): """ # Set up mock url = preprocess_url('/vpcs/testString/address_prefixes') - mock_response = '{"address_prefixes": [{"cidr": "192.168.3.0/24", "created_at": "2019-01-01T12:00:00.000Z", "has_subnets": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/address_prefixes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": false, "name": "my-address-prefix-2", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/a4e28308-8ee7-46ab-8108-9f881f22bdbf/address_prefixes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/a4e28308-8ee7-46ab-8108-9f881f22bdbf/address_prefixes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"address_prefixes": [{"cidr": "192.168.3.0/24", "created_at": "2019-01-01T12:00:00.000Z", "has_subnets": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/address_prefixes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": false, "name": "my-address-prefix-1", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/a4e28308-8ee7-46ab-8108-9f881f22bdbf/address_prefixes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/a4e28308-8ee7-46ab-8108-9f881f22bdbf/address_prefixes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -941,7 +941,7 @@ def test_list_vpc_address_prefixes_required_params(self): """ # Set up mock url = preprocess_url('/vpcs/testString/address_prefixes') - mock_response = '{"address_prefixes": [{"cidr": "192.168.3.0/24", "created_at": "2019-01-01T12:00:00.000Z", "has_subnets": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/address_prefixes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": false, "name": "my-address-prefix-2", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/a4e28308-8ee7-46ab-8108-9f881f22bdbf/address_prefixes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/a4e28308-8ee7-46ab-8108-9f881f22bdbf/address_prefixes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"address_prefixes": [{"cidr": "192.168.3.0/24", "created_at": "2019-01-01T12:00:00.000Z", "has_subnets": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/address_prefixes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": false, "name": "my-address-prefix-1", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/a4e28308-8ee7-46ab-8108-9f881f22bdbf/address_prefixes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/a4e28308-8ee7-46ab-8108-9f881f22bdbf/address_prefixes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -977,7 +977,7 @@ def test_list_vpc_address_prefixes_value_error(self): """ # Set up mock url = preprocess_url('/vpcs/testString/address_prefixes') - mock_response = '{"address_prefixes": [{"cidr": "192.168.3.0/24", "created_at": "2019-01-01T12:00:00.000Z", "has_subnets": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/address_prefixes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": false, "name": "my-address-prefix-2", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/a4e28308-8ee7-46ab-8108-9f881f22bdbf/address_prefixes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/a4e28308-8ee7-46ab-8108-9f881f22bdbf/address_prefixes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"address_prefixes": [{"cidr": "192.168.3.0/24", "created_at": "2019-01-01T12:00:00.000Z", "has_subnets": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/address_prefixes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": false, "name": "my-address-prefix-1", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/a4e28308-8ee7-46ab-8108-9f881f22bdbf/address_prefixes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/a4e28308-8ee7-46ab-8108-9f881f22bdbf/address_prefixes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -1012,8 +1012,8 @@ def test_list_vpc_address_prefixes_with_pager_get_next(self): """ # 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}' + 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-1","zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' + mock_response2 = '{"address_prefixes":[{"cidr":"192.168.3.0/24","created_at":"2019-01-01T12:00:00.000Z","has_subnets":false,"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/address_prefixes/1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","is_default":false,"name":"my-address-prefix-1","zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' responses.add(responses.GET, url, body=mock_response1, @@ -1045,8 +1045,8 @@ def test_list_vpc_address_prefixes_with_pager_get_all(self): """ # 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}' + 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-1","zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' + mock_response2 = '{"address_prefixes":[{"cidr":"192.168.3.0/24","created_at":"2019-01-01T12:00:00.000Z","has_subnets":false,"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/address_prefixes/1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","is_default":false,"name":"my-address-prefix-1","zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' responses.add(responses.GET, url, body=mock_response1, @@ -1080,7 +1080,7 @@ def test_create_vpc_address_prefix_all_params(self): """ # Set up mock url = preprocess_url('/vpcs/testString/address_prefixes') - mock_response = '{"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"}}' + mock_response = '{"cidr": "192.168.3.0/24", "created_at": "2019-01-01T12:00:00.000Z", "has_subnets": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/address_prefixes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": false, "name": "my-address-prefix-1", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.POST, url, body=mock_response, @@ -1096,7 +1096,7 @@ def test_create_vpc_address_prefix_all_params(self): cidr = '10.0.0.0/24' zone = zone_identity_model is_default = True - name = 'my-address-prefix-2' + name = 'my-address-prefix-1' # Invoke method response = _service.create_vpc_address_prefix( @@ -1116,7 +1116,7 @@ def test_create_vpc_address_prefix_all_params(self): assert req_body['cidr'] == '10.0.0.0/24' assert req_body['zone'] == zone_identity_model assert req_body['is_default'] == True - assert req_body['name'] == 'my-address-prefix-2' + assert req_body['name'] == 'my-address-prefix-1' def test_create_vpc_address_prefix_all_params_with_retries(self): # Enable retries and run test_create_vpc_address_prefix_all_params. @@ -1134,7 +1134,7 @@ def test_create_vpc_address_prefix_value_error(self): """ # Set up mock url = preprocess_url('/vpcs/testString/address_prefixes') - mock_response = '{"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"}}' + mock_response = '{"cidr": "192.168.3.0/24", "created_at": "2019-01-01T12:00:00.000Z", "has_subnets": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/address_prefixes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": false, "name": "my-address-prefix-1", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.POST, url, body=mock_response, @@ -1150,7 +1150,7 @@ def test_create_vpc_address_prefix_value_error(self): cidr = '10.0.0.0/24' zone = zone_identity_model is_default = True - name = 'my-address-prefix-2' + name = 'my-address-prefix-1' # Pass in all but one required param and check for a ValueError req_param_dict = { @@ -1258,7 +1258,7 @@ def test_get_vpc_address_prefix_all_params(self): """ # Set up mock url = preprocess_url('/vpcs/testString/address_prefixes/testString') - mock_response = '{"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"}}' + mock_response = '{"cidr": "192.168.3.0/24", "created_at": "2019-01-01T12:00:00.000Z", "has_subnets": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/address_prefixes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": false, "name": "my-address-prefix-1", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.GET, url, body=mock_response, @@ -1296,7 +1296,7 @@ def test_get_vpc_address_prefix_value_error(self): """ # Set up mock url = preprocess_url('/vpcs/testString/address_prefixes/testString') - mock_response = '{"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"}}' + mock_response = '{"cidr": "192.168.3.0/24", "created_at": "2019-01-01T12:00:00.000Z", "has_subnets": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/address_prefixes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": false, "name": "my-address-prefix-1", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.GET, url, body=mock_response, @@ -1338,7 +1338,7 @@ def test_update_vpc_address_prefix_all_params(self): """ # Set up mock url = preprocess_url('/vpcs/testString/address_prefixes/testString') - mock_response = '{"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"}}' + mock_response = '{"cidr": "192.168.3.0/24", "created_at": "2019-01-01T12:00:00.000Z", "has_subnets": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/address_prefixes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": false, "name": "my-address-prefix-1", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.PATCH, url, body=mock_response, @@ -1348,7 +1348,7 @@ def test_update_vpc_address_prefix_all_params(self): # Construct a dict representation of a AddressPrefixPatch model address_prefix_patch_model = {} address_prefix_patch_model['is_default'] = False - address_prefix_patch_model['name'] = 'my-address-prefix-2' + address_prefix_patch_model['name'] = 'my-address-prefix-1' # Set up parameter values vpc_id = 'testString' @@ -1386,7 +1386,7 @@ def test_update_vpc_address_prefix_value_error(self): """ # Set up mock url = preprocess_url('/vpcs/testString/address_prefixes/testString') - mock_response = '{"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"}}' + mock_response = '{"cidr": "192.168.3.0/24", "created_at": "2019-01-01T12:00:00.000Z", "has_subnets": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/address_prefixes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": false, "name": "my-address-prefix-1", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.PATCH, url, body=mock_response, @@ -1396,7 +1396,7 @@ def test_update_vpc_address_prefix_value_error(self): # Construct a dict representation of a AddressPrefixPatch model address_prefix_patch_model = {} address_prefix_patch_model['is_default'] = False - address_prefix_patch_model['name'] = 'my-address-prefix-2' + address_prefix_patch_model['name'] = 'my-address-prefix-1' # Set up parameter values vpc_id = 'testString' @@ -6645,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"}, "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}' + 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": false, "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, @@ -6676,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"}, "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}' + 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": false, "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, @@ -6712,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"}, "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"}}' + 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": false, "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, @@ -6774,15 +6774,15 @@ def test_create_instance_template_all_params(self): resource_group_identity_model = {} resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' - # Construct a dict representation of a VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById model - volume_attachment_volume_prototype_instance_context_model = {} - volume_attachment_volume_prototype_instance_context_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5' + # Construct a dict representation of a VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById model + volume_attachment_prototype_volume_model = {} + volume_attachment_prototype_volume_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5' - # Construct a dict representation of a VolumeAttachmentPrototypeInstanceContext model - volume_attachment_prototype_instance_context_model = {} - 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 + # Construct a dict representation of a VolumeAttachmentPrototype model + volume_attachment_prototype_model = {} + volume_attachment_prototype_model['delete_volume_on_instance_delete'] = False + volume_attachment_prototype_model['name'] = 'my-volume-attachment' + volume_attachment_prototype_model['volume'] = volume_attachment_prototype_volume_model # Construct a dict representation of a VPCIdentityById model vpc_identity_model = {} @@ -6832,7 +6832,7 @@ def test_create_instance_template_all_params(self): instance_template_prototype_model['resource_group'] = resource_group_identity_model instance_template_prototype_model['total_volume_bandwidth'] = 500 instance_template_prototype_model['user_data'] = 'testString' - instance_template_prototype_model['volume_attachments'] = [volume_attachment_prototype_instance_context_model] + instance_template_prototype_model['volume_attachments'] = [volume_attachment_prototype_model] instance_template_prototype_model['vpc'] = vpc_identity_model instance_template_prototype_model['boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model instance_template_prototype_model['image'] = image_identity_model @@ -6871,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"}, "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"}}' + 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": false, "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, @@ -6933,15 +6933,15 @@ def test_create_instance_template_value_error(self): resource_group_identity_model = {} resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' - # Construct a dict representation of a VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById model - volume_attachment_volume_prototype_instance_context_model = {} - volume_attachment_volume_prototype_instance_context_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5' + # Construct a dict representation of a VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById model + volume_attachment_prototype_volume_model = {} + volume_attachment_prototype_volume_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5' - # Construct a dict representation of a VolumeAttachmentPrototypeInstanceContext model - volume_attachment_prototype_instance_context_model = {} - 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 + # Construct a dict representation of a VolumeAttachmentPrototype model + volume_attachment_prototype_model = {} + volume_attachment_prototype_model['delete_volume_on_instance_delete'] = False + volume_attachment_prototype_model['name'] = 'my-volume-attachment' + volume_attachment_prototype_model['volume'] = volume_attachment_prototype_volume_model # Construct a dict representation of a VPCIdentityById model vpc_identity_model = {} @@ -6991,7 +6991,7 @@ def test_create_instance_template_value_error(self): instance_template_prototype_model['resource_group'] = resource_group_identity_model instance_template_prototype_model['total_volume_bandwidth'] = 500 instance_template_prototype_model['user_data'] = 'testString' - instance_template_prototype_model['volume_attachments'] = [volume_attachment_prototype_instance_context_model] + instance_template_prototype_model['volume_attachments'] = [volume_attachment_prototype_model] instance_template_prototype_model['vpc'] = vpc_identity_model instance_template_prototype_model['boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model instance_template_prototype_model['image'] = image_identity_model @@ -7101,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"}, "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"}}' + 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": false, "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, @@ -7137,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"}, "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"}}' + 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": false, "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, @@ -7177,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"}, "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"}}' + 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": false, "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, @@ -7222,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"}, "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"}}' + 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": false, "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, @@ -7564,20 +7564,20 @@ def test_create_instance_all_params(self): encryption_key_identity_model = {} encryption_key_identity_model['crn'] = 'crn:[...]' - # Construct a dict representation of a VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity model - volume_attachment_volume_prototype_instance_context_model = {} - 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 - - # Construct a dict representation of a VolumeAttachmentPrototypeInstanceContext model - volume_attachment_prototype_instance_context_model = {} - 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 + # Construct a dict representation of a VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity model + volume_attachment_prototype_volume_model = {} + volume_attachment_prototype_volume_model['iops'] = 10000 + volume_attachment_prototype_volume_model['name'] = 'my-data-volume' + volume_attachment_prototype_volume_model['profile'] = volume_profile_identity_model + volume_attachment_prototype_volume_model['user_tags'] = ['testString'] + volume_attachment_prototype_volume_model['capacity'] = 1000 + volume_attachment_prototype_volume_model['encryption_key'] = encryption_key_identity_model + + # Construct a dict representation of a VolumeAttachmentPrototype model + volume_attachment_prototype_model = {} + volume_attachment_prototype_model['delete_volume_on_instance_delete'] = False + volume_attachment_prototype_model['name'] = 'my-volume-attachment' + volume_attachment_prototype_model['volume'] = volume_attachment_prototype_volume_model # Construct a dict representation of a VPCIdentityById model vpc_identity_model = {} @@ -7619,7 +7619,7 @@ def test_create_instance_all_params(self): instance_prototype_model['resource_group'] = resource_group_identity_model instance_prototype_model['total_volume_bandwidth'] = 500 instance_prototype_model['user_data'] = 'testString' - instance_prototype_model['volume_attachments'] = [volume_attachment_prototype_instance_context_model] + instance_prototype_model['volume_attachments'] = [volume_attachment_prototype_model] instance_prototype_model['vpc'] = vpc_identity_model instance_prototype_model['boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model instance_prototype_model['image'] = image_identity_model @@ -7728,20 +7728,20 @@ def test_create_instance_value_error(self): encryption_key_identity_model = {} encryption_key_identity_model['crn'] = 'crn:[...]' - # Construct a dict representation of a VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity model - volume_attachment_volume_prototype_instance_context_model = {} - 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 - - # Construct a dict representation of a VolumeAttachmentPrototypeInstanceContext model - volume_attachment_prototype_instance_context_model = {} - 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 + # Construct a dict representation of a VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity model + volume_attachment_prototype_volume_model = {} + volume_attachment_prototype_volume_model['iops'] = 10000 + volume_attachment_prototype_volume_model['name'] = 'my-data-volume' + volume_attachment_prototype_volume_model['profile'] = volume_profile_identity_model + volume_attachment_prototype_volume_model['user_tags'] = ['testString'] + volume_attachment_prototype_volume_model['capacity'] = 1000 + volume_attachment_prototype_volume_model['encryption_key'] = encryption_key_identity_model + + # Construct a dict representation of a VolumeAttachmentPrototype model + volume_attachment_prototype_model = {} + volume_attachment_prototype_model['delete_volume_on_instance_delete'] = False + volume_attachment_prototype_model['name'] = 'my-volume-attachment' + volume_attachment_prototype_model['volume'] = volume_attachment_prototype_volume_model # Construct a dict representation of a VPCIdentityById model vpc_identity_model = {} @@ -7783,7 +7783,7 @@ def test_create_instance_value_error(self): instance_prototype_model['resource_group'] = resource_group_identity_model instance_prototype_model['total_volume_bandwidth'] = 500 instance_prototype_model['user_data'] = 'testString' - instance_prototype_model['volume_attachments'] = [volume_attachment_prototype_instance_context_model] + instance_prototype_model['volume_attachments'] = [volume_attachment_prototype_model] instance_prototype_model['vpc'] = vpc_identity_model instance_prototype_model['boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model instance_prototype_model['image'] = image_identity_model @@ -11356,7 +11356,7 @@ def test_list_instance_group_manager_actions_all_params(self): """ # Set up mock url = preprocess_url('/instance_groups/testString/managers/testString/actions') - mock_response = '{"actions": [{"auto_delete": true, "auto_delete_timeout": 24, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-action", "resource_type": "instance_group_manager_action", "status": "active", "updated_at": "2019-01-01T12:00:00.000Z", "action_type": "scheduled", "cron_spec": "*/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}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"actions": [{"auto_delete": true, "auto_delete_timeout": 24, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-action", "resource_type": "instance_group_manager_action", "status": "active", "updated_at": "2019-01-01T12:00:00.000Z", "action_type": "scheduled", "cron_spec": "30 */2 * * 1-5", "last_applied_at": "2019-01-01T12:00:00.000Z", "next_run_at": "2019-01-01T12:00:00.000Z", "group": {"membership_count": 10}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -11403,7 +11403,7 @@ def test_list_instance_group_manager_actions_required_params(self): """ # Set up mock url = preprocess_url('/instance_groups/testString/managers/testString/actions') - mock_response = '{"actions": [{"auto_delete": true, "auto_delete_timeout": 24, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-action", "resource_type": "instance_group_manager_action", "status": "active", "updated_at": "2019-01-01T12:00:00.000Z", "action_type": "scheduled", "cron_spec": "*/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}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"actions": [{"auto_delete": true, "auto_delete_timeout": 24, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-action", "resource_type": "instance_group_manager_action", "status": "active", "updated_at": "2019-01-01T12:00:00.000Z", "action_type": "scheduled", "cron_spec": "30 */2 * * 1-5", "last_applied_at": "2019-01-01T12:00:00.000Z", "next_run_at": "2019-01-01T12:00:00.000Z", "group": {"membership_count": 10}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -11441,7 +11441,7 @@ def test_list_instance_group_manager_actions_value_error(self): """ # Set up mock url = preprocess_url('/instance_groups/testString/managers/testString/actions') - mock_response = '{"actions": [{"auto_delete": true, "auto_delete_timeout": 24, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-action", "resource_type": "instance_group_manager_action", "status": "active", "updated_at": "2019-01-01T12:00:00.000Z", "action_type": "scheduled", "cron_spec": "*/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}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"actions": [{"auto_delete": true, "auto_delete_timeout": 24, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-action", "resource_type": "instance_group_manager_action", "status": "active", "updated_at": "2019-01-01T12:00:00.000Z", "action_type": "scheduled", "cron_spec": "30 */2 * * 1-5", "last_applied_at": "2019-01-01T12:00:00.000Z", "next_run_at": "2019-01-01T12:00:00.000Z", "group": {"membership_count": 10}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -11478,8 +11478,8 @@ def test_list_instance_group_manager_actions_with_pager_get_next(self): """ # 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}}]}' + 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":"30 */2 * * 1-5","last_applied_at":"2019-01-01T12:00:00.000Z","next_run_at":"2019-01-01T12:00:00.000Z","group":{"membership_count":10}}]}' + 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":"30 */2 * * 1-5","last_applied_at":"2019-01-01T12:00:00.000Z","next_run_at":"2019-01-01T12:00:00.000Z","group":{"membership_count":10}}]}' responses.add(responses.GET, url, body=mock_response1, @@ -11512,8 +11512,8 @@ def test_list_instance_group_manager_actions_with_pager_get_all(self): """ # 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}}]}' + 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":"30 */2 * * 1-5","last_applied_at":"2019-01-01T12:00:00.000Z","next_run_at":"2019-01-01T12:00:00.000Z","group":{"membership_count":10}}]}' + 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":"30 */2 * * 1-5","last_applied_at":"2019-01-01T12:00:00.000Z","next_run_at":"2019-01-01T12:00:00.000Z","group":{"membership_count":10}}]}' responses.add(responses.GET, url, body=mock_response1, @@ -11548,7 +11548,7 @@ def test_create_instance_group_manager_action_all_params(self): """ # Set up mock url = preprocess_url('/instance_groups/testString/managers/testString/actions') - mock_response = '{"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_response = '{"auto_delete": true, "auto_delete_timeout": 24, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-action", "resource_type": "instance_group_manager_action", "status": "active", "updated_at": "2019-01-01T12:00:00.000Z", "action_type": "scheduled", "cron_spec": "30 */2 * * 1-5", "last_applied_at": "2019-01-01T12:00:00.000Z", "next_run_at": "2019-01-01T12:00:00.000Z", "group": {"membership_count": 10}}' responses.add(responses.POST, url, body=mock_response, @@ -11601,7 +11601,7 @@ def test_create_instance_group_manager_action_value_error(self): """ # Set up mock url = preprocess_url('/instance_groups/testString/managers/testString/actions') - mock_response = '{"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_response = '{"auto_delete": true, "auto_delete_timeout": 24, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-action", "resource_type": "instance_group_manager_action", "status": "active", "updated_at": "2019-01-01T12:00:00.000Z", "action_type": "scheduled", "cron_spec": "30 */2 * * 1-5", "last_applied_at": "2019-01-01T12:00:00.000Z", "next_run_at": "2019-01-01T12:00:00.000Z", "group": {"membership_count": 10}}' responses.add(responses.POST, url, body=mock_response, @@ -11733,7 +11733,7 @@ def test_get_instance_group_manager_action_all_params(self): """ # Set up mock url = preprocess_url('/instance_groups/testString/managers/testString/actions/testString') - mock_response = '{"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_response = '{"auto_delete": true, "auto_delete_timeout": 24, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-action", "resource_type": "instance_group_manager_action", "status": "active", "updated_at": "2019-01-01T12:00:00.000Z", "action_type": "scheduled", "cron_spec": "30 */2 * * 1-5", "last_applied_at": "2019-01-01T12:00:00.000Z", "next_run_at": "2019-01-01T12:00:00.000Z", "group": {"membership_count": 10}}' responses.add(responses.GET, url, body=mock_response, @@ -11773,7 +11773,7 @@ def test_get_instance_group_manager_action_value_error(self): """ # Set up mock url = preprocess_url('/instance_groups/testString/managers/testString/actions/testString') - mock_response = '{"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_response = '{"auto_delete": true, "auto_delete_timeout": 24, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-action", "resource_type": "instance_group_manager_action", "status": "active", "updated_at": "2019-01-01T12:00:00.000Z", "action_type": "scheduled", "cron_spec": "30 */2 * * 1-5", "last_applied_at": "2019-01-01T12:00:00.000Z", "next_run_at": "2019-01-01T12:00:00.000Z", "group": {"membership_count": 10}}' responses.add(responses.GET, url, body=mock_response, @@ -11817,7 +11817,7 @@ def test_update_instance_group_manager_action_all_params(self): """ # Set up mock url = preprocess_url('/instance_groups/testString/managers/testString/actions/testString') - mock_response = '{"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_response = '{"auto_delete": true, "auto_delete_timeout": 24, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-action", "resource_type": "instance_group_manager_action", "status": "active", "updated_at": "2019-01-01T12:00:00.000Z", "action_type": "scheduled", "cron_spec": "30 */2 * * 1-5", "last_applied_at": "2019-01-01T12:00:00.000Z", "next_run_at": "2019-01-01T12:00:00.000Z", "group": {"membership_count": 10}}' responses.add(responses.PATCH, url, body=mock_response, @@ -11835,7 +11835,7 @@ def test_update_instance_group_manager_action_all_params(self): # Construct a dict representation of a InstanceGroupManagerActionPatch model instance_group_manager_action_patch_model = {} - instance_group_manager_action_patch_model['cron_spec'] = '*/5 1,2,3 * * *' + instance_group_manager_action_patch_model['cron_spec'] = '30 */2 * * 1-5' instance_group_manager_action_patch_model['group'] = instance_group_manager_action_group_patch_model instance_group_manager_action_patch_model['manager'] = instance_group_manager_action_manager_patch_model instance_group_manager_action_patch_model['name'] = 'my-instance-group-manager-action' @@ -11879,7 +11879,7 @@ def test_update_instance_group_manager_action_value_error(self): """ # Set up mock url = preprocess_url('/instance_groups/testString/managers/testString/actions/testString') - mock_response = '{"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_response = '{"auto_delete": true, "auto_delete_timeout": 24, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-action", "resource_type": "instance_group_manager_action", "status": "active", "updated_at": "2019-01-01T12:00:00.000Z", "action_type": "scheduled", "cron_spec": "30 */2 * * 1-5", "last_applied_at": "2019-01-01T12:00:00.000Z", "next_run_at": "2019-01-01T12:00:00.000Z", "group": {"membership_count": 10}}' responses.add(responses.PATCH, url, body=mock_response, @@ -11897,7 +11897,7 @@ def test_update_instance_group_manager_action_value_error(self): # Construct a dict representation of a InstanceGroupManagerActionPatch model instance_group_manager_action_patch_model = {} - instance_group_manager_action_patch_model['cron_spec'] = '*/5 1,2,3 * * *' + instance_group_manager_action_patch_model['cron_spec'] = '30 */2 * * 1-5' instance_group_manager_action_patch_model['group'] = instance_group_manager_action_group_patch_model instance_group_manager_action_patch_model['manager'] = instance_group_manager_action_manager_patch_model instance_group_manager_action_patch_model['name'] = 'my-instance-group-manager-action' @@ -14912,7 +14912,7 @@ def test_create_backup_policy_all_params(self): backup_policy_plan_prototype_model['active'] = True backup_policy_plan_prototype_model['attach_user_tags'] = ['my-daily-backup-plan'] backup_policy_plan_prototype_model['copy_user_tags'] = True - backup_policy_plan_prototype_model['cron_spec'] = '*/5 1,2,3 * * *' + backup_policy_plan_prototype_model['cron_spec'] = '30 */2 * * 1-5' backup_policy_plan_prototype_model['deletion_trigger'] = backup_policy_plan_deletion_trigger_prototype_model backup_policy_plan_prototype_model['name'] = 'my-policy-plan' @@ -15019,6 +15019,300 @@ def test_create_backup_policy_value_error_with_retries(self): _service.disable_retries() self.test_create_backup_policy_value_error() +class TestListBackupPolicyJobs(): + """ + Test Class for list_backup_policy_jobs + """ + + @responses.activate + def test_list_backup_policy_jobs_all_params(self): + """ + list_backup_policy_jobs() + """ + # Set up mock + url = preprocess_url('/backup_policies/testString/jobs') + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/7241e2a8-601f-11ea-8503-000c29475bed/jobs?limit=20"}, "jobs": [{"auto_delete": true, "auto_delete_after": 90, "backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "resource_type": "backup_policy_plan"}, "completed_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/0fe9e5d8-0a4d-4818-96ec-e99708644a58/jobs/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "job_type": "creation", "resource_type": "backup_policy_job", "source": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/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": "failed", "status_reasons": [{"code": "source_volume_busy", "message": "message", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshooting-backup-for-vpc"}], "target_snapshots": [{"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"}]}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/7241e2a8-601f-11ea-8503-000c29475bed/jobss?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + responses.add(responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200) + + # Set up parameter values + backup_policy_id = 'testString' + status = 'testString' + backup_policy_plan_id = 'testString' + start = 'testString' + limit = 1 + sort = 'name' + source_id = 'testString' + target_snapshots_id = 'testString' + target_snapshots_crn = 'testString' + + # Invoke method + response = _service.list_backup_policy_jobs( + backup_policy_id, + status=status, + backup_policy_plan_id=backup_policy_plan_id, + start=start, + limit=limit, + sort=sort, + source_id=source_id, + target_snapshots_id=target_snapshots_id, + target_snapshots_crn=target_snapshots_crn, + headers={} + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + # Validate query params + query_string = responses.calls[0].request.url.split('?',1)[1] + query_string = urllib.parse.unquote_plus(query_string) + assert 'status={}'.format(status) in query_string + assert 'backup_policy_plan.id={}'.format(backup_policy_plan_id) in query_string + assert 'start={}'.format(start) in query_string + assert 'limit={}'.format(limit) in query_string + assert 'sort={}'.format(sort) in query_string + assert 'source.id={}'.format(source_id) in query_string + assert 'target_snapshots[].id={}'.format(target_snapshots_id) in query_string + assert 'target_snapshots[].crn={}'.format(target_snapshots_crn) in query_string + + def test_list_backup_policy_jobs_all_params_with_retries(self): + # Enable retries and run test_list_backup_policy_jobs_all_params. + _service.enable_retries() + self.test_list_backup_policy_jobs_all_params() + + # Disable retries and run test_list_backup_policy_jobs_all_params. + _service.disable_retries() + self.test_list_backup_policy_jobs_all_params() + + @responses.activate + def test_list_backup_policy_jobs_required_params(self): + """ + test_list_backup_policy_jobs_required_params() + """ + # Set up mock + url = preprocess_url('/backup_policies/testString/jobs') + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/7241e2a8-601f-11ea-8503-000c29475bed/jobs?limit=20"}, "jobs": [{"auto_delete": true, "auto_delete_after": 90, "backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "resource_type": "backup_policy_plan"}, "completed_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/0fe9e5d8-0a4d-4818-96ec-e99708644a58/jobs/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "job_type": "creation", "resource_type": "backup_policy_job", "source": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/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": "failed", "status_reasons": [{"code": "source_volume_busy", "message": "message", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshooting-backup-for-vpc"}], "target_snapshots": [{"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"}]}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/7241e2a8-601f-11ea-8503-000c29475bed/jobss?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + responses.add(responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200) + + # Set up parameter values + backup_policy_id = 'testString' + + # Invoke method + response = _service.list_backup_policy_jobs( + backup_policy_id, + headers={} + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + def test_list_backup_policy_jobs_required_params_with_retries(self): + # Enable retries and run test_list_backup_policy_jobs_required_params. + _service.enable_retries() + self.test_list_backup_policy_jobs_required_params() + + # Disable retries and run test_list_backup_policy_jobs_required_params. + _service.disable_retries() + self.test_list_backup_policy_jobs_required_params() + + @responses.activate + def test_list_backup_policy_jobs_value_error(self): + """ + test_list_backup_policy_jobs_value_error() + """ + # Set up mock + url = preprocess_url('/backup_policies/testString/jobs') + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/7241e2a8-601f-11ea-8503-000c29475bed/jobs?limit=20"}, "jobs": [{"auto_delete": true, "auto_delete_after": 90, "backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "resource_type": "backup_policy_plan"}, "completed_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/0fe9e5d8-0a4d-4818-96ec-e99708644a58/jobs/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "job_type": "creation", "resource_type": "backup_policy_job", "source": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/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": "failed", "status_reasons": [{"code": "source_volume_busy", "message": "message", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshooting-backup-for-vpc"}], "target_snapshots": [{"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"}]}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/7241e2a8-601f-11ea-8503-000c29475bed/jobss?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + responses.add(responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200) + + # Set up parameter values + backup_policy_id = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "backup_policy_id": backup_policy_id, + } + for param in req_param_dict.keys(): + req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.list_backup_policy_jobs(**req_copy) + + def test_list_backup_policy_jobs_value_error_with_retries(self): + # Enable retries and run test_list_backup_policy_jobs_value_error. + _service.enable_retries() + self.test_list_backup_policy_jobs_value_error() + + # Disable retries and run test_list_backup_policy_jobs_value_error. + _service.disable_retries() + self.test_list_backup_policy_jobs_value_error() + + @responses.activate + def test_list_backup_policy_jobs_with_pager_get_next(self): + """ + test_list_backup_policy_jobs_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/backup_policies/testString/jobs') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"jobs":[{"auto_delete":true,"auto_delete_after":90,"backup_policy_plan":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","resource_type":"backup_policy_plan"},"completed_at":"2019-01-01T12:00:00.000Z","created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/0fe9e5d8-0a4d-4818-96ec-e99708644a58/jobs/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","job_type":"creation","resource_type":"backup_policy_job","source":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/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":"failed","status_reasons":[{"code":"source_volume_busy","message":"message","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshooting-backup-for-vpc"}],"target_snapshots":[{"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"}]}],"limit":1}' + mock_response2 = '{"total_count":2,"jobs":[{"auto_delete":true,"auto_delete_after":90,"backup_policy_plan":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","resource_type":"backup_policy_plan"},"completed_at":"2019-01-01T12:00:00.000Z","created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/0fe9e5d8-0a4d-4818-96ec-e99708644a58/jobs/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","job_type":"creation","resource_type":"backup_policy_job","source":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/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":"failed","status_reasons":[{"code":"source_volume_busy","message":"message","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshooting-backup-for-vpc"}],"target_snapshots":[{"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"}]}],"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 = BackupPolicyJobsPager( + client=_service, + backup_policy_id='testString', + status='testString', + backup_policy_plan_id='testString', + limit=10, + sort='name', + source_id='testString', + target_snapshots_id='testString', + target_snapshots_crn='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_policy_jobs_with_pager_get_all(self): + """ + test_list_backup_policy_jobs_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/backup_policies/testString/jobs') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"jobs":[{"auto_delete":true,"auto_delete_after":90,"backup_policy_plan":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","resource_type":"backup_policy_plan"},"completed_at":"2019-01-01T12:00:00.000Z","created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/0fe9e5d8-0a4d-4818-96ec-e99708644a58/jobs/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","job_type":"creation","resource_type":"backup_policy_job","source":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/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":"failed","status_reasons":[{"code":"source_volume_busy","message":"message","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshooting-backup-for-vpc"}],"target_snapshots":[{"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"}]}],"limit":1}' + mock_response2 = '{"total_count":2,"jobs":[{"auto_delete":true,"auto_delete_after":90,"backup_policy_plan":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","resource_type":"backup_policy_plan"},"completed_at":"2019-01-01T12:00:00.000Z","created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/0fe9e5d8-0a4d-4818-96ec-e99708644a58/jobs/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","job_type":"creation","resource_type":"backup_policy_job","source":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/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":"failed","status_reasons":[{"code":"source_volume_busy","message":"message","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshooting-backup-for-vpc"}],"target_snapshots":[{"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"}]}],"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 = BackupPolicyJobsPager( + client=_service, + backup_policy_id='testString', + status='testString', + backup_policy_plan_id='testString', + limit=10, + sort='name', + source_id='testString', + target_snapshots_id='testString', + target_snapshots_crn='testString', + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + +class TestGetBackupPolicyJob(): + """ + Test Class for get_backup_policy_job + """ + + @responses.activate + def test_get_backup_policy_job_all_params(self): + """ + get_backup_policy_job() + """ + # Set up mock + url = preprocess_url('/backup_policies/testString/jobs/testString') + mock_response = '{"auto_delete": true, "auto_delete_after": 90, "backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "resource_type": "backup_policy_plan"}, "completed_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/0fe9e5d8-0a4d-4818-96ec-e99708644a58/jobs/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "job_type": "creation", "resource_type": "backup_policy_job", "source": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/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": "failed", "status_reasons": [{"code": "source_volume_busy", "message": "message", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshooting-backup-for-vpc"}], "target_snapshots": [{"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"}]}' + responses.add(responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200) + + # Set up parameter values + backup_policy_id = 'testString' + id = 'testString' + + # Invoke method + response = _service.get_backup_policy_job( + backup_policy_id, + id, + headers={} + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + def test_get_backup_policy_job_all_params_with_retries(self): + # Enable retries and run test_get_backup_policy_job_all_params. + _service.enable_retries() + self.test_get_backup_policy_job_all_params() + + # Disable retries and run test_get_backup_policy_job_all_params. + _service.disable_retries() + self.test_get_backup_policy_job_all_params() + + @responses.activate + def test_get_backup_policy_job_value_error(self): + """ + test_get_backup_policy_job_value_error() + """ + # Set up mock + url = preprocess_url('/backup_policies/testString/jobs/testString') + mock_response = '{"auto_delete": true, "auto_delete_after": 90, "backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "resource_type": "backup_policy_plan"}, "completed_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/0fe9e5d8-0a4d-4818-96ec-e99708644a58/jobs/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "job_type": "creation", "resource_type": "backup_policy_job", "source": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/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": "failed", "status_reasons": [{"code": "source_volume_busy", "message": "message", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshooting-backup-for-vpc"}], "target_snapshots": [{"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"}]}' + responses.add(responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200) + + # Set up parameter values + backup_policy_id = 'testString' + id = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "backup_policy_id": backup_policy_id, + "id": id, + } + for param in req_param_dict.keys(): + req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.get_backup_policy_job(**req_copy) + + def test_get_backup_policy_job_value_error_with_retries(self): + # Enable retries and run test_get_backup_policy_job_value_error. + _service.enable_retries() + self.test_get_backup_policy_job_value_error() + + # Disable retries and run test_get_backup_policy_job_value_error. + _service.disable_retries() + self.test_get_backup_policy_job_value_error() + class TestListBackupPolicyPlans(): """ Test Class for list_backup_policy_plans @@ -15031,7 +15325,7 @@ def test_list_backup_policy_plans_all_params(self): """ # Set up mock url = preprocess_url('/backup_policies/testString/plans') - mock_response = '{"plans": [{"active": true, "attach_user_tags": ["attach_user_tags"], "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "*/5 1,2,3 * * *", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "resource_type": "backup_policy_plan"}]}' + mock_response = '{"plans": [{"active": true, "attach_user_tags": ["attach_user_tags"], "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "30 */2 * * 1-5", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "resource_type": "backup_policy_plan"}]}' responses.add(responses.GET, url, body=mock_response, @@ -15073,7 +15367,7 @@ def test_list_backup_policy_plans_required_params(self): """ # Set up mock url = preprocess_url('/backup_policies/testString/plans') - mock_response = '{"plans": [{"active": true, "attach_user_tags": ["attach_user_tags"], "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "*/5 1,2,3 * * *", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "resource_type": "backup_policy_plan"}]}' + mock_response = '{"plans": [{"active": true, "attach_user_tags": ["attach_user_tags"], "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "30 */2 * * 1-5", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "resource_type": "backup_policy_plan"}]}' responses.add(responses.GET, url, body=mock_response, @@ -15109,7 +15403,7 @@ def test_list_backup_policy_plans_value_error(self): """ # Set up mock url = preprocess_url('/backup_policies/testString/plans') - mock_response = '{"plans": [{"active": true, "attach_user_tags": ["attach_user_tags"], "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "*/5 1,2,3 * * *", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "resource_type": "backup_policy_plan"}]}' + mock_response = '{"plans": [{"active": true, "attach_user_tags": ["attach_user_tags"], "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "30 */2 * * 1-5", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "resource_type": "backup_policy_plan"}]}' responses.add(responses.GET, url, body=mock_response, @@ -15149,7 +15443,7 @@ def test_create_backup_policy_plan_all_params(self): """ # Set up mock url = preprocess_url('/backup_policies/testString/plans') - mock_response = '{"active": true, "attach_user_tags": ["attach_user_tags"], "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "*/5 1,2,3 * * *", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "resource_type": "backup_policy_plan"}' + mock_response = '{"active": true, "attach_user_tags": ["attach_user_tags"], "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "30 */2 * * 1-5", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "resource_type": "backup_policy_plan"}' responses.add(responses.POST, url, body=mock_response, @@ -15163,7 +15457,7 @@ def test_create_backup_policy_plan_all_params(self): # Set up parameter values backup_policy_id = 'testString' - cron_spec = '*/5 1,2,3 * * *' + cron_spec = '30 */2 * * 1-5' active = True attach_user_tags = ['my-daily-backup-plan'] copy_user_tags = True @@ -15187,7 +15481,7 @@ def test_create_backup_policy_plan_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['cron_spec'] == '*/5 1,2,3 * * *' + assert req_body['cron_spec'] == '30 */2 * * 1-5' assert req_body['active'] == True assert req_body['attach_user_tags'] == ['my-daily-backup-plan'] assert req_body['copy_user_tags'] == True @@ -15210,7 +15504,7 @@ def test_create_backup_policy_plan_value_error(self): """ # Set up mock url = preprocess_url('/backup_policies/testString/plans') - mock_response = '{"active": true, "attach_user_tags": ["attach_user_tags"], "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "*/5 1,2,3 * * *", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "resource_type": "backup_policy_plan"}' + mock_response = '{"active": true, "attach_user_tags": ["attach_user_tags"], "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "30 */2 * * 1-5", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "resource_type": "backup_policy_plan"}' responses.add(responses.POST, url, body=mock_response, @@ -15224,7 +15518,7 @@ def test_create_backup_policy_plan_value_error(self): # Set up parameter values backup_policy_id = 'testString' - cron_spec = '*/5 1,2,3 * * *' + cron_spec = '30 */2 * * 1-5' active = True attach_user_tags = ['my-daily-backup-plan'] copy_user_tags = True @@ -15262,7 +15556,7 @@ def test_delete_backup_policy_plan_all_params(self): """ # Set up mock url = preprocess_url('/backup_policies/testString/plans/testString') - mock_response = '{"active": true, "attach_user_tags": ["attach_user_tags"], "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "*/5 1,2,3 * * *", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "resource_type": "backup_policy_plan"}' + mock_response = '{"active": true, "attach_user_tags": ["attach_user_tags"], "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "30 */2 * * 1-5", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "resource_type": "backup_policy_plan"}' responses.add(responses.DELETE, url, body=mock_response, @@ -15302,7 +15596,7 @@ def test_delete_backup_policy_plan_required_params(self): """ # Set up mock url = preprocess_url('/backup_policies/testString/plans/testString') - mock_response = '{"active": true, "attach_user_tags": ["attach_user_tags"], "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "*/5 1,2,3 * * *", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "resource_type": "backup_policy_plan"}' + mock_response = '{"active": true, "attach_user_tags": ["attach_user_tags"], "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "30 */2 * * 1-5", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "resource_type": "backup_policy_plan"}' responses.add(responses.DELETE, url, body=mock_response, @@ -15340,7 +15634,7 @@ def test_delete_backup_policy_plan_value_error(self): """ # Set up mock url = preprocess_url('/backup_policies/testString/plans/testString') - mock_response = '{"active": true, "attach_user_tags": ["attach_user_tags"], "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "*/5 1,2,3 * * *", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "resource_type": "backup_policy_plan"}' + mock_response = '{"active": true, "attach_user_tags": ["attach_user_tags"], "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "30 */2 * * 1-5", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "resource_type": "backup_policy_plan"}' responses.add(responses.DELETE, url, body=mock_response, @@ -15382,7 +15676,7 @@ def test_get_backup_policy_plan_all_params(self): """ # Set up mock url = preprocess_url('/backup_policies/testString/plans/testString') - mock_response = '{"active": true, "attach_user_tags": ["attach_user_tags"], "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "*/5 1,2,3 * * *", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "resource_type": "backup_policy_plan"}' + mock_response = '{"active": true, "attach_user_tags": ["attach_user_tags"], "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "30 */2 * * 1-5", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "resource_type": "backup_policy_plan"}' responses.add(responses.GET, url, body=mock_response, @@ -15420,7 +15714,7 @@ def test_get_backup_policy_plan_value_error(self): """ # Set up mock url = preprocess_url('/backup_policies/testString/plans/testString') - mock_response = '{"active": true, "attach_user_tags": ["attach_user_tags"], "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "*/5 1,2,3 * * *", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "resource_type": "backup_policy_plan"}' + mock_response = '{"active": true, "attach_user_tags": ["attach_user_tags"], "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "30 */2 * * 1-5", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "resource_type": "backup_policy_plan"}' responses.add(responses.GET, url, body=mock_response, @@ -15462,7 +15756,7 @@ def test_update_backup_policy_plan_all_params(self): """ # Set up mock url = preprocess_url('/backup_policies/testString/plans/testString') - mock_response = '{"active": true, "attach_user_tags": ["attach_user_tags"], "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "*/5 1,2,3 * * *", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "resource_type": "backup_policy_plan"}' + mock_response = '{"active": true, "attach_user_tags": ["attach_user_tags"], "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "30 */2 * * 1-5", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "resource_type": "backup_policy_plan"}' responses.add(responses.PATCH, url, body=mock_response, @@ -15479,7 +15773,7 @@ def test_update_backup_policy_plan_all_params(self): backup_policy_plan_patch_model['active'] = True backup_policy_plan_patch_model['attach_user_tags'] = ['my-daily-backup-plan'] backup_policy_plan_patch_model['copy_user_tags'] = True - backup_policy_plan_patch_model['cron_spec'] = '*/5 1,2,3 * * *' + backup_policy_plan_patch_model['cron_spec'] = '30 */2 * * 1-5' backup_policy_plan_patch_model['deletion_trigger'] = backup_policy_plan_deletion_trigger_patch_model backup_policy_plan_patch_model['name'] = 'my-policy-plan' @@ -15521,7 +15815,7 @@ def test_update_backup_policy_plan_required_params(self): """ # Set up mock url = preprocess_url('/backup_policies/testString/plans/testString') - mock_response = '{"active": true, "attach_user_tags": ["attach_user_tags"], "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "*/5 1,2,3 * * *", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "resource_type": "backup_policy_plan"}' + mock_response = '{"active": true, "attach_user_tags": ["attach_user_tags"], "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "30 */2 * * 1-5", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "resource_type": "backup_policy_plan"}' responses.add(responses.PATCH, url, body=mock_response, @@ -15538,7 +15832,7 @@ def test_update_backup_policy_plan_required_params(self): backup_policy_plan_patch_model['active'] = True backup_policy_plan_patch_model['attach_user_tags'] = ['my-daily-backup-plan'] backup_policy_plan_patch_model['copy_user_tags'] = True - backup_policy_plan_patch_model['cron_spec'] = '*/5 1,2,3 * * *' + backup_policy_plan_patch_model['cron_spec'] = '30 */2 * * 1-5' backup_policy_plan_patch_model['deletion_trigger'] = backup_policy_plan_deletion_trigger_patch_model backup_policy_plan_patch_model['name'] = 'my-policy-plan' @@ -15578,7 +15872,7 @@ def test_update_backup_policy_plan_value_error(self): """ # Set up mock url = preprocess_url('/backup_policies/testString/plans/testString') - mock_response = '{"active": true, "attach_user_tags": ["attach_user_tags"], "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "*/5 1,2,3 * * *", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "resource_type": "backup_policy_plan"}' + mock_response = '{"active": true, "attach_user_tags": ["attach_user_tags"], "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "30 */2 * * 1-5", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "resource_type": "backup_policy_plan"}' responses.add(responses.PATCH, url, body=mock_response, @@ -15595,7 +15889,7 @@ def test_update_backup_policy_plan_value_error(self): backup_policy_plan_patch_model['active'] = True backup_policy_plan_patch_model['attach_user_tags'] = ['my-daily-backup-plan'] backup_policy_plan_patch_model['copy_user_tags'] = True - backup_policy_plan_patch_model['cron_spec'] = '*/5 1,2,3 * * *' + backup_policy_plan_patch_model['cron_spec'] = '30 */2 * * 1-5' backup_policy_plan_patch_model['deletion_trigger'] = backup_policy_plan_deletion_trigger_patch_model backup_policy_plan_patch_model['name'] = 'my-policy-plan' @@ -16827,7 +17121,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": "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}' + mock_response = '{"bare_metal_servers": [{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/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-server-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, @@ -16894,7 +17188,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": "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}' + mock_response = '{"bare_metal_servers": [{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/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-server-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, @@ -16925,7 +17219,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": "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}' + mock_response = '{"bare_metal_servers": [{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/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-server-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, @@ -16956,8 +17250,8 @@ def test_list_bare_metal_servers_with_pager_get_next(self): """ # Set up a two-page mock response url = preprocess_url('/bare_metal_servers') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"bare_metal_servers":[{"bandwidth":20000,"boot_target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-bare-metal-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"}}]}' + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"bare_metal_servers":[{"bandwidth":20000,"boot_target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-bare-metal-server-disk","resource_type":"bare_metal_server_disk"},"cpu":{"architecture":"amd64","core_count":80,"socket_count":4,"threads_per_core":2},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/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-server-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-server-disk","resource_type":"bare_metal_server_disk"},"cpu":{"architecture":"amd64","core_count":80,"socket_count":4,"threads_per_core":2},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/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-server-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, @@ -16996,8 +17290,8 @@ def test_list_bare_metal_servers_with_pager_get_all(self): """ # Set up a two-page mock response url = preprocess_url('/bare_metal_servers') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"bare_metal_servers":[{"bandwidth":20000,"boot_target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-bare-metal-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"}}]}' + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"bare_metal_servers":[{"bandwidth":20000,"boot_target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-bare-metal-server-disk","resource_type":"bare_metal_server_disk"},"cpu":{"architecture":"amd64","core_count":80,"socket_count":4,"threads_per_core":2},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/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-server-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-server-disk","resource_type":"bare_metal_server_disk"},"cpu":{"architecture":"amd64","core_count":80,"socket_count":4,"threads_per_core":2},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/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-server-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, @@ -17038,7 +17332,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": "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_response = '{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/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-server-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, @@ -17163,7 +17457,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": "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_response = '{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/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-server-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, @@ -17365,7 +17659,7 @@ def test_list_bare_metal_server_disks_all_params(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/disks') - mock_response = '{"disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-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-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}]}' responses.add(responses.GET, url, body=mock_response, @@ -17401,7 +17695,7 @@ def test_list_bare_metal_server_disks_value_error(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/disks') - mock_response = '{"disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-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-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}]}' responses.add(responses.GET, url, body=mock_response, @@ -17441,7 +17735,7 @@ def test_get_bare_metal_server_disk_all_params(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/disks/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-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-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}' responses.add(responses.GET, url, body=mock_response, @@ -17479,7 +17773,7 @@ def test_get_bare_metal_server_disk_value_error(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/disks/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-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-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}' responses.add(responses.GET, url, body=mock_response, @@ -17521,7 +17815,7 @@ def test_update_bare_metal_server_disk_all_params(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/disks/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-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-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}' responses.add(responses.PATCH, url, body=mock_response, @@ -17568,7 +17862,7 @@ def test_update_bare_metal_server_disk_value_error(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/disks/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-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-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}' responses.add(responses.PATCH, url, body=mock_response, @@ -18746,7 +19040,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": "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_response = '{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/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-server-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, @@ -18782,7 +19076,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": "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_response = '{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/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-server-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, @@ -18822,7 +19116,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": "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_response = '{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/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-server-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, @@ -18867,7 +19161,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": "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_response = '{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/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-server-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, @@ -19508,7 +19802,7 @@ def test_list_volumes_all_params(self): """ # Set up mock url = preprocess_url('/volumes') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volumes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volumes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "volumes": [{"active": true, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "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_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volumes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volumes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "volumes": [{"active": true, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "health_reasons": [{"code": "initializing_from_snapshot", "message": "Performance will be degraded while this volume is being initialized from its snapshot", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_tags": ["user_tags"], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}' responses.add(responses.GET, url, body=mock_response, @@ -19557,7 +19851,7 @@ def test_list_volumes_required_params(self): """ # Set up mock url = preprocess_url('/volumes') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volumes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volumes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "volumes": [{"active": true, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "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_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volumes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volumes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "volumes": [{"active": true, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "health_reasons": [{"code": "initializing_from_snapshot", "message": "Performance will be degraded while this volume is being initialized from its snapshot", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_tags": ["user_tags"], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}' responses.add(responses.GET, url, body=mock_response, @@ -19588,7 +19882,7 @@ def test_list_volumes_value_error(self): """ # Set up mock url = preprocess_url('/volumes') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volumes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volumes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "volumes": [{"active": true, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "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_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volumes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volumes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "volumes": [{"active": true, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "health_reasons": [{"code": "initializing_from_snapshot", "message": "Performance will be degraded while this volume is being initialized from its snapshot", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_tags": ["user_tags"], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}' responses.add(responses.GET, url, body=mock_response, @@ -19619,8 +19913,8 @@ def test_list_volumes_with_pager_get_next(self): """ # Set up a two-page mock response url = preprocess_url('/volumes') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"volumes":[{"active":true,"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"}}]}' + 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"},"health_reasons":[{"code":"initializing_from_snapshot","message":"Performance will be degraded while this volume is being initialized from its snapshot","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/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"},"health_reasons":[{"code":"initializing_from_snapshot","message":"Performance will be degraded while this volume is being initialized from its snapshot","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/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, @@ -19653,8 +19947,8 @@ def test_list_volumes_with_pager_get_all(self): """ # Set up a two-page mock response url = preprocess_url('/volumes') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"volumes":[{"active":true,"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"}}]}' + 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"},"health_reasons":[{"code":"initializing_from_snapshot","message":"Performance will be degraded while this volume is being initialized from its snapshot","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/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"},"health_reasons":[{"code":"initializing_from_snapshot","message":"Performance will be degraded while this volume is being initialized from its snapshot","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/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, @@ -19689,7 +19983,7 @@ def test_create_volume_all_params(self): """ # Set up mock url = preprocess_url('/volumes') - mock_response = '{"active": true, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "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_response = '{"active": true, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "health_reasons": [{"code": "initializing_from_snapshot", "message": "Performance will be degraded while this volume is being initialized from its snapshot", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_tags": ["user_tags"], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.POST, url, body=mock_response, @@ -19755,7 +20049,7 @@ def test_create_volume_value_error(self): """ # Set up mock url = preprocess_url('/volumes') - mock_response = '{"active": true, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "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_response = '{"active": true, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "health_reasons": [{"code": "initializing_from_snapshot", "message": "Performance will be degraded while this volume is being initialized from its snapshot", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_tags": ["user_tags"], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.POST, url, body=mock_response, @@ -19927,7 +20221,7 @@ def test_get_volume_all_params(self): """ # Set up mock url = preprocess_url('/volumes/testString') - mock_response = '{"active": true, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "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_response = '{"active": true, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "health_reasons": [{"code": "initializing_from_snapshot", "message": "Performance will be degraded while this volume is being initialized from its snapshot", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_tags": ["user_tags"], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.GET, url, body=mock_response, @@ -19963,7 +20257,7 @@ def test_get_volume_value_error(self): """ # Set up mock url = preprocess_url('/volumes/testString') - mock_response = '{"active": true, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "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_response = '{"active": true, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "health_reasons": [{"code": "initializing_from_snapshot", "message": "Performance will be degraded while this volume is being initialized from its snapshot", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_tags": ["user_tags"], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.GET, url, body=mock_response, @@ -20003,7 +20297,7 @@ def test_update_volume_all_params(self): """ # Set up mock url = preprocess_url('/volumes/testString') - mock_response = '{"active": true, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "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_response = '{"active": true, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "health_reasons": [{"code": "initializing_from_snapshot", "message": "Performance will be degraded while this volume is being initialized from its snapshot", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_tags": ["user_tags"], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.PATCH, url, body=mock_response, @@ -20058,7 +20352,7 @@ def test_update_volume_required_params(self): """ # Set up mock url = preprocess_url('/volumes/testString') - mock_response = '{"active": true, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "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_response = '{"active": true, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "health_reasons": [{"code": "initializing_from_snapshot", "message": "Performance will be degraded while this volume is being initialized from its snapshot", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_tags": ["user_tags"], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.PATCH, url, body=mock_response, @@ -20111,7 +20405,7 @@ def test_update_volume_value_error(self): """ # Set up mock url = preprocess_url('/volumes/testString') - mock_response = '{"active": true, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "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_response = '{"active": true, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "health_reasons": [{"code": "initializing_from_snapshot", "message": "Performance will be degraded while this volume is being initialized from its snapshot", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_tags": ["user_tags"], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add(responses.PATCH, url, body=mock_response, @@ -30300,7 +30594,7 @@ def test_list_load_balancers_all_params(self): """ # Set up mock url = preprocess_url('/load_balancers') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers?limit=20"}, "limit": 20, "load_balancers": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "hostname": "my-load-balancer-123456-us-south-1.lb.bluemix.net", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4", "deleted": {"more_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}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers?limit=20"}, "limit": 20, "load_balancers": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "hostname": "6b88d615-us-south.lb.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "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}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -30343,7 +30637,7 @@ def test_list_load_balancers_required_params(self): """ # Set up mock url = preprocess_url('/load_balancers') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers?limit=20"}, "limit": 20, "load_balancers": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "hostname": "my-load-balancer-123456-us-south-1.lb.bluemix.net", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4", "deleted": {"more_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}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers?limit=20"}, "limit": 20, "load_balancers": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "hostname": "6b88d615-us-south.lb.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "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}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -30374,7 +30668,7 @@ def test_list_load_balancers_value_error(self): """ # Set up mock url = preprocess_url('/load_balancers') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers?limit=20"}, "limit": 20, "load_balancers": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "hostname": "my-load-balancer-123456-us-south-1.lb.bluemix.net", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4", "deleted": {"more_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}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers?limit=20"}, "limit": 20, "load_balancers": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "hostname": "6b88d615-us-south.lb.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "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}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}' responses.add(responses.GET, url, body=mock_response, @@ -30405,8 +30699,8 @@ def test_list_load_balancers_with_pager_get_next(self): """ # 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}]}' + 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":"6b88d615-us-south.lb.appdomain.cloud","href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727","id":"dd754295-e9e0-4c9d-bf6c-58fbc59e5727","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":"6b88d615-us-south.lb.appdomain.cloud","href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727","id":"dd754295-e9e0-4c9d-bf6c-58fbc59e5727","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, @@ -30437,8 +30731,8 @@ def test_list_load_balancers_with_pager_get_all(self): """ # 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}]}' + 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":"6b88d615-us-south.lb.appdomain.cloud","href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727","id":"dd754295-e9e0-4c9d-bf6c-58fbc59e5727","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":"6b88d615-us-south.lb.appdomain.cloud","href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727","id":"dd754295-e9e0-4c9d-bf6c-58fbc59e5727","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, @@ -30471,7 +30765,7 @@ def test_create_load_balancer_all_params(self): """ # Set up mock url = preprocess_url('/load_balancers') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "hostname": "my-load-balancer-123456-us-south-1.lb.bluemix.net", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4", "deleted": {"more_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_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": "6b88d615-us-south.lb.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "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.POST, url, body=mock_response, @@ -30625,7 +30919,7 @@ def test_create_load_balancer_value_error(self): """ # Set up mock url = preprocess_url('/load_balancers') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "hostname": "my-load-balancer-123456-us-south-1.lb.bluemix.net", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4", "deleted": {"more_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_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": "6b88d615-us-south.lb.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "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.POST, url, body=mock_response, @@ -30868,7 +31162,7 @@ def test_get_load_balancer_all_params(self): """ # Set up mock url = preprocess_url('/load_balancers/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "hostname": "my-load-balancer-123456-us-south-1.lb.bluemix.net", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4", "deleted": {"more_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_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": "6b88d615-us-south.lb.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "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_response, @@ -30904,7 +31198,7 @@ def test_get_load_balancer_value_error(self): """ # Set up mock url = preprocess_url('/load_balancers/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "hostname": "my-load-balancer-123456-us-south-1.lb.bluemix.net", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4", "deleted": {"more_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_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": "6b88d615-us-south.lb.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "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_response, @@ -30944,7 +31238,7 @@ def test_update_load_balancer_all_params(self): """ # Set up mock url = preprocess_url('/load_balancers/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "hostname": "my-load-balancer-123456-us-south-1.lb.bluemix.net", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4", "deleted": {"more_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_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": "6b88d615-us-south.lb.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "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, @@ -31005,7 +31299,7 @@ def test_update_load_balancer_required_params(self): """ # Set up mock url = preprocess_url('/load_balancers/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "hostname": "my-load-balancer-123456-us-south-1.lb.bluemix.net", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4", "deleted": {"more_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_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": "6b88d615-us-south.lb.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "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, @@ -31064,7 +31358,7 @@ def test_update_load_balancer_value_error(self): """ # Set up mock url = preprocess_url('/load_balancers/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "hostname": "my-load-balancer-123456-us-south-1.lb.bluemix.net", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4", "deleted": {"more_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_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": "6b88d615-us-south.lb.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "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, @@ -31200,7 +31494,7 @@ def test_list_load_balancer_listeners_all_params(self): """ # Set up mock url = preprocess_url('/load_balancers/testString/listeners') - mock_response = '{"listeners": [{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}]}' + mock_response = '{"listeners": [{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "anyValue"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}]}' responses.add(responses.GET, url, body=mock_response, @@ -31236,7 +31530,7 @@ def test_list_load_balancer_listeners_value_error(self): """ # Set up mock url = preprocess_url('/load_balancers/testString/listeners') - mock_response = '{"listeners": [{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}]}' + mock_response = '{"listeners": [{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "anyValue"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}]}' responses.add(responses.GET, url, body=mock_response, @@ -31276,7 +31570,7 @@ def test_create_load_balancer_listener_all_params(self): """ # Set up mock url = preprocess_url('/load_balancers/testString/listeners') - mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}' + mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "anyValue"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}' responses.add(responses.POST, url, body=mock_response, @@ -31381,7 +31675,7 @@ def test_create_load_balancer_listener_value_error(self): """ # Set up mock url = preprocess_url('/load_balancers/testString/listeners') - mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}' + mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "anyValue"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}' responses.add(responses.POST, url, body=mock_response, @@ -31543,7 +31837,7 @@ def test_get_load_balancer_listener_all_params(self): """ # Set up mock url = preprocess_url('/load_balancers/testString/listeners/testString') - mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}' + mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "anyValue"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}' responses.add(responses.GET, url, body=mock_response, @@ -31581,7 +31875,7 @@ def test_get_load_balancer_listener_value_error(self): """ # Set up mock url = preprocess_url('/load_balancers/testString/listeners/testString') - mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}' + mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "anyValue"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}' responses.add(responses.GET, url, body=mock_response, @@ -31623,7 +31917,7 @@ def test_update_load_balancer_listener_all_params(self): """ # Set up mock url = preprocess_url('/load_balancers/testString/listeners/testString') - mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}' + mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "anyValue"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}' responses.add(responses.PATCH, url, body=mock_response, @@ -31696,7 +31990,7 @@ def test_update_load_balancer_listener_value_error(self): """ # Set up mock url = preprocess_url('/load_balancers/testString/listeners/testString') - mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}' + mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "anyValue"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}' responses.add(responses.PATCH, url, body=mock_response, @@ -35474,7 +35768,7 @@ def test_address_prefix_serialization(self): address_prefix_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/address_prefixes/1a15dca5-7e33-45e1-b7c5-bc690e569531' address_prefix_model_json['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' address_prefix_model_json['is_default'] = False - address_prefix_model_json['name'] = 'my-address-prefix-2' + address_prefix_model_json['name'] = 'my-address-prefix-1' address_prefix_model_json['zone'] = zone_reference_model # Construct a model instance of AddressPrefix by calling from_dict on the json representation @@ -35515,7 +35809,7 @@ def test_address_prefix_collection_serialization(self): address_prefix_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/address_prefixes/1a15dca5-7e33-45e1-b7c5-bc690e569531' address_prefix_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531' address_prefix_model['is_default'] = False - address_prefix_model['name'] = 'my-address-prefix-2' + address_prefix_model['name'] = 'my-address-prefix-1' address_prefix_model['zone'] = zone_reference_model address_prefix_collection_first_model = {} # AddressPrefixCollectionFirst @@ -35618,7 +35912,7 @@ def test_address_prefix_patch_serialization(self): # Construct a json representation of a AddressPrefixPatch model address_prefix_patch_model_json = {} address_prefix_patch_model_json['is_default'] = False - address_prefix_patch_model_json['name'] = 'my-address-prefix-2' + address_prefix_patch_model_json['name'] = 'my-address-prefix-1' # Construct a model instance of AddressPrefixPatch by calling from_dict on the json representation address_prefix_patch_model = AddressPrefixPatch.from_dict(address_prefix_patch_model_json) @@ -35820,6 +36114,266 @@ def test_backup_policy_collection_next_serialization(self): backup_policy_collection_next_model_json2 = backup_policy_collection_next_model.to_dict() assert backup_policy_collection_next_model_json2 == backup_policy_collection_next_model_json +class TestModel_BackupPolicyJob(): + """ + Test Class for BackupPolicyJob + """ + + def test_backup_policy_job_serialization(self): + """ + Test serialization/deserialization for BackupPolicyJob + """ + + # Construct dict forms of any model objects needed in order to build this model. + + backup_policy_plan_reference_deleted_model = {} # BackupPolicyPlanReferenceDeleted + backup_policy_plan_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + backup_policy_plan_reference_model = {} # BackupPolicyPlanReference + backup_policy_plan_reference_model['deleted'] = backup_policy_plan_reference_deleted_model + backup_policy_plan_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178' + backup_policy_plan_reference_model['id'] = 'r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178' + backup_policy_plan_reference_model['name'] = 'my-policy-plan' + backup_policy_plan_reference_model['resource_type'] = 'backup_policy_plan' + + volume_reference_deleted_model = {} # VolumeReferenceDeleted + volume_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + backup_policy_job_source_model = {} # BackupPolicyJobSourceVolumeReference + backup_policy_job_source_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5' + backup_policy_job_source_model['deleted'] = volume_reference_deleted_model + backup_policy_job_source_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5' + backup_policy_job_source_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5' + backup_policy_job_source_model['name'] = 'my-volume' + + backup_policy_job_status_reason_model = {} # BackupPolicyJobStatusReason + backup_policy_job_status_reason_model['code'] = 'source_volume_busy' + backup_policy_job_status_reason_model['message'] = 'testString' + backup_policy_job_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshooting-backup-for-vpc' + + snapshot_reference_deleted_model = {} # SnapshotReferenceDeleted + snapshot_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + snapshot_reference_model = {} # SnapshotReference + snapshot_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263' + snapshot_reference_model['deleted'] = snapshot_reference_deleted_model + snapshot_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263' + snapshot_reference_model['id'] = 'r134-f6bfa329-0e36-433f-a3bb-0df632e79263' + snapshot_reference_model['name'] = 'my-snapshot' + snapshot_reference_model['resource_type'] = 'snapshot' + + # Construct a json representation of a BackupPolicyJob model + backup_policy_job_model_json = {} + backup_policy_job_model_json['auto_delete'] = True + backup_policy_job_model_json['auto_delete_after'] = 90 + backup_policy_job_model_json['backup_policy_plan'] = backup_policy_plan_reference_model + backup_policy_job_model_json['completed_at'] = '2019-01-01T12:00:00Z' + backup_policy_job_model_json['created_at'] = '2019-01-01T12:00:00Z' + backup_policy_job_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/0fe9e5d8-0a4d-4818-96ec-e99708644a58/jobs/4cf9171a-0043-4434-8727-15b53dbc374c' + backup_policy_job_model_json['id'] = '4cf9171a-0043-4434-8727-15b53dbc374c' + backup_policy_job_model_json['job_type'] = 'creation' + backup_policy_job_model_json['resource_type'] = 'backup_policy_job' + backup_policy_job_model_json['source'] = backup_policy_job_source_model + backup_policy_job_model_json['status'] = 'failed' + backup_policy_job_model_json['status_reasons'] = [backup_policy_job_status_reason_model] + backup_policy_job_model_json['target_snapshots'] = [snapshot_reference_model] + + # Construct a model instance of BackupPolicyJob by calling from_dict on the json representation + backup_policy_job_model = BackupPolicyJob.from_dict(backup_policy_job_model_json) + assert backup_policy_job_model != False + + # Construct a model instance of BackupPolicyJob by calling from_dict on the json representation + backup_policy_job_model_dict = BackupPolicyJob.from_dict(backup_policy_job_model_json).__dict__ + backup_policy_job_model2 = BackupPolicyJob(**backup_policy_job_model_dict) + + # Verify the model instances are equivalent + assert backup_policy_job_model == backup_policy_job_model2 + + # Convert model instance back to dict and verify no loss of data + backup_policy_job_model_json2 = backup_policy_job_model.to_dict() + assert backup_policy_job_model_json2 == backup_policy_job_model_json + +class TestModel_BackupPolicyJobCollection(): + """ + Test Class for BackupPolicyJobCollection + """ + + def test_backup_policy_job_collection_serialization(self): + """ + Test serialization/deserialization for BackupPolicyJobCollection + """ + + # Construct dict forms of any model objects needed in order to build this model. + + backup_policy_job_collection_first_model = {} # BackupPolicyJobCollectionFirst + backup_policy_job_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/7241e2a8-601f-11ea-8503-000c29475bed/jobs?limit=20' + + backup_policy_plan_reference_deleted_model = {} # BackupPolicyPlanReferenceDeleted + backup_policy_plan_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + backup_policy_plan_reference_model = {} # BackupPolicyPlanReference + backup_policy_plan_reference_model['deleted'] = backup_policy_plan_reference_deleted_model + backup_policy_plan_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178' + backup_policy_plan_reference_model['id'] = 'r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178' + backup_policy_plan_reference_model['name'] = 'my-policy-plan' + backup_policy_plan_reference_model['resource_type'] = 'backup_policy_plan' + + volume_reference_deleted_model = {} # VolumeReferenceDeleted + volume_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + backup_policy_job_source_model = {} # BackupPolicyJobSourceVolumeReference + backup_policy_job_source_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5' + backup_policy_job_source_model['deleted'] = volume_reference_deleted_model + backup_policy_job_source_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5' + backup_policy_job_source_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5' + backup_policy_job_source_model['name'] = 'my-volume' + + backup_policy_job_status_reason_model = {} # BackupPolicyJobStatusReason + backup_policy_job_status_reason_model['code'] = 'source_volume_busy' + backup_policy_job_status_reason_model['message'] = 'testString' + backup_policy_job_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshooting-backup-for-vpc' + + snapshot_reference_deleted_model = {} # SnapshotReferenceDeleted + snapshot_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + snapshot_reference_model = {} # SnapshotReference + snapshot_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263' + snapshot_reference_model['deleted'] = snapshot_reference_deleted_model + snapshot_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263' + snapshot_reference_model['id'] = 'r134-f6bfa329-0e36-433f-a3bb-0df632e79263' + snapshot_reference_model['name'] = 'my-snapshot' + snapshot_reference_model['resource_type'] = 'snapshot' + + backup_policy_job_model = {} # BackupPolicyJob + backup_policy_job_model['auto_delete'] = True + backup_policy_job_model['auto_delete_after'] = 90 + backup_policy_job_model['backup_policy_plan'] = backup_policy_plan_reference_model + backup_policy_job_model['completed_at'] = '2019-01-01T12:00:00Z' + backup_policy_job_model['created_at'] = '2019-01-01T12:00:00Z' + backup_policy_job_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/0fe9e5d8-0a4d-4818-96ec-e99708644a58/jobs/4cf9171a-0043-4434-8727-15b53dbc374c' + backup_policy_job_model['id'] = '4cf9171a-0043-4434-8727-15b53dbc374c' + backup_policy_job_model['job_type'] = 'creation' + backup_policy_job_model['resource_type'] = 'backup_policy_job' + backup_policy_job_model['source'] = backup_policy_job_source_model + backup_policy_job_model['status'] = 'failed' + backup_policy_job_model['status_reasons'] = [backup_policy_job_status_reason_model] + backup_policy_job_model['target_snapshots'] = [snapshot_reference_model] + + backup_policy_job_collection_next_model = {} # BackupPolicyJobCollectionNext + backup_policy_job_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/7241e2a8-601f-11ea-8503-000c29475bed/jobss?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + + # Construct a json representation of a BackupPolicyJobCollection model + backup_policy_job_collection_model_json = {} + backup_policy_job_collection_model_json['first'] = backup_policy_job_collection_first_model + backup_policy_job_collection_model_json['jobs'] = [backup_policy_job_model] + backup_policy_job_collection_model_json['limit'] = 20 + backup_policy_job_collection_model_json['next'] = backup_policy_job_collection_next_model + backup_policy_job_collection_model_json['total_count'] = 132 + + # Construct a model instance of BackupPolicyJobCollection by calling from_dict on the json representation + backup_policy_job_collection_model = BackupPolicyJobCollection.from_dict(backup_policy_job_collection_model_json) + assert backup_policy_job_collection_model != False + + # Construct a model instance of BackupPolicyJobCollection by calling from_dict on the json representation + backup_policy_job_collection_model_dict = BackupPolicyJobCollection.from_dict(backup_policy_job_collection_model_json).__dict__ + backup_policy_job_collection_model2 = BackupPolicyJobCollection(**backup_policy_job_collection_model_dict) + + # Verify the model instances are equivalent + assert backup_policy_job_collection_model == backup_policy_job_collection_model2 + + # Convert model instance back to dict and verify no loss of data + backup_policy_job_collection_model_json2 = backup_policy_job_collection_model.to_dict() + assert backup_policy_job_collection_model_json2 == backup_policy_job_collection_model_json + +class TestModel_BackupPolicyJobCollectionFirst(): + """ + Test Class for BackupPolicyJobCollectionFirst + """ + + def test_backup_policy_job_collection_first_serialization(self): + """ + Test serialization/deserialization for BackupPolicyJobCollectionFirst + """ + + # Construct a json representation of a BackupPolicyJobCollectionFirst model + backup_policy_job_collection_first_model_json = {} + backup_policy_job_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/7241e2a8-601f-11ea-8503-000c29475bed/jobs?limit=20' + + # Construct a model instance of BackupPolicyJobCollectionFirst by calling from_dict on the json representation + backup_policy_job_collection_first_model = BackupPolicyJobCollectionFirst.from_dict(backup_policy_job_collection_first_model_json) + assert backup_policy_job_collection_first_model != False + + # Construct a model instance of BackupPolicyJobCollectionFirst by calling from_dict on the json representation + backup_policy_job_collection_first_model_dict = BackupPolicyJobCollectionFirst.from_dict(backup_policy_job_collection_first_model_json).__dict__ + backup_policy_job_collection_first_model2 = BackupPolicyJobCollectionFirst(**backup_policy_job_collection_first_model_dict) + + # Verify the model instances are equivalent + assert backup_policy_job_collection_first_model == backup_policy_job_collection_first_model2 + + # Convert model instance back to dict and verify no loss of data + backup_policy_job_collection_first_model_json2 = backup_policy_job_collection_first_model.to_dict() + assert backup_policy_job_collection_first_model_json2 == backup_policy_job_collection_first_model_json + +class TestModel_BackupPolicyJobCollectionNext(): + """ + Test Class for BackupPolicyJobCollectionNext + """ + + def test_backup_policy_job_collection_next_serialization(self): + """ + Test serialization/deserialization for BackupPolicyJobCollectionNext + """ + + # Construct a json representation of a BackupPolicyJobCollectionNext model + backup_policy_job_collection_next_model_json = {} + backup_policy_job_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/7241e2a8-601f-11ea-8503-000c29475bed/jobss?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + + # Construct a model instance of BackupPolicyJobCollectionNext by calling from_dict on the json representation + backup_policy_job_collection_next_model = BackupPolicyJobCollectionNext.from_dict(backup_policy_job_collection_next_model_json) + assert backup_policy_job_collection_next_model != False + + # Construct a model instance of BackupPolicyJobCollectionNext by calling from_dict on the json representation + backup_policy_job_collection_next_model_dict = BackupPolicyJobCollectionNext.from_dict(backup_policy_job_collection_next_model_json).__dict__ + backup_policy_job_collection_next_model2 = BackupPolicyJobCollectionNext(**backup_policy_job_collection_next_model_dict) + + # Verify the model instances are equivalent + assert backup_policy_job_collection_next_model == backup_policy_job_collection_next_model2 + + # Convert model instance back to dict and verify no loss of data + backup_policy_job_collection_next_model_json2 = backup_policy_job_collection_next_model.to_dict() + assert backup_policy_job_collection_next_model_json2 == backup_policy_job_collection_next_model_json + +class TestModel_BackupPolicyJobStatusReason(): + """ + Test Class for BackupPolicyJobStatusReason + """ + + def test_backup_policy_job_status_reason_serialization(self): + """ + Test serialization/deserialization for BackupPolicyJobStatusReason + """ + + # Construct a json representation of a BackupPolicyJobStatusReason model + backup_policy_job_status_reason_model_json = {} + backup_policy_job_status_reason_model_json['code'] = 'source_volume_busy' + backup_policy_job_status_reason_model_json['message'] = 'testString' + backup_policy_job_status_reason_model_json['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshooting-backup-for-vpc' + + # Construct a model instance of BackupPolicyJobStatusReason by calling from_dict on the json representation + backup_policy_job_status_reason_model = BackupPolicyJobStatusReason.from_dict(backup_policy_job_status_reason_model_json) + assert backup_policy_job_status_reason_model != False + + # Construct a model instance of BackupPolicyJobStatusReason by calling from_dict on the json representation + backup_policy_job_status_reason_model_dict = BackupPolicyJobStatusReason.from_dict(backup_policy_job_status_reason_model_json).__dict__ + backup_policy_job_status_reason_model2 = BackupPolicyJobStatusReason(**backup_policy_job_status_reason_model_dict) + + # Verify the model instances are equivalent + assert backup_policy_job_status_reason_model == backup_policy_job_status_reason_model2 + + # Convert model instance back to dict and verify no loss of data + backup_policy_job_status_reason_model_json2 = backup_policy_job_status_reason_model.to_dict() + assert backup_policy_job_status_reason_model_json2 == backup_policy_job_status_reason_model_json + class TestModel_BackupPolicyPatch(): """ Test Class for BackupPolicyPatch @@ -35872,7 +36426,7 @@ def test_backup_policy_plan_serialization(self): backup_policy_plan_model_json['attach_user_tags'] = ['my-daily-backup-plan'] backup_policy_plan_model_json['copy_user_tags'] = True backup_policy_plan_model_json['created_at'] = '2019-01-01T12:00:00Z' - backup_policy_plan_model_json['cron_spec'] = '*/5 1,2,3 * * *' + backup_policy_plan_model_json['cron_spec'] = '30 */2 * * 1-5' backup_policy_plan_model_json['deletion_trigger'] = backup_policy_plan_deletion_trigger_model backup_policy_plan_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178' backup_policy_plan_model_json['id'] = 'r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178' @@ -35916,7 +36470,7 @@ def test_backup_policy_plan_collection_serialization(self): backup_policy_plan_model['attach_user_tags'] = ['my-daily-backup-plan'] backup_policy_plan_model['copy_user_tags'] = True backup_policy_plan_model['created_at'] = '2019-01-01T12:00:00Z' - backup_policy_plan_model['cron_spec'] = '*/5 1,2,3 * * *' + backup_policy_plan_model['cron_spec'] = '30 */2 * * 1-5' backup_policy_plan_model['deletion_trigger'] = backup_policy_plan_deletion_trigger_model backup_policy_plan_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178' backup_policy_plan_model['id'] = 'r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178' @@ -36054,7 +36608,7 @@ def test_backup_policy_plan_patch_serialization(self): backup_policy_plan_patch_model_json['active'] = True backup_policy_plan_patch_model_json['attach_user_tags'] = ['my-daily-backup-plan'] backup_policy_plan_patch_model_json['copy_user_tags'] = True - backup_policy_plan_patch_model_json['cron_spec'] = '*/5 1,2,3 * * *' + backup_policy_plan_patch_model_json['cron_spec'] = '30 */2 * * 1-5' backup_policy_plan_patch_model_json['deletion_trigger'] = backup_policy_plan_deletion_trigger_patch_model backup_policy_plan_patch_model_json['name'] = 'my-policy-plan' @@ -36094,7 +36648,7 @@ def test_backup_policy_plan_prototype_serialization(self): backup_policy_plan_prototype_model_json['active'] = True backup_policy_plan_prototype_model_json['attach_user_tags'] = ['my-daily-backup-plan'] backup_policy_plan_prototype_model_json['copy_user_tags'] = True - backup_policy_plan_prototype_model_json['cron_spec'] = '*/5 1,2,3 * * *' + backup_policy_plan_prototype_model_json['cron_spec'] = '30 */2 * * 1-5' backup_policy_plan_prototype_model_json['deletion_trigger'] = backup_policy_plan_deletion_trigger_prototype_model backup_policy_plan_prototype_model_json['name'] = 'my-policy-plan' @@ -36199,7 +36753,7 @@ def test_bare_metal_server_serialization(self): bare_metal_server_boot_target_model['deleted'] = bare_metal_server_disk_reference_deleted_model bare_metal_server_boot_target_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_boot_target_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' - bare_metal_server_boot_target_model['name'] = 'my-bare-metal-disk' + bare_metal_server_boot_target_model['name'] = 'my-bare-metal-server-disk' bare_metal_server_boot_target_model['resource_type'] = 'bare_metal_server_disk' bare_metal_server_cpu_model = {} # BareMetalServerCPU @@ -36213,7 +36767,7 @@ def test_bare_metal_server_serialization(self): bare_metal_server_disk_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e' bare_metal_server_disk_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' bare_metal_server_disk_model['interface_type'] = 'fcp' - bare_metal_server_disk_model['name'] = 'my-bare-metal-disk' + bare_metal_server_disk_model['name'] = 'my-bare-metal-server-disk' bare_metal_server_disk_model['resource_type'] = 'bare_metal_server_disk' bare_metal_server_disk_model['size'] = 100 @@ -36375,7 +36929,7 @@ def test_bare_metal_server_collection_serialization(self): bare_metal_server_boot_target_model['deleted'] = bare_metal_server_disk_reference_deleted_model bare_metal_server_boot_target_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_boot_target_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' - bare_metal_server_boot_target_model['name'] = 'my-bare-metal-disk' + bare_metal_server_boot_target_model['name'] = 'my-bare-metal-server-disk' bare_metal_server_boot_target_model['resource_type'] = 'bare_metal_server_disk' bare_metal_server_cpu_model = {} # BareMetalServerCPU @@ -36389,7 +36943,7 @@ def test_bare_metal_server_collection_serialization(self): bare_metal_server_disk_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e' bare_metal_server_disk_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' bare_metal_server_disk_model['interface_type'] = 'fcp' - bare_metal_server_disk_model['name'] = 'my-bare-metal-disk' + bare_metal_server_disk_model['name'] = 'my-bare-metal-server-disk' bare_metal_server_disk_model['resource_type'] = 'bare_metal_server_disk' bare_metal_server_disk_model['size'] = 100 @@ -36621,7 +37175,7 @@ def test_bare_metal_server_disk_serialization(self): bare_metal_server_disk_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e' bare_metal_server_disk_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' bare_metal_server_disk_model_json['interface_type'] = 'fcp' - bare_metal_server_disk_model_json['name'] = 'my-bare-metal-disk' + bare_metal_server_disk_model_json['name'] = 'my-bare-metal-server-disk' bare_metal_server_disk_model_json['resource_type'] = 'bare_metal_server_disk' bare_metal_server_disk_model_json['size'] = 100 @@ -36657,7 +37211,7 @@ def test_bare_metal_server_disk_collection_serialization(self): bare_metal_server_disk_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e' bare_metal_server_disk_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' bare_metal_server_disk_model['interface_type'] = 'fcp' - bare_metal_server_disk_model['name'] = 'my-bare-metal-disk' + bare_metal_server_disk_model['name'] = 'my-bare-metal-server-disk' bare_metal_server_disk_model['resource_type'] = 'bare_metal_server_disk' bare_metal_server_disk_model['size'] = 100 @@ -42645,7 +43199,7 @@ def test_instance_group_manager_action_patch_serialization(self): # Construct a json representation of a InstanceGroupManagerActionPatch model instance_group_manager_action_patch_model_json = {} - instance_group_manager_action_patch_model_json['cron_spec'] = '*/5 1,2,3 * * *' + instance_group_manager_action_patch_model_json['cron_spec'] = '30 */2 * * 1-5' instance_group_manager_action_patch_model_json['group'] = instance_group_manager_action_group_patch_model instance_group_manager_action_patch_model_json['manager'] = instance_group_manager_action_manager_patch_model instance_group_manager_action_patch_model_json['name'] = 'my-instance-group-manager-action' @@ -42759,7 +43313,7 @@ def test_instance_group_manager_actions_collection_serialization(self): instance_group_manager_action_model['status'] = 'active' instance_group_manager_action_model['updated_at'] = '2019-01-01T12:00:00Z' instance_group_manager_action_model['action_type'] = 'scheduled' - instance_group_manager_action_model['cron_spec'] = '*/5 1,2,3 * * *' + instance_group_manager_action_model['cron_spec'] = '30 */2 * * 1-5' instance_group_manager_action_model['last_applied_at'] = '2019-01-01T12:00:00Z' instance_group_manager_action_model['next_run_at'] = '2019-01-01T12:00:00Z' instance_group_manager_action_model['group'] = instance_group_manager_scheduled_action_group_model @@ -44567,13 +45121,13 @@ def test_instance_template_collection_serialization(self): 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_volume_model = {} # VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById + volume_attachment_prototype_volume_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 + volume_attachment_prototype_model = {} # VolumeAttachmentPrototype + volume_attachment_prototype_model['delete_volume_on_instance_delete'] = False + volume_attachment_prototype_model['name'] = 'my-volume-attachment' + volume_attachment_prototype_model['volume'] = volume_attachment_prototype_volume_model vpc_identity_model = {} # VPCIdentityById vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' @@ -44619,7 +45173,7 @@ def test_instance_template_collection_serialization(self): instance_template_model['resource_group'] = resource_group_reference_model instance_template_model['total_volume_bandwidth'] = 500 instance_template_model['user_data'] = 'testString' - instance_template_model['volume_attachments'] = [volume_attachment_prototype_instance_context_model] + instance_template_model['volume_attachments'] = [volume_attachment_prototype_model] instance_template_model['vpc'] = vpc_identity_model instance_template_model['boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model instance_template_model['image'] = image_identity_model @@ -45235,7 +45789,7 @@ def test_load_balancer_serialization(self): load_balancer_model_json = {} load_balancer_model_json['created_at'] = '2019-01-01T12:00:00Z' load_balancer_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727' - load_balancer_model_json['hostname'] = 'my-load-balancer-123456-us-south-1.lb.bluemix.net' + load_balancer_model_json['hostname'] = '6b88d615-us-south.lb.appdomain.cloud' load_balancer_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727' load_balancer_model_json['id'] = 'dd754295-e9e0-4c9d-bf6c-58fbc59e5727' load_balancer_model_json['is_public'] = True @@ -45357,7 +45911,7 @@ def test_load_balancer_collection_serialization(self): load_balancer_model = {} # LoadBalancer load_balancer_model['created_at'] = '2019-01-01T12:00:00Z' load_balancer_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727' - load_balancer_model['hostname'] = 'my-load-balancer-123456-us-south-1.lb.bluemix.net' + load_balancer_model['hostname'] = '6b88d615-us-south.lb.appdomain.cloud' load_balancer_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727' load_balancer_model['id'] = 'dd754295-e9e0-4c9d-bf6c-58fbc59e5727' load_balancer_model['is_public'] = True @@ -45506,6 +46060,7 @@ def test_load_balancer_listener_serialization(self): load_balancer_listener_policy_reference_model['deleted'] = load_balancer_listener_policy_reference_deleted_model load_balancer_listener_policy_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278' load_balancer_listener_policy_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_listener_policy_reference_model['name'] = 'testString' # Construct a json representation of a LoadBalancerListener model load_balancer_listener_model_json = {} @@ -45583,6 +46138,7 @@ def test_load_balancer_listener_collection_serialization(self): load_balancer_listener_policy_reference_model['deleted'] = load_balancer_listener_policy_reference_deleted_model load_balancer_listener_policy_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278' load_balancer_listener_policy_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_listener_policy_reference_model['name'] = 'testString' load_balancer_listener_model = {} # LoadBalancerListener load_balancer_listener_model['accept_proxy_protocol'] = True @@ -46000,6 +46556,7 @@ def test_load_balancer_listener_policy_reference_serialization(self): load_balancer_listener_policy_reference_model_json['deleted'] = load_balancer_listener_policy_reference_deleted_model load_balancer_listener_policy_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278' load_balancer_listener_policy_reference_model_json['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004' + load_balancer_listener_policy_reference_model_json['name'] = 'testString' # Construct a model instance of LoadBalancerListenerPolicyReference by calling from_dict on the json representation load_balancer_listener_policy_reference_model = LoadBalancerListenerPolicyReference.from_dict(load_balancer_listener_policy_reference_model_json) @@ -53716,6 +54273,11 @@ def test_volume_serialization(self): 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' + volume_health_reason_model = {} # VolumeHealthReason + volume_health_reason_model['code'] = 'initializing_from_snapshot' + volume_health_reason_model['message'] = 'Performance will be degraded while this volume is being initialized from its snapshot' + volume_health_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf' + operating_system_reference_model = {} # OperatingSystemReference operating_system_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64' operating_system_reference_model['name'] = 'ubuntu-16-amd64' @@ -53795,6 +54357,8 @@ def test_volume_serialization(self): volume_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5' volume_model_json['encryption'] = 'provider_managed' volume_model_json['encryption_key'] = encryption_key_reference_model + volume_model_json['health_reasons'] = [volume_health_reason_model] + volume_model_json['health_state'] = 'ok' volume_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5' volume_model_json['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5' volume_model_json['iops'] = 10000 @@ -53993,6 +54557,42 @@ def test_volume_attachment_patch_serialization(self): volume_attachment_patch_model_json2 = volume_attachment_patch_model.to_dict() assert volume_attachment_patch_model_json2 == volume_attachment_patch_model_json +class TestModel_VolumeAttachmentPrototype(): + """ + Test Class for VolumeAttachmentPrototype + """ + + def test_volume_attachment_prototype_serialization(self): + """ + Test serialization/deserialization for VolumeAttachmentPrototype + """ + + # Construct dict forms of any model objects needed in order to build this model. + + volume_attachment_prototype_volume_model = {} # VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById + volume_attachment_prototype_volume_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5' + + # Construct a json representation of a VolumeAttachmentPrototype model + volume_attachment_prototype_model_json = {} + volume_attachment_prototype_model_json['delete_volume_on_instance_delete'] = False + volume_attachment_prototype_model_json['name'] = 'my-volume-attachment' + volume_attachment_prototype_model_json['volume'] = volume_attachment_prototype_volume_model + + # Construct a model instance of VolumeAttachmentPrototype by calling from_dict on the json representation + volume_attachment_prototype_model = VolumeAttachmentPrototype.from_dict(volume_attachment_prototype_model_json) + assert volume_attachment_prototype_model != False + + # Construct a model instance of VolumeAttachmentPrototype by calling from_dict on the json representation + volume_attachment_prototype_model_dict = VolumeAttachmentPrototype.from_dict(volume_attachment_prototype_model_json).__dict__ + volume_attachment_prototype_model2 = VolumeAttachmentPrototype(**volume_attachment_prototype_model_dict) + + # Verify the model instances are equivalent + assert volume_attachment_prototype_model == volume_attachment_prototype_model2 + + # Convert model instance back to dict and verify no loss of data + volume_attachment_prototype_model_json2 = volume_attachment_prototype_model.to_dict() + assert volume_attachment_prototype_model_json2 == volume_attachment_prototype_model_json + class TestModel_VolumeAttachmentPrototypeInstanceByImageContext(): """ Test Class for VolumeAttachmentPrototypeInstanceByImageContext @@ -54091,42 +54691,6 @@ def test_volume_attachment_prototype_instance_by_source_snapshot_context_seriali volume_attachment_prototype_instance_by_source_snapshot_context_model_json2 = volume_attachment_prototype_instance_by_source_snapshot_context_model.to_dict() assert volume_attachment_prototype_instance_by_source_snapshot_context_model_json2 == volume_attachment_prototype_instance_by_source_snapshot_context_model_json -class TestModel_VolumeAttachmentPrototypeInstanceContext(): - """ - Test Class for VolumeAttachmentPrototypeInstanceContext - """ - - def test_volume_attachment_prototype_instance_context_serialization(self): - """ - Test serialization/deserialization for VolumeAttachmentPrototypeInstanceContext - """ - - # Construct dict forms of any model objects needed in order to build this model. - - volume_attachment_volume_prototype_instance_context_model = {} # VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById - volume_attachment_volume_prototype_instance_context_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5' - - # Construct a json representation of a VolumeAttachmentPrototypeInstanceContext model - volume_attachment_prototype_instance_context_model_json = {} - volume_attachment_prototype_instance_context_model_json['delete_volume_on_instance_delete'] = True - volume_attachment_prototype_instance_context_model_json['name'] = 'my-volume-attachment' - volume_attachment_prototype_instance_context_model_json['volume'] = volume_attachment_volume_prototype_instance_context_model - - # Construct a model instance of VolumeAttachmentPrototypeInstanceContext by calling from_dict on the json representation - volume_attachment_prototype_instance_context_model = VolumeAttachmentPrototypeInstanceContext.from_dict(volume_attachment_prototype_instance_context_model_json) - assert volume_attachment_prototype_instance_context_model != False - - # Construct a model instance of VolumeAttachmentPrototypeInstanceContext by calling from_dict on the json representation - volume_attachment_prototype_instance_context_model_dict = VolumeAttachmentPrototypeInstanceContext.from_dict(volume_attachment_prototype_instance_context_model_json).__dict__ - volume_attachment_prototype_instance_context_model2 = VolumeAttachmentPrototypeInstanceContext(**volume_attachment_prototype_instance_context_model_dict) - - # Verify the model instances are equivalent - assert volume_attachment_prototype_instance_context_model == volume_attachment_prototype_instance_context_model2 - - # Convert model instance back to dict and verify no loss of data - volume_attachment_prototype_instance_context_model_json2 = volume_attachment_prototype_instance_context_model.to_dict() - assert volume_attachment_prototype_instance_context_model_json2 == volume_attachment_prototype_instance_context_model_json - class TestModel_VolumeAttachmentReferenceInstanceContext(): """ Test Class for VolumeAttachmentReferenceInstanceContext @@ -54312,6 +54876,11 @@ def test_volume_collection_serialization(self): 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' + volume_health_reason_model = {} # VolumeHealthReason + volume_health_reason_model['code'] = 'initializing_from_snapshot' + volume_health_reason_model['message'] = 'Performance will be degraded while this volume is being initialized from its snapshot' + volume_health_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf' + operating_system_reference_model = {} # OperatingSystemReference operating_system_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64' operating_system_reference_model['name'] = 'ubuntu-16-amd64' @@ -54390,6 +54959,8 @@ def test_volume_collection_serialization(self): volume_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5' volume_model['encryption'] = 'provider_managed' volume_model['encryption_key'] = encryption_key_reference_model + volume_model['health_reasons'] = [volume_health_reason_model] + volume_model['health_state'] = 'ok' volume_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5' volume_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5' volume_model['iops'] = 10000 @@ -54485,6 +55056,37 @@ def test_volume_collection_next_serialization(self): volume_collection_next_model_json2 = volume_collection_next_model.to_dict() assert volume_collection_next_model_json2 == volume_collection_next_model_json +class TestModel_VolumeHealthReason(): + """ + Test Class for VolumeHealthReason + """ + + def test_volume_health_reason_serialization(self): + """ + Test serialization/deserialization for VolumeHealthReason + """ + + # Construct a json representation of a VolumeHealthReason model + volume_health_reason_model_json = {} + volume_health_reason_model_json['code'] = 'initializing_from_snapshot' + volume_health_reason_model_json['message'] = 'Performance will be degraded while this volume is being initialized from its snapshot' + volume_health_reason_model_json['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf' + + # Construct a model instance of VolumeHealthReason by calling from_dict on the json representation + volume_health_reason_model = VolumeHealthReason.from_dict(volume_health_reason_model_json) + assert volume_health_reason_model != False + + # Construct a model instance of VolumeHealthReason by calling from_dict on the json representation + volume_health_reason_model_dict = VolumeHealthReason.from_dict(volume_health_reason_model_json).__dict__ + volume_health_reason_model2 = VolumeHealthReason(**volume_health_reason_model_dict) + + # Verify the model instances are equivalent + assert volume_health_reason_model == volume_health_reason_model2 + + # Convert model instance back to dict and verify no loss of data + volume_health_reason_model_json2 = volume_health_reason_model.to_dict() + assert volume_health_reason_model_json2 == volume_health_reason_model_json + class TestModel_VolumePatch(): """ Test Class for VolumePatch @@ -54983,6 +55585,44 @@ def test_zone_reference_serialization(self): zone_reference_model_json2 = zone_reference_model.to_dict() assert zone_reference_model_json2 == zone_reference_model_json +class TestModel_BackupPolicyJobSourceVolumeReference(): + """ + Test Class for BackupPolicyJobSourceVolumeReference + """ + + def test_backup_policy_job_source_volume_reference_serialization(self): + """ + Test serialization/deserialization for BackupPolicyJobSourceVolumeReference + """ + + # Construct dict forms of any model objects needed in order to build this model. + + volume_reference_deleted_model = {} # VolumeReferenceDeleted + volume_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + # Construct a json representation of a BackupPolicyJobSourceVolumeReference model + backup_policy_job_source_volume_reference_model_json = {} + backup_policy_job_source_volume_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5' + backup_policy_job_source_volume_reference_model_json['deleted'] = volume_reference_deleted_model + backup_policy_job_source_volume_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5' + backup_policy_job_source_volume_reference_model_json['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5' + backup_policy_job_source_volume_reference_model_json['name'] = 'my-volume' + + # Construct a model instance of BackupPolicyJobSourceVolumeReference by calling from_dict on the json representation + backup_policy_job_source_volume_reference_model = BackupPolicyJobSourceVolumeReference.from_dict(backup_policy_job_source_volume_reference_model_json) + assert backup_policy_job_source_volume_reference_model != False + + # Construct a model instance of BackupPolicyJobSourceVolumeReference by calling from_dict on the json representation + backup_policy_job_source_volume_reference_model_dict = BackupPolicyJobSourceVolumeReference.from_dict(backup_policy_job_source_volume_reference_model_json).__dict__ + backup_policy_job_source_volume_reference_model2 = BackupPolicyJobSourceVolumeReference(**backup_policy_job_source_volume_reference_model_dict) + + # Verify the model instances are equivalent + assert backup_policy_job_source_volume_reference_model == backup_policy_job_source_volume_reference_model2 + + # Convert model instance back to dict and verify no loss of data + backup_policy_job_source_volume_reference_model_json2 = backup_policy_job_source_volume_reference_model.to_dict() + assert backup_policy_job_source_volume_reference_model_json2 == backup_policy_job_source_volume_reference_model_json + class TestModel_BareMetalServerBootTargetBareMetalServerDiskReference(): """ Test Class for BareMetalServerBootTargetBareMetalServerDiskReference @@ -55003,7 +55643,7 @@ def test_bare_metal_server_boot_target_bare_metal_server_disk_reference_serializ bare_metal_server_boot_target_bare_metal_server_disk_reference_model_json['deleted'] = bare_metal_server_disk_reference_deleted_model bare_metal_server_boot_target_bare_metal_server_disk_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e' bare_metal_server_boot_target_bare_metal_server_disk_reference_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' - bare_metal_server_boot_target_bare_metal_server_disk_reference_model_json['name'] = 'my-bare-metal-disk' + bare_metal_server_boot_target_bare_metal_server_disk_reference_model_json['name'] = 'my-bare-metal-server-disk' bare_metal_server_boot_target_bare_metal_server_disk_reference_model_json['resource_type'] = 'bare_metal_server_disk' # Construct a model instance of BareMetalServerBootTargetBareMetalServerDiskReference by calling from_dict on the json representation @@ -59385,13 +60025,13 @@ def test_instance_prototype_instance_by_catalog_offering_serialization(self): 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_volume_model = {} # VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById + volume_attachment_prototype_volume_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 + volume_attachment_prototype_model = {} # VolumeAttachmentPrototype + volume_attachment_prototype_model['delete_volume_on_instance_delete'] = False + volume_attachment_prototype_model['name'] = 'my-volume-attachment' + volume_attachment_prototype_model['volume'] = volume_attachment_prototype_volume_model vpc_identity_model = {} # VPCIdentityById vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' @@ -59437,7 +60077,7 @@ def test_instance_prototype_instance_by_catalog_offering_serialization(self): 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['volume_attachments'] = [volume_attachment_prototype_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 @@ -59514,13 +60154,13 @@ def test_instance_prototype_instance_by_image_serialization(self): 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_volume_model = {} # VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById + volume_attachment_prototype_volume_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 + volume_attachment_prototype_model = {} # VolumeAttachmentPrototype + volume_attachment_prototype_model['delete_volume_on_instance_delete'] = False + volume_attachment_prototype_model['name'] = 'my-volume-attachment' + volume_attachment_prototype_model['volume'] = volume_attachment_prototype_volume_model vpc_identity_model = {} # VPCIdentityById vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' @@ -59563,7 +60203,7 @@ def test_instance_prototype_instance_by_image_serialization(self): instance_prototype_instance_by_image_model_json['resource_group'] = resource_group_identity_model instance_prototype_instance_by_image_model_json['total_volume_bandwidth'] = 500 instance_prototype_instance_by_image_model_json['user_data'] = 'testString' - instance_prototype_instance_by_image_model_json['volume_attachments'] = [volume_attachment_prototype_instance_context_model] + instance_prototype_instance_by_image_model_json['volume_attachments'] = [volume_attachment_prototype_model] instance_prototype_instance_by_image_model_json['vpc'] = vpc_identity_model instance_prototype_instance_by_image_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model instance_prototype_instance_by_image_model_json['image'] = image_identity_model @@ -59640,13 +60280,13 @@ def test_instance_prototype_instance_by_source_snapshot_serialization(self): 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_volume_model = {} # VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById + volume_attachment_prototype_volume_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 + volume_attachment_prototype_model = {} # VolumeAttachmentPrototype + volume_attachment_prototype_model['delete_volume_on_instance_delete'] = False + volume_attachment_prototype_model['name'] = 'my-volume-attachment' + volume_attachment_prototype_model['volume'] = volume_attachment_prototype_volume_model vpc_identity_model = {} # VPCIdentityById vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' @@ -59690,7 +60330,7 @@ def test_instance_prototype_instance_by_source_snapshot_serialization(self): instance_prototype_instance_by_source_snapshot_model_json['resource_group'] = resource_group_identity_model instance_prototype_instance_by_source_snapshot_model_json['total_volume_bandwidth'] = 500 instance_prototype_instance_by_source_snapshot_model_json['user_data'] = 'testString' - instance_prototype_instance_by_source_snapshot_model_json['volume_attachments'] = [volume_attachment_prototype_instance_context_model] + instance_prototype_instance_by_source_snapshot_model_json['volume_attachments'] = [volume_attachment_prototype_model] instance_prototype_instance_by_source_snapshot_model_json['vpc'] = vpc_identity_model instance_prototype_instance_by_source_snapshot_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_source_snapshot_context_model instance_prototype_instance_by_source_snapshot_model_json['primary_network_interface'] = network_interface_prototype_model @@ -59766,13 +60406,13 @@ def test_instance_prototype_instance_by_source_template_serialization(self): 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_volume_model = {} # VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById + volume_attachment_prototype_volume_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 + volume_attachment_prototype_model = {} # VolumeAttachmentPrototype + volume_attachment_prototype_model['delete_volume_on_instance_delete'] = False + volume_attachment_prototype_model['name'] = 'my-volume-attachment' + volume_attachment_prototype_model['volume'] = volume_attachment_prototype_volume_model vpc_identity_model = {} # VPCIdentityById vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' @@ -59824,7 +60464,7 @@ def test_instance_prototype_instance_by_source_template_serialization(self): instance_prototype_instance_by_source_template_model_json['resource_group'] = resource_group_identity_model instance_prototype_instance_by_source_template_model_json['total_volume_bandwidth'] = 500 instance_prototype_instance_by_source_template_model_json['user_data'] = 'testString' - instance_prototype_instance_by_source_template_model_json['volume_attachments'] = [volume_attachment_prototype_instance_context_model] + instance_prototype_instance_by_source_template_model_json['volume_attachments'] = [volume_attachment_prototype_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 @@ -59990,13 +60630,13 @@ def test_instance_template_prototype_instance_by_catalog_offering_serialization( 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_volume_model = {} # VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById + volume_attachment_prototype_volume_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 + volume_attachment_prototype_model = {} # VolumeAttachmentPrototype + volume_attachment_prototype_model['delete_volume_on_instance_delete'] = False + volume_attachment_prototype_model['name'] = 'my-volume-attachment' + volume_attachment_prototype_model['volume'] = volume_attachment_prototype_volume_model vpc_identity_model = {} # VPCIdentityById vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' @@ -60042,7 +60682,7 @@ def test_instance_template_prototype_instance_by_catalog_offering_serialization( 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['volume_attachments'] = [volume_attachment_prototype_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 @@ -60119,13 +60759,13 @@ def test_instance_template_prototype_instance_by_image_serialization(self): 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_volume_model = {} # VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById + volume_attachment_prototype_volume_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 + volume_attachment_prototype_model = {} # VolumeAttachmentPrototype + volume_attachment_prototype_model['delete_volume_on_instance_delete'] = False + volume_attachment_prototype_model['name'] = 'my-volume-attachment' + volume_attachment_prototype_model['volume'] = volume_attachment_prototype_volume_model vpc_identity_model = {} # VPCIdentityById vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' @@ -60168,7 +60808,7 @@ def test_instance_template_prototype_instance_by_image_serialization(self): instance_template_prototype_instance_by_image_model_json['resource_group'] = resource_group_identity_model instance_template_prototype_instance_by_image_model_json['total_volume_bandwidth'] = 500 instance_template_prototype_instance_by_image_model_json['user_data'] = 'testString' - instance_template_prototype_instance_by_image_model_json['volume_attachments'] = [volume_attachment_prototype_instance_context_model] + instance_template_prototype_instance_by_image_model_json['volume_attachments'] = [volume_attachment_prototype_model] instance_template_prototype_instance_by_image_model_json['vpc'] = vpc_identity_model instance_template_prototype_instance_by_image_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model instance_template_prototype_instance_by_image_model_json['image'] = image_identity_model @@ -60245,13 +60885,13 @@ def test_instance_template_prototype_instance_by_source_snapshot_serialization(s 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_volume_model = {} # VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById + volume_attachment_prototype_volume_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 + volume_attachment_prototype_model = {} # VolumeAttachmentPrototype + volume_attachment_prototype_model['delete_volume_on_instance_delete'] = False + volume_attachment_prototype_model['name'] = 'my-volume-attachment' + volume_attachment_prototype_model['volume'] = volume_attachment_prototype_volume_model vpc_identity_model = {} # VPCIdentityById vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' @@ -60295,7 +60935,7 @@ def test_instance_template_prototype_instance_by_source_snapshot_serialization(s 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['volume_attachments'] = [volume_attachment_prototype_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 @@ -60371,13 +61011,13 @@ def test_instance_template_prototype_instance_by_source_template_serialization(s 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_volume_model = {} # VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById + volume_attachment_prototype_volume_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 + volume_attachment_prototype_model = {} # VolumeAttachmentPrototype + volume_attachment_prototype_model['delete_volume_on_instance_delete'] = False + volume_attachment_prototype_model['name'] = 'my-volume-attachment' + volume_attachment_prototype_model['volume'] = volume_attachment_prototype_volume_model vpc_identity_model = {} # VPCIdentityById vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' @@ -60429,7 +61069,7 @@ def test_instance_template_prototype_instance_by_source_template_serialization(s instance_template_prototype_instance_by_source_template_model_json['resource_group'] = resource_group_identity_model instance_template_prototype_instance_by_source_template_model_json['total_volume_bandwidth'] = 500 instance_template_prototype_instance_by_source_template_model_json['user_data'] = 'testString' - 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['volume_attachments'] = [volume_attachment_prototype_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 @@ -60510,13 +61150,13 @@ def test_instance_template_instance_by_catalog_offering_serialization(self): 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_volume_model = {} # VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById + volume_attachment_prototype_volume_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 + volume_attachment_prototype_model = {} # VolumeAttachmentPrototype + volume_attachment_prototype_model['delete_volume_on_instance_delete'] = False + volume_attachment_prototype_model['name'] = 'my-volume-attachment' + volume_attachment_prototype_model['volume'] = volume_attachment_prototype_volume_model vpc_identity_model = {} # VPCIdentityById vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' @@ -60566,7 +61206,7 @@ def test_instance_template_instance_by_catalog_offering_serialization(self): 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['volume_attachments'] = [volume_attachment_prototype_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 @@ -60645,13 +61285,13 @@ def test_instance_template_instance_by_image_serialization(self): 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_volume_model = {} # VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById + volume_attachment_prototype_volume_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 + volume_attachment_prototype_model = {} # VolumeAttachmentPrototype + volume_attachment_prototype_model['delete_volume_on_instance_delete'] = False + volume_attachment_prototype_model['name'] = 'my-volume-attachment' + volume_attachment_prototype_model['volume'] = volume_attachment_prototype_volume_model vpc_identity_model = {} # VPCIdentityById vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' @@ -60698,7 +61338,7 @@ def test_instance_template_instance_by_image_serialization(self): instance_template_instance_by_image_model_json['resource_group'] = resource_group_reference_model instance_template_instance_by_image_model_json['total_volume_bandwidth'] = 500 instance_template_instance_by_image_model_json['user_data'] = 'testString' - instance_template_instance_by_image_model_json['volume_attachments'] = [volume_attachment_prototype_instance_context_model] + instance_template_instance_by_image_model_json['volume_attachments'] = [volume_attachment_prototype_model] instance_template_instance_by_image_model_json['vpc'] = vpc_identity_model instance_template_instance_by_image_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model instance_template_instance_by_image_model_json['image'] = image_identity_model @@ -60777,13 +61417,13 @@ def test_instance_template_instance_by_source_snapshot_serialization(self): 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_volume_model = {} # VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById + volume_attachment_prototype_volume_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 + volume_attachment_prototype_model = {} # VolumeAttachmentPrototype + volume_attachment_prototype_model['delete_volume_on_instance_delete'] = False + volume_attachment_prototype_model['name'] = 'my-volume-attachment' + volume_attachment_prototype_model['volume'] = volume_attachment_prototype_volume_model vpc_identity_model = {} # VPCIdentityById vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' @@ -60831,7 +61471,7 @@ def test_instance_template_instance_by_source_snapshot_serialization(self): instance_template_instance_by_source_snapshot_model_json['resource_group'] = resource_group_reference_model instance_template_instance_by_source_snapshot_model_json['total_volume_bandwidth'] = 500 instance_template_instance_by_source_snapshot_model_json['user_data'] = 'testString' - instance_template_instance_by_source_snapshot_model_json['volume_attachments'] = [volume_attachment_prototype_instance_context_model] + instance_template_instance_by_source_snapshot_model_json['volume_attachments'] = [volume_attachment_prototype_model] instance_template_instance_by_source_snapshot_model_json['vpc'] = vpc_identity_model instance_template_instance_by_source_snapshot_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_source_snapshot_context_model instance_template_instance_by_source_snapshot_model_json['primary_network_interface'] = network_interface_prototype_model @@ -66296,7 +66936,7 @@ def test_instance_group_manager_action_scheduled_action_group_target_serializati instance_group_manager_action_scheduled_action_group_target_model_json['status'] = 'active' instance_group_manager_action_scheduled_action_group_target_model_json['updated_at'] = '2019-01-01T12:00:00Z' instance_group_manager_action_scheduled_action_group_target_model_json['action_type'] = 'scheduled' - instance_group_manager_action_scheduled_action_group_target_model_json['cron_spec'] = '*/5 1,2,3 * * *' + instance_group_manager_action_scheduled_action_group_target_model_json['cron_spec'] = '30 */2 * * 1-5' instance_group_manager_action_scheduled_action_group_target_model_json['last_applied_at'] = '2019-01-01T12:00:00Z' instance_group_manager_action_scheduled_action_group_target_model_json['next_run_at'] = '2019-01-01T12:00:00Z' instance_group_manager_action_scheduled_action_group_target_model_json['group'] = instance_group_manager_scheduled_action_group_model @@ -66351,7 +66991,7 @@ def test_instance_group_manager_action_scheduled_action_manager_target_serializa instance_group_manager_action_scheduled_action_manager_target_model_json['status'] = 'active' instance_group_manager_action_scheduled_action_manager_target_model_json['updated_at'] = '2019-01-01T12:00:00Z' instance_group_manager_action_scheduled_action_manager_target_model_json['action_type'] = 'scheduled' - instance_group_manager_action_scheduled_action_manager_target_model_json['cron_spec'] = '*/5 1,2,3 * * *' + instance_group_manager_action_scheduled_action_manager_target_model_json['cron_spec'] = '30 */2 * * 1-5' instance_group_manager_action_scheduled_action_manager_target_model_json['last_applied_at'] = '2019-01-01T12:00:00Z' instance_group_manager_action_scheduled_action_manager_target_model_json['next_run_at'] = '2019-01-01T12:00:00Z' instance_group_manager_action_scheduled_action_manager_target_model_json['manager'] = instance_group_manager_scheduled_action_manager_model @@ -67739,181 +68379,6 @@ 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_json2 = volume_attachment_prototype_volume_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_source_snapshot_model.to_dict() assert volume_attachment_prototype_volume_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_source_snapshot_model_json2 == volume_attachment_prototype_volume_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_source_snapshot_model_json -class TestModel_VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByCRN(): - """ - Test Class for VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByCRN - """ - - def test_volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_crn_serialization(self): - """ - Test serialization/deserialization for VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByCRN - """ - - # Construct a json representation of a VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByCRN model - volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_crn_model_json = {} - volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5' - - # Construct a model instance of VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByCRN by calling from_dict on the json representation - volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_crn_model = VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByCRN.from_dict(volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_crn_model_json) - assert volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_crn_model != False - - # Construct a model instance of VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByCRN by calling from_dict on the json representation - volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_crn_model_dict = VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByCRN.from_dict(volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_crn_model_json).__dict__ - volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_crn_model2 = VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByCRN(**volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_crn_model_dict) - - # Verify the model instances are equivalent - assert volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_crn_model == volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_crn_model2 - - # Convert model instance back to dict and verify no loss of data - volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_crn_model_json2 = volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_crn_model.to_dict() - assert volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_crn_model_json2 == volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_crn_model_json - -class TestModel_VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByHref(): - """ - Test Class for VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByHref - """ - - def test_volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_href_serialization(self): - """ - Test serialization/deserialization for VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByHref - """ - - # Construct a json representation of a VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByHref model - volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_href_model_json = {} - volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5' - - # Construct a model instance of VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByHref by calling from_dict on the json representation - volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_href_model = VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByHref.from_dict(volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_href_model_json) - assert volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_href_model != False - - # Construct a model instance of VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByHref by calling from_dict on the json representation - volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_href_model_dict = VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByHref.from_dict(volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_href_model_json).__dict__ - volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_href_model2 = VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityByHref(**volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_href_model_dict) - - # Verify the model instances are equivalent - assert volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_href_model == volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_href_model2 - - # Convert model instance back to dict and verify no loss of data - volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_href_model_json2 = volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_href_model.to_dict() - assert volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_href_model_json2 == volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_href_model_json - -class TestModel_VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById(): - """ - Test Class for VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById - """ - - def test_volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_id_serialization(self): - """ - Test serialization/deserialization for VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById - """ - - # Construct a json representation of a VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById model - volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_id_model_json = {} - volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_id_model_json['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5' - - # Construct a model instance of VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById by calling from_dict on the json representation - volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_id_model = VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById.from_dict(volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_id_model_json) - assert volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_id_model != False - - # Construct a model instance of VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById by calling from_dict on the json representation - volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_id_model_dict = VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById.from_dict(volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_id_model_json).__dict__ - volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_id_model2 = VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById(**volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_id_model_dict) - - # Verify the model instances are equivalent - assert volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_id_model == volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_id_model2 - - # Convert model instance back to dict and verify no loss of data - volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_id_model_json2 = volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_id_model.to_dict() - assert volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_id_model_json2 == volume_attachment_volume_prototype_instance_context_volume_identity_volume_identity_by_id_model_json - -class TestModel_VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity(): - """ - Test Class for VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity - """ - - def test_volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_capacity_serialization(self): - """ - Test serialization/deserialization for VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity - """ - - # Construct dict forms of any model objects needed in order to build this model. - - volume_profile_identity_model = {} # VolumeProfileIdentityByName - volume_profile_identity_model['name'] = 'general-purpose' - - 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' - - # Construct a json representation of a VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity model - volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_capacity_model_json = {} - 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 - - # Construct a model instance of VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity by calling from_dict on the json representation - volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_capacity_model = VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity.from_dict(volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_capacity_model_json) - assert volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_capacity_model != False - - # Construct a model instance of VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity by calling from_dict on the json representation - volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_capacity_model_dict = VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity.from_dict(volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_capacity_model_json).__dict__ - volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_capacity_model2 = VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity(**volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_capacity_model_dict) - - # Verify the model instances are equivalent - assert volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_capacity_model == volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_capacity_model2 - - # Convert model instance back to dict and verify no loss of data - volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_capacity_model_json2 = volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_capacity_model.to_dict() - assert volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_capacity_model_json2 == volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_capacity_model_json - -class TestModel_VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot(): - """ - Test Class for VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot - """ - - def test_volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_source_snapshot_serialization(self): - """ - Test serialization/deserialization for VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot - """ - - # Construct dict forms of any model objects needed in order to build this model. - - volume_profile_identity_model = {} # VolumeProfileIdentityByName - volume_profile_identity_model['name'] = 'general-purpose' - - 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' - - snapshot_identity_model = {} # SnapshotIdentityById - snapshot_identity_model['id'] = '349a61d8-7ab1-420f-a690-5fed76ef9d4f' - - # Construct a json representation of a VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot model - volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_source_snapshot_model_json = {} - 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 - - # Construct a model instance of VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot by calling from_dict on the json representation - volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_source_snapshot_model = VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot.from_dict(volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_source_snapshot_model_json) - assert volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_source_snapshot_model != False - - # Construct a model instance of VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot by calling from_dict on the json representation - volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_source_snapshot_model_dict = VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot.from_dict(volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_source_snapshot_model_json).__dict__ - volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_source_snapshot_model2 = VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot(**volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_source_snapshot_model_dict) - - # Verify the model instances are equivalent - assert volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_source_snapshot_model == volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_source_snapshot_model2 - - # Convert model instance back to dict and verify no loss of data - volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_source_snapshot_model_json2 = volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_source_snapshot_model.to_dict() - assert volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_source_snapshot_model_json2 == volume_attachment_volume_prototype_instance_context_volume_prototype_instance_context_volume_prototype_instance_context_volume_by_source_snapshot_model_json - class TestModel_InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup(): """ Test Class for InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup @@ -67932,7 +68397,7 @@ def test_instance_group_manager_action_prototype_scheduled_action_prototype_by_c # Construct a json representation of a InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup model instance_group_manager_action_prototype_scheduled_action_prototype_by_cron_spec_by_group_model_json = {} instance_group_manager_action_prototype_scheduled_action_prototype_by_cron_spec_by_group_model_json['name'] = 'my-instance-group-manager-action' - instance_group_manager_action_prototype_scheduled_action_prototype_by_cron_spec_by_group_model_json['cron_spec'] = '*/5 1,2,3 * * *' + instance_group_manager_action_prototype_scheduled_action_prototype_by_cron_spec_by_group_model_json['cron_spec'] = '30 */2 * * 1-5' instance_group_manager_action_prototype_scheduled_action_prototype_by_cron_spec_by_group_model_json['group'] = instance_group_manager_scheduled_action_group_prototype_model # Construct a model instance of InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup by calling from_dict on the json representation @@ -67970,7 +68435,7 @@ def test_instance_group_manager_action_prototype_scheduled_action_prototype_by_c # Construct a json representation of a InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager model instance_group_manager_action_prototype_scheduled_action_prototype_by_cron_spec_by_manager_model_json = {} instance_group_manager_action_prototype_scheduled_action_prototype_by_cron_spec_by_manager_model_json['name'] = 'my-instance-group-manager-action' - instance_group_manager_action_prototype_scheduled_action_prototype_by_cron_spec_by_manager_model_json['cron_spec'] = '*/5 1,2,3 * * *' + instance_group_manager_action_prototype_scheduled_action_prototype_by_cron_spec_by_manager_model_json['cron_spec'] = '30 */2 * * 1-5' instance_group_manager_action_prototype_scheduled_action_prototype_by_cron_spec_by_manager_model_json['manager'] = instance_group_manager_scheduled_action_manager_prototype_model # Construct a model instance of InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager by calling from_dict on the json representation